summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/networkpkgmgr.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index 78d3df5..a058285 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -672,19 +672,23 @@ void NetworkPackageManager :: letterPushed( QString t )
if ( !item )
item = (QCheckListItem *)packagesList->firstChild();
} while ( item != start);
}
-void NetworkPackageManager :: searchForPackage()
+void NetworkPackageManager :: searchForPackage( bool findNext )
{
- bool ok = FALSE;
- QString searchText = InputDialog::getText( "Search for package", "Enter package to search for", QString::null, &ok, this ).lower();
- if ( ok && !searchText.isEmpty() )
+ bool ok = false;
+ if ( !findNext || lastSearchText.isEmpty() )
+ lastSearchText = InputDialog::getText( "Search for package", "Enter package to search for", lastSearchText, &ok, this ).lower();
+ else
+ ok = true;
+
+ if ( ok && !lastSearchText.isEmpty() )
{
- cout << "searching for " << searchText << endl;
+ cout << "searching for " << lastSearchText << 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();
@@ -692,13 +696,13 @@ void NetworkPackageManager :: searchForPackage()
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 )
+ if ( item->text().lower().find( lastSearchText ) != -1 )
{
cout << "matched " << item->text() << endl;
packagesList->ensureItemVisible( item );
packagesList->setCurrentItem( item );
break;
}