On Monday 17 November 2008 23:11:49 Jan Kupec wrote:
theObj is a ui hack. The ui uses it e.g. in the list views to display a summary. The ui does not care about which objects summary it is. It should be the 'most interesting one'. That's why it always picks a selected item. The one that will get installed is 'interesting'.
OK, but in that case the description of the method was wrong and it fooled me to use the method in zypper. I fixed the description (Michael, pls check it) and will replace the remaining usages in zypper.
+ /** + * Returns one of available objects, specifically either the user + * selected candidate or a default. + * + * Default is either the first available object which has the same arch + * as one of the installed objects, or the first available object + * (if none of available arch matches the arch of the installed objects), + * or empty. + * + * \return a PoolItem according to the describe criteria No, you should not try to describe implementation details in the description as they change (and the description is not correct anyway). The method returns the 'Best' or 'most interesting' among all available objects. One that is, or is likely to be, chosen for installation. Nothing else. + /** + * The object whose summary to show in the UIs. + * + * \return the \ref candidateObj(), if not empty, or the first of installed + * objects or an empty \ref PoolItem. + * \see candidateObj() It's not the 'object whose summary to show in the UIs'. Yes, UI does it that way, but but that does not mean it is OK. ;) The method returns you the candidate, or ,if no available objects exist, the last one installed.
What still puzzles me, though, is why theObj() returns different objects if i change repo priorities (like in bug #437854):
Of course, as the repo priority influences the what might get selected. The candidate (and also theObj) may change at any time. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org