[zypp-commit] r8960 - in /trunk/libzypp/zypp: ResFilters.h ResObject.cc ResObject.h
Author: schubi2 Date: Fri Feb 29 12:54:58 2008 New Revision: 8960 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8960&view=rev Log: - added ByRepository again (Should be better in Filter.h" - Bugfix in getting repository Modified: trunk/libzypp/zypp/ResFilters.h trunk/libzypp/zypp/ResObject.cc trunk/libzypp/zypp/ResObject.h Modified: trunk/libzypp/zypp/ResFilters.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResFilters.h?rev=8960&r1=8959&r2=8960&view=diff ============================================================================== --- trunk/libzypp/zypp/ResFilters.h (original) +++ trunk/libzypp/zypp/ResFilters.h Fri Feb 29 12:54:58 2008 @@ -19,6 +19,7 @@ #include "zypp/CapFilters.h" #include "zypp/PoolItem.h" +#include "zypp/Repository.h" #include "zypp/CapAndItem.h" /////////////////////////////////////////////////////////////////// @@ -184,6 +185,25 @@ std::string _name; }; + /** Select ResObject by repository or repository alias. */ + struct ByRepository : public ResObjectFilterFunctor + { + ByRepository( Repository repository_r ) + : _alias( repository_r.info().alias() ) + {} + + ByRepository( const std::string & alias_r ) + : _alias( alias_r ) + {} + + bool operator()( ResObject::constPtr p ) const + { + return p->repoInfo().alias() == _alias; + } + + std::string _alias; + }; + /** Select ResObject by Edition using \a _Compare functor. * * Selects ResObject if <tt>_Compare( ResObject->edition(), _edition )</tt> Modified: trunk/libzypp/zypp/ResObject.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResObject.cc?rev=8960&r1=8959&r2=8960&view=diff ============================================================================== --- trunk/libzypp/zypp/ResObject.cc (original) +++ trunk/libzypp/zypp/ResObject.cc Fri Feb 29 12:54:58 2008 @@ -85,9 +85,6 @@ RepoInfo ResObject::repoInfo() const { return repository().info(); } - Repository ResObject::repository() const - { return repository(); } - unsigned ResObject::mediaNr() const { return lookupNumAttribute( sat::SolvAttr::medianr ); } Modified: trunk/libzypp/zypp/ResObject.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResObject.h?rev=8960&r1=8959&r2=8960&view=diff ============================================================================== --- trunk/libzypp/zypp/ResObject.h (original) +++ trunk/libzypp/zypp/ResObject.h Fri Feb 29 12:54:58 2008 @@ -63,6 +63,9 @@ using sat::Solvable::supportsRequestedLocales; /** Return the supported locales via locales_r. */ using sat::Solvable::getSupportedLocales; + + using sat::Solvable::repository;; + //@} public: @@ -121,11 +124,6 @@ */ RepoInfo repoInfo() const; - /** \ref Repository - * providing this resolvable. - */ - Repository repository() const; - /** * Media number where the resolvable is located * 0 if no media access is required. -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
schubi2@svn.opensuse.org