Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py

changeset 53
c3eb7cc1ff8b
parent 40
c2e5472b112c
child 55
b5c84934de9c
equal deleted inserted replaced
52:ba69827929ee 53:c3eb7cc1ff8b
12 import types 12 import types
13 13
14 from PyQt4.QtCore import * 14 from PyQt4.QtCore import *
15 from PyQt4.QtGui import * 15 from PyQt4.QtGui import *
16 16
17 from E4Gui.E4Application import e4App 17 from E4Gui.E4Application import e5App
18 18
19 from .Ui_SyntaxCheckerDialog import Ui_SyntaxCheckerDialog 19 from .Ui_SyntaxCheckerDialog import Ui_SyntaxCheckerDialog
20 20
21 import Utilities 21 import Utilities
22 import Preferences 22 import Preferences
154 154
155 fn = Utilities.normabspath(itm.text(0)) 155 fn = Utilities.normabspath(itm.text(0))
156 lineno = int(itm.text(1)) 156 lineno = int(itm.text(1))
157 error = itm.text(2) 157 error = itm.text(2)
158 158
159 vm = e4App().getObject("ViewManager") 159 vm = e5App().getObject("ViewManager")
160 vm.openSourceFile(fn, lineno) 160 vm.openSourceFile(fn, lineno)
161 editor = vm.getOpenEditor(fn) 161 editor = vm.getOpenEditor(fn)
162 editor.toggleSyntaxError(lineno, True, error) 162 editor.toggleSyntaxError(lineno, True, error)
163 163
164 @pyqtSlot() 164 @pyqtSlot()
170 itm = self.resultList.topLevelItem(index) 170 itm = self.resultList.topLevelItem(index)
171 self.on_resultList_itemActivated(itm, 0) 171 self.on_resultList_itemActivated(itm, 0)
172 172
173 # go through the list again to clear syntax error markers 173 # go through the list again to clear syntax error markers
174 # for files, that are ok 174 # for files, that are ok
175 vm = e4App().getObject("ViewManager") 175 vm = e5App().getObject("ViewManager")
176 openFiles = vm.getOpenFilenames() 176 openFiles = vm.getOpenFilenames()
177 errorFiles = [] 177 errorFiles = []
178 for index in range(self.resultList.topLevelItemCount()): 178 for index in range(self.resultList.topLevelItemCount()):
179 itm = self.resultList.topLevelItem(index) 179 itm = self.resultList.topLevelItem(index)
180 errorFiles.append(Utilities.normabspath(itm.text(0))) 180 errorFiles.append(Utilities.normabspath(itm.text(0)))
185 185
186 def __clearErrors(self): 186 def __clearErrors(self):
187 """ 187 """
188 Private method to clear all error markers of open editors. 188 Private method to clear all error markers of open editors.
189 """ 189 """
190 vm = e4App().getObject("ViewManager") 190 vm = e5App().getObject("ViewManager")
191 openFiles = vm.getOpenFilenames() 191 openFiles = vm.getOpenFilenames()
192 for file in openFiles: 192 for file in openFiles:
193 editor = vm.getOpenEditor(file) 193 editor = vm.getOpenEditor(file)
194 editor.clearSyntaxError() 194 editor.clearSyntaxError()

eric ide

mercurial