Add ui::Selectable::isNeeded to indicate patch relevance
authorMichael Andres <ma@suse.de>
Wed, 16 Jul 2008 12:41:38 +0000 (12:41 +0000)
committerMichael Andres <ma@suse.de>
Wed, 16 Jul 2008 12:41:38 +0000 (12:41 +0000)
package/libzypp.changes
zypp/ui/Selectable.cc
zypp/ui/Selectable.h
zypp/ui/SelectableImpl.h

index f3c7d79..15a2c37 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Wed Jul 16 14:39:50 CEST 2008 - ma@suse.de
+
+- Add ui::Selectable::isNeeded to indicate patch relevance (bnc #409150)
+- revision 10595
+
+-------------------------------------------------------------------
 Wed Jul 16 01:10:37 CEST 2008 - ma@suse.de
 
 - Remove Atom, Script, Message and other obsolete classes.
index 9359a3f..3fc349b 100644 (file)
@@ -109,6 +109,9 @@ namespace zypp
     bool Selectable::isUnmaintained() const
     { return _pimpl->isUnmaintained(); }
 
+    bool Selectable::isNeeded() const
+    { return _pimpl->isNeeded(); }
+
     ResStatus::TransactByValue Selectable::modifiedBy() const
     { return _pimpl->modifiedBy(); }
 
index 2090731..cb622a9 100644 (file)
@@ -190,6 +190,12 @@ namespace zypp
        */
       bool isUnmaintained() const;
 
+      /** Whether the item is relevant but has broken requirements.
+       * A 'needed' Patch should be installed, while an 'unneeded' one
+       * is either applied or not relevant for the system.
+       */
+      bool isNeeded() const;
+
      public:
       /** \name Query objects fate in case of commit.
       */
@@ -251,6 +257,8 @@ namespace zypp
 
       /** Set LicenceConfirmed bit. */
       void setLicenceConfirmed( bool val_r = true );
+
+
       //@}
 
     public:
index ef8fc18..7ac47b5 100644 (file)
@@ -165,6 +165,12 @@ namespace zypp
       bool isUnmaintained() const
       { return availableEmpty(); }
 
+      bool isNeeded() const
+      {
+        PoolItem cand( candidateObj() );
+        return cand && cand.isBroken();
+      }
+
       /** Return who caused the modification. */
       ResStatus::TransactByValue modifiedBy() const;