From 20324e238661b524f13cd06730d6fa924f24f22a Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Thu, 3 Dec 2009 16:33:16 +0100 Subject: [PATCH] Provide Selectable::setPickStatus instead of pickInstall/Delete --- zypp/ui/Selectable.cc | 7 ++----- zypp/ui/Selectable.h | 19 ++----------------- zypp/ui/SelectableImpl.cc | 18 +++--------------- zypp/ui/SelectableImpl.h | 4 +--- 4 files changed, 8 insertions(+), 40 deletions(-) diff --git a/zypp/ui/Selectable.cc b/zypp/ui/Selectable.cc index 153c8d4..94ec2d9 100644 --- a/zypp/ui/Selectable.cc +++ b/zypp/ui/Selectable.cc @@ -154,11 +154,8 @@ namespace zypp bool Selectable::multiversionInstall() const { return _pimpl->multiversionInstall(); } - bool Selectable::pickInstall( const PoolItem & pi_r, ResStatus::TransactByValue causer_r, bool yesno_r ) - { return _pimpl->pickInstall( pi_r, causer_r, yesno_r ); } - - bool Selectable::pickDelete( const PoolItem & pi_r, ResStatus::TransactByValue causer_r, bool yesno_r ) - { return _pimpl->pickDelete( pi_r, causer_r, yesno_r ); } + bool Selectable::setPickStatus( const PoolItem & pi_r, const Status state_r, ResStatus::TransactByValue causer_r ) + { return _pimpl->setPickStatus( pi_r, state_r, causer_r ); } Status Selectable::pickStatus( const PoolItem & pi_r ) const { return _pimpl->pickStatus( pi_r ); } diff --git a/zypp/ui/Selectable.h b/zypp/ui/Selectable.h index 4826d7c..62ef05f 100644 --- a/zypp/ui/Selectable.h +++ b/zypp/ui/Selectable.h @@ -308,23 +308,8 @@ namespace zypp */ bool multiversionInstall() const; - /** Select a specific available item for installation. - */ - bool pickInstall( const PoolItem & pi_r, ResStatus::TransactByValue causer_r = ResStatus::USER, bool yesno_r = true ); - - /** Deselect a specific available item from installation. - */ - bool pickNoInstall( const PoolItem & pi_r, ResStatus::TransactByValue causer_r = ResStatus::USER ) - { return pickInstall( pi_r, causer_r, false ); } - - /** Select a specific installed item for deletion. - */ - bool pickDelete( const PoolItem & pi_r, ResStatus::TransactByValue causer_r = ResStatus::USER, bool yesno_r = true ); - - /** Deselect a specific installed item from deletion. - */ - bool pickNoDelete( const PoolItem & pi_r, ResStatus::TransactByValue causer_r = ResStatus::USER ) - { return pickDelete( pi_r, causer_r, false ); } + /** */ + bool setPickStatus( const PoolItem & pi_r, const Status state_r, ResStatus::TransactByValue causer_r = ResStatus::USER ); /** Compute the \ref ui::Status for an individual PoolItem. * This just takes into account the item and any identical diff --git a/zypp/ui/SelectableImpl.cc b/zypp/ui/SelectableImpl.cc index 877d636..5ecbfe5 100644 --- a/zypp/ui/SelectableImpl.cc +++ b/zypp/ui/SelectableImpl.cc @@ -323,25 +323,13 @@ namespace zypp return _candidate = newCandidate; } + /////////////////////////////////////////////////////////////////// - bool Selectable::Impl::pickInstall( const PoolItem & pi_r, ResStatus::TransactByValue causer_r, bool yesno_r ) - { - if ( pi_r.satSolvable().ident() != ident() || pi_r.satSolvable().isSystem() ) - return false; // not my PoolItem or an installed one - - return pi_r.status().setTransact( yesno_r, causer_r ); - } - - bool Selectable::Impl::pickDelete( const PoolItem & pi_r, ResStatus::TransactByValue causer_r, bool yesno_r ) + bool Selectable::Impl::setPickStatus( const PoolItem & pi_r, const Status state_r, ResStatus::TransactByValue causer_r ) { - if ( pi_r.satSolvable().ident() != ident() || ! pi_r.satSolvable().isSystem() ) - return false; // not my PoolItem or not installed - - return pi_r.status().setTransact( yesno_r, causer_r ); + return false; } - /////////////////////////////////////////////////////////////////// - Status Selectable::Impl::pickStatus( const PoolItem & pi_r ) const { if ( pi_r.satSolvable().ident() == ident() ) diff --git a/zypp/ui/SelectableImpl.h b/zypp/ui/SelectableImpl.h index 54bb1e8..3f437b5 100644 --- a/zypp/ui/SelectableImpl.h +++ b/zypp/ui/SelectableImpl.h @@ -285,9 +285,7 @@ namespace zypp bool multiversionInstall() const { return theObj().satSolvable().multiversionInstall(); } - bool pickInstall( const PoolItem & pi_r, ResStatus::TransactByValue causer_r, bool yesno_r ); - - bool pickDelete( const PoolItem & pi_r, ResStatus::TransactByValue causer_r, bool yesno_r ); + bool setPickStatus( const PoolItem & pi_r, const Status state_r, ResStatus::TransactByValue causer_r ); Status pickStatus( const PoolItem & pi_r ) const; -- 2.7.4