Ignore:
Timestamp:
Aug 19, 2013 10:27:46 AM (8 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1
Children:
603823a
Parents:
2e7bf77
Message:

Finish up the pc-pkgmanager search algorithm, now it will also search the top level items, and expand them properly as necessary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-pkgmanager/mainWin.cpp

    rf3f036a ra96d2c0  
    140140  bool found=false; 
    141141  bool started = false; 
    142  
     142  //if(SI==0){ started = true; } 
    143143  for(int p=0; (p<TW->topLevelItemCount()) && !found; p++){ 
    144     found = searchChildren(pkgSearch, TW, TW->topLevelItem(p), started, SI); 
     144    //Check the actual item itself 
     145    QTreeWidgetItem *CI = TW->topLevelItem(p); 
     146    if(started && CI->text(0).contains(pkgSearch, Qt::CaseInsensitive)){ 
     147      TW->setCurrentItem(CI); 
     148      TW->scrollToItem(CI); 
     149      found=true;          
     150    }else{     
     151      found = searchChildren(pkgSearch, TW, CI, started, SI); 
     152    } 
    145153  } 
    146154  return found; 
     
    157165  //Check for the start position 
    158166  int start = -1; 
    159   if(SI == 0){ 
     167  if(SI == 0 || SI == CI){ 
    160168    //No search item to start at 
    161169    start = 0; 
     
    182190        break; 
    183191      } 
    184     }else if( SI == CI->child(i) || SI == CI ){ 
     192    }else if( SI == CI->child(i) ){ 
    185193      started = true; //but don't look at this item, continue on to the next one (or children) 
    186194    } 
Note: See TracChangeset for help on using the changeset viewer.