Author: mlandres Date: Mon Nov 24 13:35:31 2008 New Revision: 11784 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11784&view=rev Log: Add status query onSystem/offSystem after commit Modified: trunk/libzypp/zypp/ResStatus.h trunk/libzypp/zypp/ui/Selectable.h Modified: trunk/libzypp/zypp/ResStatus.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResStatus.h?rev=11784&r1=11783&r2=11784&view=diff ============================================================================== --- trunk/libzypp/zypp/ResStatus.h (original) +++ trunk/libzypp/zypp/ResStatus.h Mon Nov 24 13:35:31 2008 @@ -268,6 +268,14 @@ TransactValue getTransactValue() const { return (TransactValue)_bitfield.value<TransactField>(); } + /** True if would be on system after commit. */ + bool onSystem() const + { return( isInstalled() != transacts() ); } + + /** True if would be off system after commit. */ + bool offSystem() const + { return ! onSystem(); } + bool isBySolver() const { return fieldValueIs<TransactByField>( SOLVER ); } Modified: trunk/libzypp/zypp/ui/Selectable.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ui/Selectable.h?rev=11784&r1=11783&r2=11784&view=diff ============================================================================== --- trunk/libzypp/zypp/ui/Selectable.h (original) +++ trunk/libzypp/zypp/ui/Selectable.h Mon Nov 24 13:35:31 2008 @@ -266,7 +266,7 @@ /** */ Fate fate() const; - /** True if either to delete or to install */ + /** True if neither to delete or to install */ bool unmodified() const { return fate() == UNMODIFIED; } @@ -282,6 +282,15 @@ bool toInstall() const { return fate() == TO_INSTALL; } + /** True if would be on system after commit. */ + bool onSystem() const + { return( ( hasInstalledObj() && !toDelete() ) + ||( hasCandidateObj() && toInstall() ) ); } + + /** True if would be off system after commit. */ + bool offSystem() const + { return ! onSystem(); } + /** */ bool setFate( Fate fate_r, ResStatus::TransactByValue causer_r = ResStatus::USER ); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org