summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/networkpkgmgr.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp32
1 files changed, 32 insertions, 0 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
@@ -670,6 +670,38 @@ void NetworkPackageManager :: letterPushed( QString t )
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
678void 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