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 | |||
@@ -470,7 +470,7 @@ void NetworkPackageManager :: applyChanges() | |||
470 | // Now for each selected item | 470 | // Now for each selected item |
471 | // deal with it | 471 | // deal with it |
472 | 472 | ||
473 | vector<InstallData> workingPackages; | 473 | vector<InstallData> workingPackages; |
474 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); | 474 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); |
475 | item != 0 ; | 475 | item != 0 ; |
476 | item = (QCheckListItem *)item->nextSibling() ) | 476 | item = (QCheckListItem *)item->nextSibling() ) |
@@ -673,3 +673,35 @@ void NetworkPackageManager :: letterPushed( QString t ) | |||
673 | item = (QCheckListItem *)packagesList->firstChild(); | 673 | item = (QCheckListItem *)packagesList->firstChild(); |
674 | } while ( item != start); | 674 | } while ( item != start); |
675 | } | 675 | } |
676 | |||
677 | |||
678 | void NetworkPackageManager :: searchForPackage() | ||
679 | { | ||
680 | bool ok = FALSE; | ||
681 | QString searchText = InputDialog::getText( "Search for package", "Enter package to search for", QString::null, &ok, this ).lower(); | ||
682 | if ( ok && !searchText.isEmpty() ) | ||
683 | { | ||
684 | cout << "searching for " << searchText << endl; | ||
685 | // look through package list for text startng at current position | ||
686 | vector<InstallData> workingPackages; | ||
687 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); | ||
688 | if ( start != 0 ) | ||
689 | start = (QCheckListItem *)start->nextSibling(); | ||
690 | |||
691 | if ( start == 0 ) | ||
692 | start = (QCheckListItem *)packagesList->firstChild(); | ||
693 | |||
694 | for ( QCheckListItem *item = start; item != 0 ; | ||
695 | item = (QCheckListItem *)item->nextSibling() ) | ||
696 | { | ||
697 | cout << "checking " << item->text().lower() << endl; | ||
698 | if ( item->text().lower().find( searchText ) != -1 ) | ||
699 | { | ||
700 | cout << "matched " << item->text() << endl; | ||
701 | packagesList->ensureItemVisible( item ); | ||
702 | packagesList->setCurrentItem( item ); | ||
703 | break; | ||
704 | } | ||
705 | } | ||
706 | } | ||
707 | } \ No newline at end of file | ||