summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/networkpkgmgr.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp34
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
@@ -467,13 +467,13 @@ void NetworkPackageManager :: applyChanges()
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 {
@@ -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