Add Selectable::highestAvailableVersionObj. (bnc #557557)
[platform/upstream/libzypp.git] / zypp / ui / SelectableImpl.h
index e5167a2..ef71ef7 100644 (file)
@@ -168,6 +168,18 @@ namespace zypp
         return _defaultCandidate;
       }
 
+      /** \copydoc Selectable::highestAvailableVersionObj() */
+      PoolItem highestAvailableVersionObj() const
+      {
+        PoolItem ret;
+        for_( it, availableBegin(), availableEnd() )
+        {
+          if ( !ret || (*it).satSolvable().edition() > ret.satSolvable().edition() )
+            ret = *it;
+        }
+        return ret;
+      }
+
       /** \c True if \a rhs has the same content as an installed one.
        * \see \ref sat::Solvable::identical
        */