eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py

branch
eric7
changeset 8934
d3798915e0d2
parent 8881
54e42bc2437a
child 8943
23f9c7b9e18e
--- a/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Thu Jan 27 17:54:11 2022 +0100
+++ b/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sat Jan 29 17:43:20 2022 +0100
@@ -7,11 +7,12 @@
 Module implementing a dialog to show the results of the code style check.
 """
 
-import os
-import fnmatch
+import collections
 import copy
-import collections
+import fnmatch
 import json
+import os
+import time
 
 from PyQt6.QtCore import pyqtSlot, Qt, QTimer, QCoreApplication
 from PyQt6.QtGui import QIcon
@@ -194,6 +195,7 @@
         self.__batch = False
         self.__finished = True
         self.__errorItem = None
+        self.__timenow = time.monotonic()
         
         self.__fileOrFileList = ""
         self.__forProject = False
@@ -860,6 +862,8 @@
             # now go through all the files
             self.progress = 0
             self.files.sort()
+            self.__timenow = time.monotonic()
+            
             if len(self.files) == 1:
                 self.__batch = False
                 self.mainWidget.setCurrentWidget(self.resultsTab)
@@ -1003,7 +1007,9 @@
         # reset the progress bar to the checked files
         self.checkProgress.setValue(self.progress)
         self.checkProgressLabel.setPath(self.tr("Transferring data..."))
-        QApplication.processEvents()
+        if time.monotonic() - self.__timenow > 0.01:
+            QApplication.processEvents()
+            self.__timenow = time.monotonic()
         
         self.__finished = False
         self.styleCheckService.styleBatchCheck(argumentsList)
@@ -1124,7 +1130,9 @@
             row = self.progressList.row(fileItems[0])
             self.progressList.takeItem(row)
         
-        QApplication.processEvents()
+        if time.monotonic() - self.__timenow > 0.01:
+            QApplication.processEvents()
+            self.__timenow = time.monotonic()
     
     def __finish(self):
         """

eric ide

mercurial