~jibel/synaptic/bugs.309906.385739.403165

« back to all changes in this revision

Viewing changes to common/rpackageview.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-06-15 17:17:28 UTC
  • Revision ID: james.westby@ubuntu.com-20090615171728-r3eumzd8xuj10zzr
Tags: 0.62.6ubuntu2
show progress when searching and not not block the UI
(LP: #24188)

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
   //_view[searchString].push_back(NULL);
242
242
}
243
243
 
244
 
int RPackageViewSearch::setSearch(string aSearchName, int type, 
245
 
                                  string searchString)
 
244
int RPackageViewSearch::setSearch(string aSearchName, 
 
245
                                  int type, 
 
246
                                  string searchString, 
 
247
                                  OpProgress &searchProgress)
246
248
{
247
249
   found = 0;
248
250
   searchType = type;
259
261
      searchStrings.push_back(s);
260
262
   }
261
263
 
262
 
   // reapply search when a new search strng is giben
 
264
   // setup search progress (0 done, _all.size() in total, 1 subtask)
 
265
   searchProgress.OverallProgress(0, _all.size(), 1, _("Searching"));
 
266
   // reapply search when a new search strng is given
263
267
   for(unsigned int i=0;i<_all.size();i++) 
264
 
      if(_all[i]) 
265
 
         addPackage(_all[i]);
266
 
 
 
268
     if(_all[i]) {
 
269
       searchProgress.Progress(i);
 
270
       addPackage(_all[i]);
 
271
     }
 
272
   searchProgress.Done();
267
273
   return found;
268
274
}
269
275
//------------------------------------------------------------------