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() | |||
465 | stickyOption = ""; | 465 | stickyOption = ""; |
466 | 466 | ||
467 | // First, write out ipkg_conf file so that ipkg can use it | 467 | // First, write out ipkg_conf file so that ipkg can use it |
468 | dataMgr->writeOutIpkgConf(); | 468 | dataMgr->writeOutIpkgConf(); |
469 | 469 | ||
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() ) |
477 | { | 477 | { |
478 | if ( item->isOn() ) | 478 | if ( item->isOn() ) |
479 | { | 479 | { |
480 | InstallData data = dealWithItem( item ); | 480 | InstallData data = dealWithItem( item ); |
481 | workingPackages.push_back( data ); | 481 | workingPackages.push_back( data ); |
@@ -668,8 +668,40 @@ void NetworkPackageManager :: letterPushed( QString t ) | |||
668 | break; | 668 | break; |
669 | } | 669 | } |
670 | 670 | ||
671 | item = (QCheckListItem *)item->nextSibling(); | 671 | item = (QCheckListItem *)item->nextSibling(); |
672 | if ( !item ) | 672 | if ( !item ) |
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 | ||