On Wednesday 25 June 2008 15:29, Duncan Mac-Vicar Prett wrote:
/local_home/sh/yast2/trunk/qt-pkg/src/YQPkgObjList.cc:540: warning: 'hasInstalledObj' is deprecated (declared at /usr/include/zypp/ui/Selectable.h:163)
OK. So that function is deprecated. Hopefully there is a substitute for it that does the same thing in some modern, fancy way. But...
The replacement is just installedEmpty and no, it was not deprecated for fun. As there is no longer _one_ installed object, it is consistent to ask for the emptyness or the size of the container of installed objects.
That doesn't make the old function hasInstalledObj() any less valid or useful. It queries if there is an installed object, i.e. if the number of installed objects is > 0. If there can now be more than one installed object, that doesn't change anything: The function will return 'true' just as well. The number of installed objects is irrelevant here, just the fact that there is at least one. That's also why the comment says what to use now as a replacement: Selectable.h: /** * True if installed object is present. * \deprecated Use ! installedEmpty() */ ZYPP_DEPRECATED bool hasInstalledObj() const { return ! installedEmpty(); } So rather than obfuscate the calling code with the negated counterpart, we might as well simply keep the original function. CU -- Stefan Hundhammer <sh@suse.de> Penguin by conviction. YaST2 Development SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org