Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 5f6934d..944bb83 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp @@ -22,14 +22,12 @@ PackageList::PackageList() statusDir="/usr/lib/ipkg/"; listsDir="/usr/lib/ipkg/lists/"; cfg.writeEntry( "statusDir", statusDir ); cfg.writeEntry( "listsDir", listsDir ); } } - pvDebug( 5, "PackageList::PackageList statusDir "+statusDir); - pvDebug( 5, "PackageList::PackageList listsDir "+listsDir); sections << "All"; subSections.insert("All", new QStringList() ); QStringList *ss = subSections["All"]; *ss << "All"; aktSection = "All"; aktSubSection = "All"; @@ -60,25 +58,28 @@ void PackageList::insertPackage( Package* pack ) origPackageList.insert( pack->name(), pack ); empty=false; }; updateSections( pack ); } -void PackageList::filterPackages() +void PackageList::filterPackages( QString f ) { packageList.clear(); QDictIterator<Package> filterIter( origPackageList ); filterIter.toFirst(); Package *pack= filterIter.current() ; while ( pack ) { - if ( ((aktSection=="All")||(pack->getSection()==aktSection)) && - ((aktSubSection=="All")||(pack->getSubSection()==aktSubSection)) ) - { - packageList.insert( pack->name(), pack ); - } + if ( + ((aktSection=="All")||(pack->getSection()==aktSection)) && + ((aktSubSection=="All")||(pack->getSubSection()==aktSubSection)) && + pack->name().contains( f ) + ) + { + packageList.insert( pack->name(), pack ); + } ++filterIter; pack = filterIter.current(); } } Package* PackageList::find( QString n ) @@ -211,6 +212,12 @@ void PackageList::setSettings( PackageManagerSettings *s ) } Package* PackageList::getByName( QString n ) { origPackageList[n]; } + +void PackageList::clear() +{ + origPackageList.clear(); + packageList.clear(); +} |