ref: refs/heads/master
commit d462b0a4b555ae5a6beb13e5ef052a44b011a5ae
Author: Michael Andres
Date: Wed Oct 28 15:27:35 2009 +0100
Selectable: Sort multiple installed items by (Arch, Edition, install time).
---
zypp/ui/SelectableTraits.h | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/zypp/ui/SelectableTraits.h b/zypp/ui/SelectableTraits.h
index c940289..b994bf7 100644
--- a/zypp/ui/SelectableTraits.h
+++ b/zypp/ui/SelectableTraits.h
@@ -66,7 +66,10 @@ namespace zypp
};
/** Oder on InstalledItemSet.
- * Newer install time at the beginning of the set.
+ * \li best Arch
+ * \li best Edition
+ * \li newer install time
+ * \li ResObject::constPtr as fallback.
*/
struct IOrder : public std::binary_function
{
@@ -76,6 +79,12 @@ namespace zypp
//
bool operator()( const PoolItem & lhs, const PoolItem & rhs ) const
{
+ int res = lhs->arch().compare( rhs->arch() );
+ if ( res )
+ return res > 0;
+ res = lhs->edition().compare( rhs->edition() );
+ if ( res )
+ return res > 0;
Date ldate = lhs->installtime();
Date rdate = rhs->installtime();
if ( ldate != rdate )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org