Fixed an issue in the syntax and code style checker dialogs causing markers of open files not to be checked being cleared.

Sun, 05 Jan 2014 15:20:02 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 05 Jan 2014 15:20:02 +0100
changeset 3175
1a6638ccce9d
parent 3171
2c37b9a37b2d
child 3176
51feb6174cc2

Fixed an issue in the syntax and code style checker dialogs causing markers of open files not to be checked being cleared.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html	Sat Jan 04 18:39:24 2014 +0100
+++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html	Sun Jan 05 15:20:02 2014 +0100
@@ -64,7 +64,7 @@
 <td>Constructor</td>
 </tr><tr>
 <td><a href="#CodeStyleCheckerDialog.__clearErrors">__clearErrors</a></td>
-<td>Private method to clear all warning markers of open editors.</td>
+<td>Private method to clear all warning markers of open editors to be checked.</td>
 </tr><tr>
 <td><a href="#CodeStyleCheckerDialog.__createResultItem">__createResultItem</a></td>
 <td>Private method to create an entry in the result list.</td>
@@ -161,10 +161,16 @@
 </dd>
 </dl><a NAME="CodeStyleCheckerDialog.__clearErrors" ID="CodeStyleCheckerDialog.__clearErrors"></a>
 <h4>CodeStyleCheckerDialog.__clearErrors</h4>
-<b>__clearErrors</b>(<i></i>)
+<b>__clearErrors</b>(<i>files</i>)
 <p>
-        Private method to clear all warning markers of open editors.
-</p><a NAME="CodeStyleCheckerDialog.__createResultItem" ID="CodeStyleCheckerDialog.__createResultItem"></a>
+        Private method to clear all warning markers of open editors to be
+        checked.
+</p><dl>
+<dt><i>files</i></dt>
+<dd>
+list of files to be checked (list of string)
+</dd>
+</dl><a NAME="CodeStyleCheckerDialog.__createResultItem" ID="CodeStyleCheckerDialog.__createResultItem"></a>
 <h4>CodeStyleCheckerDialog.__createResultItem</h4>
 <b>__createResultItem</b>(<i>file, line, pos, message, fixed, autofixing</i>)
 <p>
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html	Sat Jan 04 18:39:24 2014 +0100
+++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html	Sun Jan 05 15:20:02 2014 +0100
@@ -61,7 +61,7 @@
 <td>Constructor</td>
 </tr><tr>
 <td><a href="#SyntaxCheckerDialog.__clearErrors">__clearErrors</a></td>
-<td>Private method to clear all error markers of open editors.</td>
+<td>Private method to clear all error and warning markers of open editors to be checked.</td>
 </tr><tr>
 <td><a href="#SyntaxCheckerDialog.__createResultItem">__createResultItem</a></td>
 <td>Private method to create an entry in the result list.</td>
@@ -107,10 +107,16 @@
 </dd>
 </dl><a NAME="SyntaxCheckerDialog.__clearErrors" ID="SyntaxCheckerDialog.__clearErrors"></a>
 <h4>SyntaxCheckerDialog.__clearErrors</h4>
-<b>__clearErrors</b>(<i></i>)
+<b>__clearErrors</b>(<i>files</i>)
 <p>
-        Private method to clear all error markers of open editors.
-</p><a NAME="SyntaxCheckerDialog.__createResultItem" ID="SyntaxCheckerDialog.__createResultItem"></a>
+        Private method to clear all error and warning markers of
+        open editors to be checked.
+</p><dl>
+<dt><i>files</i></dt>
+<dd>
+list of files to be checked (list of string)
+</dd>
+</dl><a NAME="SyntaxCheckerDialog.__createResultItem" ID="SyntaxCheckerDialog.__createResultItem"></a>
 <h4>SyntaxCheckerDialog.__createResultItem</h4>
 <b>__createResultItem</b>(<i>file, line, index, error, sourcecode, isWarning=False</i>)
 <p>
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sat Jan 04 18:39:24 2014 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sun Jan 05 15:20:02 2014 +0100
@@ -320,9 +320,6 @@
         self.checkProgress.setVisible(True)
         QApplication.processEvents()
         
-        self.__resetStatistics()
-        self.__clearErrors()
-        
         if save:
             self.__fileOrFileList = fn
         
@@ -349,6 +346,9 @@
                     [f for f in files
                      if not fnmatch.fnmatch(f, filter.strip())]
         
+        self.__resetStatistics()
+        self.__clearErrors(files)
+        
         py3files = [f for f in files
                     if f.endswith(
                         tuple(Preferences.getPython("Python3Extensions")))]
@@ -546,7 +546,6 @@
             QApplication.processEvents()
             self.statisticsButton.setEnabled(False)
             self.showButton.setEnabled(False)
-            self.__clearErrors()
         else:
             self.statisticsButton.setEnabled(True)
             self.showButton.setEnabled(True)
@@ -801,13 +800,16 @@
         elif button == self.statisticsButton:
             self.on_statisticsButton_clicked()
     
-    def __clearErrors(self):
+    def __clearErrors(self, files):
         """
-        Private method to clear all warning markers of open editors.
+        Private method to clear all warning markers of open editors to be
+        checked.
+        
+        @param files list of files to be checked (list of string)
         """
         vm = e5App().getObject("ViewManager")
         openFiles = vm.getOpenFilenames()
-        for file in openFiles:
+        for file in [f for f in openFiles if f in files]:
             editor = vm.getOpenEditor(file)
             editor.clearStyleWarnings()
     
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Sat Jan 04 18:39:24 2014 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Sun Jan 05 15:20:02 2014 +0100
@@ -145,8 +145,6 @@
         self.checkProgress.setVisible(True)
         QApplication.processEvents()
         
-        self.__clearErrors()
-        
         if isinstance(fn, list):
             files = fn
         elif os.path.isdir(fn):
@@ -159,6 +157,9 @@
                     Utilities.direntries(fn, 1, '*{0}'.format(ext), 0))
         else:
             files = [fn]
+        
+        self.__clearErrors(files)
+        
         py3files = [f for f in files
                     if f.endswith(
                         tuple(Preferences.getPython("Python3Extensions")))]
@@ -292,7 +293,6 @@
             QTreeWidgetItem(self.resultList, [self.trUtf8('No issues found.')])
             QApplication.processEvents()
             self.showButton.setEnabled(False)
-            self.__clearErrors()
         else:
             self.showButton.setEnabled(True)
         self.resultList.header().resizeSections(QHeaderView.ResizeToContents)
@@ -424,13 +424,16 @@
                 editor.clearSyntaxError()
                 editor.clearFlakesWarnings()
         
-    def __clearErrors(self):
+    def __clearErrors(self, files):
         """
-        Private method to clear all error markers of open editors.
+        Private method to clear all error and warning markers of
+        open editors to be checked.
+        
+        @param files list of files to be checked (list of string)
         """
         vm = e5App().getObject("ViewManager")
         openFiles = vm.getOpenFilenames()
-        for file in openFiles:
+        for file in [f for f in openFiles if f in files]:
             editor = vm.getOpenEditor(file)
             editor.clearSyntaxError()
             editor.clearFlakesWarnings()

eric ide

mercurial