def __onProjectChanged( self, what ): " Triggered when a project is changed " if what != CodimensionProject.CompleteProject: return self.clear() model = self.bpointsList.model().sourceModel() project = GlobalData().project if project.isLoaded(): bpoints = project.breakpoints else: bpoints = Settings().breakpoints for bp in bpoints: newBpoint = Breakpoint() try: if not newBpoint.deserialize( bp ): # Non valid continue except: continue # Need to check if it still points to a breakable line line = newBpoint.getLineNumber() fileName = newBpoint.getAbsoluteFileName() breakableLines = getBreakpointLines( fileName, None, True ) if breakableLines is not None and line in breakableLines: model.addBreakpoint( newBpoint ) else: logging.warning( "Breakpoint at " + fileName + ":" + str( line ) + " does not point to a breakable " "line anymore (the file is invalid or was " "modified outside of the " "IDE etc.). The breakpoint is deleted." ) return
def getBreakpoint(self, id): if id == ~0: bp = Breakpoint(self) bp.setUserType() return bp else: return self.__breakpointTable.get(id)
def __onProjectChanged(self, what): " Triggered when a project is changed " if what != CodimensionProject.CompleteProject: return self.clear() model = self.bpointsList.model().sourceModel() project = GlobalData().project if project.isLoaded(): bpoints = project.breakpoints else: bpoints = Settings().breakpoints for bp in bpoints: newBpoint = Breakpoint() try: if not newBpoint.deserialize(bp): # Non valid continue except: continue # Need to check if it still points to a breakable line line = newBpoint.getLineNumber() fileName = newBpoint.getAbsoluteFileName() breakableLines = getBreakpointLines(fileName, None, True) if breakableLines is not None and line in breakableLines: model.addBreakpoint(newBpoint) else: logging.warning("Breakpoint at " + fileName + ":" + str(line) + " does not point to a breakable " "line anymore (the file is invalid or was " "modified outside of the " "IDE etc.). The breakpoint is deleted.") return
def addBreakpointAtFunction(self, function): bp = Breakpoint(self) bp.setFunction(function) bp.enable() self.__breakpoints.append(bp) self.__breakpointTable[bp.getId()] = bp return bp.getId()
def addBreakpointAtPosition(self, position): bp = Breakpoint(self) bp.setPosition(position) bp.enable() self.__breakpoints.append(bp) self.__breakpointTable[bp.getId()] = bp return bp.getId()
def getData( self ): " Provides a new instance of a breakpoint " newBPoint = Breakpoint( self.__origBpoint.getAbsoluteFileName(), self.__origBpoint.getLineNumber(), self.__conditionValue.lineEdit().text().strip(), self.__tempCheckbox.isChecked(), self.__enabled.isChecked(), self.__ignoreValue.value() ) return newBPoint