Wed, 26 Jan 2022 22:17:41 +0100
Don't process events after each file to prevent a slow search.
eric7/UI/FindFileWidget.py | file | annotate | diff | comparison | revisions |
--- a/eric7/UI/FindFileWidget.py Sat Jan 22 17:03:25 2022 +0100 +++ b/eric7/UI/FindFileWidget.py Wed Jan 26 22:17:41 2022 +0100 @@ -9,6 +9,7 @@ import os import re +import time from PyQt6.QtCore import pyqtSignal, pyqtSlot, Qt, QPoint, QUrl from PyQt6.QtGui import QCursor, QDesktopServices, QImageReader @@ -615,6 +616,7 @@ self.findProgress.setValue(progress) continue + now = time.monotonic() # now perform the search and display the lines found for count, line in enumerate(lines, start=1): if self.__cancelSearch: @@ -641,7 +643,9 @@ self.__createItem(file, count, line, start, end, rline, hashStr) - QApplication.processEvents() + if time.monotonic() - now > 0.01: + QApplication.processEvents() + now = time.monotonic() if found: fileOccurrences += 1