QScintilla/Editor.py

branch
5_5_x
changeset 3973
f77cdeea80e3
parent 3866
e3c747b01f60
equal deleted inserted replaced
3969:1abc44583ef2 3973:f77cdeea80e3
313 313
314 # set the text display 314 # set the text display
315 self.__setTextDisplay() 315 self.__setTextDisplay()
316 316
317 # initialize the online syntax check timer 317 # initialize the online syntax check timer
318 self.syntaxCheckService = e5App().getObject('SyntaxCheckService') 318 try:
319 self.syntaxCheckService.syntaxChecked.connect(self.__processResult) 319 self.syntaxCheckService = e5App().getObject('SyntaxCheckService')
320 self.__initOnlineSyntaxCheck() 320 self.syntaxCheckService.syntaxChecked.connect(self.__processResult)
321 self.__initOnlineSyntaxCheck()
322 except KeyError:
323 self.syntaxCheckService = None
321 324
322 self.isResourcesFile = False 325 self.isResourcesFile = False
323 if editor is None: 326 if editor is None:
324 if self.fileName is not None: 327 if self.fileName is not None:
325 if (QFileInfo(self.fileName).size() // 1024) > \ 328 if (QFileInfo(self.fileName).size() // 1024) > \
5070 5073
5071 def checkSyntax(self): 5074 def checkSyntax(self):
5072 """ 5075 """
5073 Public method to perform an automatic syntax check of the file. 5076 Public method to perform an automatic syntax check of the file.
5074 """ 5077 """
5075 if self.filetype not in self.syntaxCheckService.getLanguages(): 5078 if self.syntaxCheckService is None or \
5079 self.filetype not in self.syntaxCheckService.getLanguages():
5076 return 5080 return
5077 5081
5078 if Preferences.getEditor("AutoCheckSyntax"): 5082 if Preferences.getEditor("AutoCheckSyntax"):
5079 if Preferences.getEditor("OnlineSyntaxCheck"): 5083 if Preferences.getEditor("OnlineSyntaxCheck"):
5080 self.__onlineSyntaxCheckTimer.stop() 5084 self.__onlineSyntaxCheckTimer.stop()
6041 self.breakpointModel.dataChanged.disconnect( 6045 self.breakpointModel.dataChanged.disconnect(
6042 self.__changeBreakPoints) 6046 self.__changeBreakPoints)
6043 self.breakpointModel.rowsInserted.disconnect( 6047 self.breakpointModel.rowsInserted.disconnect(
6044 self.__addBreakPoints) 6048 self.__addBreakPoints)
6045 6049
6046 self.syntaxCheckService.syntaxChecked.disconnect(self.__processResult) 6050 if self.syntaxCheckService is not None:
6051 self.syntaxCheckService.syntaxChecked.disconnect(
6052 self.__processResult)
6047 6053
6048 if self.spell: 6054 if self.spell:
6049 self.spell.stopIncrementalCheck() 6055 self.spell.stopIncrementalCheck()
6050 6056
6051 try: 6057 try:

eric ide

mercurial