[yast-commit] r47982 - in /trunk/ncurses-pkg/src: NCPkgFilterRepo.cc NCZypp.h
Author: kmachalkova Date: Mon Jun 2 12:33:38 2008 New Revision: 47982 URL: http://svn.opensuse.org/viewcvs/yast?rev=47982&view=rev Log: Use zypp::PoolQuery API to filter the packs by repositories Modified: trunk/ncurses-pkg/src/NCPkgFilterRepo.cc trunk/ncurses-pkg/src/NCZypp.h Modified: trunk/ncurses-pkg/src/NCPkgFilterRepo.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgFilterRepo.cc?rev=47982&r1=47981&r2=47982&view=diff ============================================================================== --- trunk/ncurses-pkg/src/NCPkgFilterRepo.cc (original) +++ trunk/ncurses-pkg/src/NCPkgFilterRepo.cc Mon Jun 2 12:33:38 2008 @@ -220,7 +220,7 @@ pkgList->itemsCleared (); //sets to store matching packages - set <ZyppSel> exactMatch; + /* set <ZyppSel> exactMatch; set <ZyppSel> nearMatch; //iterate through the package pool @@ -257,17 +257,27 @@ ZyppPkg pkg = tryCastToZyppPkg( (*e_it)->theObj() ); pkgList->createListEntry ( pkg, *e_it); e_it++; - } + }*/ + + zypp::PoolQuery q; + q.addRepo( repo.info().alias() ); - set<ZyppSel>::const_iterator n_it = nearMatch.begin(); + + for( zypp::PoolQuery::Selectable_iterator it = q.selectableBegin(); + it != q.selectableEnd(); it++) + { + ZyppPkg pkg = tryCastToZyppPkg( (*it)->theObj() ); + pkgList->createListEntry ( pkg, *it); + } + + /*set<ZyppSel>::const_iterator n_it = nearMatch.begin(); while ( n_it != nearMatch.end() ) { - ZyppPkg pkg = tryCastToZyppPkg( (*n_it)->theObj() ); pkgList->createListEntry ( pkg, *n_it); n_it++; } - //and show the whole stuff to the user + //and show the whol stuff to the user*/ pkgList->drawList(); return true; Modified: trunk/ncurses-pkg/src/NCZypp.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCZypp.h?rev=47982&r1=47981&r2=47982&view=diff ============================================================================== --- trunk/ncurses-pkg/src/NCZypp.h (original) +++ trunk/ncurses-pkg/src/NCZypp.h Mon Jun 2 12:33:38 2008 @@ -32,6 +32,7 @@ #include <zypp/Patch.h> #include <zypp/ZYppFactory.h> #include <zypp/ResPoolProxy.h> +#include <zypp/PoolQuery.h> using zypp::ui::S_Protected; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org