Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index ccce401..78d3df5 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -465,17 +465,17 @@ void NetworkPackageManager :: applyChanges() stickyOption = ""; // First, write out ipkg_conf file so that ipkg can use it dataMgr->writeOutIpkgConf(); // Now for each selected item // deal with it - vector<InstallData> workingPackages; + vector<InstallData> workingPackages; for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); item != 0 ; item = (QCheckListItem *)item->nextSibling() ) { if ( item->isOn() ) { InstallData data = dealWithItem( item ); workingPackages.push_back( data ); @@ -668,8 +668,40 @@ void NetworkPackageManager :: letterPushed( QString t ) break; } item = (QCheckListItem *)item->nextSibling(); if ( !item ) item = (QCheckListItem *)packagesList->firstChild(); } while ( item != start); } + + +void NetworkPackageManager :: searchForPackage() +{ + bool ok = FALSE; + QString searchText = InputDialog::getText( "Search for package", "Enter package to search for", QString::null, &ok, this ).lower(); + if ( ok && !searchText.isEmpty() ) + { + cout << "searching for " << searchText << endl; + // look through package list for text startng at current position + vector<InstallData> workingPackages; + QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); + if ( start != 0 ) + start = (QCheckListItem *)start->nextSibling(); + + if ( start == 0 ) + start = (QCheckListItem *)packagesList->firstChild(); + + for ( QCheckListItem *item = start; item != 0 ; + item = (QCheckListItem *)item->nextSibling() ) + { + cout << "checking " << item->text().lower() << endl; + if ( item->text().lower().find( searchText ) != -1 ) + { + cout << "matched " << item->text() << endl; + packagesList->ensureItemVisible( item ); + packagesList->setCurrentItem( item ); + break; + } + } + } +}
\ No newline at end of file |