416 # now go through all the files |
416 # now go through all the files |
417 self.__populating = True |
417 self.__populating = True |
418 self.findList.setUpdatesEnabled(False) |
418 self.findList.setUpdatesEnabled(False) |
419 progress = 0 |
419 progress = 0 |
420 breakSearch = False |
420 breakSearch = False |
|
421 occurrences = 0 |
|
422 fileOccurrences = 0 |
421 for file in files: |
423 for file in files: |
422 self.__lastFileItem = None |
424 self.__lastFileItem = None |
|
425 found = False |
423 if self.__cancelSearch or breakSearch: |
426 if self.__cancelSearch or breakSearch: |
424 break |
427 break |
425 |
428 |
426 self.findProgressLabel.setPath(file) |
429 self.findProgressLabel.setPath(file) |
427 |
430 |
471 breakSearch = True |
476 breakSearch = True |
472 break |
477 break |
473 |
478 |
474 QApplication.processEvents() |
479 QApplication.processEvents() |
475 |
480 |
|
481 if found: |
|
482 fileOccurrences += 1 |
476 progress += 1 |
483 progress += 1 |
477 self.findProgress.setValue(progress) |
484 self.findProgress.setValue(progress) |
478 |
485 |
479 if not files: |
486 if not files: |
480 self.findProgress.setMaximum(1) |
487 self.findProgress.setMaximum(1) |
481 self.findProgress.setValue(1) |
488 self.findProgress.setValue(1) |
482 |
489 |
483 self.findProgressLabel.setPath("") |
490 resultFormat = self.tr("{0} / {1}", "occurrences / files") |
|
491 self.findProgressLabel.setPath(resultFormat.format( |
|
492 self.tr("%n occurrence(s)", "", occurrences), |
|
493 self.tr("%n file(s)", "", fileOccurrences))) |
484 |
494 |
485 self.findList.setUpdatesEnabled(True) |
495 self.findList.setUpdatesEnabled(True) |
486 self.findList.sortItems(self.findList.sortColumn(), |
496 self.findList.sortItems(self.findList.sortColumn(), |
487 self.findList.header().sortIndicatorOrder()) |
497 self.findList.header().sortIndicatorOrder()) |
488 self.findList.resizeColumnToContents(1) |
498 self.findList.resizeColumnToContents(1) |