eric6/Debugger/BreakPointModel.py

branch
jsonfiles
changeset 8009
29818ac4853c
parent 7923
91e843545d9a
child 8077
1fd8f611f26a
diff -r c4110b8b5931 -r 29818ac4853c eric6/Debugger/BreakPointModel.py
--- a/eric6/Debugger/BreakPointModel.py	Mon Jan 25 20:07:51 2021 +0100
+++ b/eric6/Debugger/BreakPointModel.py	Wed Jan 27 15:09:20 2021 +0100
@@ -7,6 +7,8 @@
 Module implementing the Breakpoint model.
 """
 
+import copy
+
 from PyQt5.QtCore import pyqtSignal, Qt, QAbstractItemModel, QModelIndex
 
 
@@ -227,6 +229,19 @@
         self.breakpoints.append(bp)
         self.endInsertRows()
     
+    def addBreakPoints(self, breakpoints):
+        """
+        Public method to add multiple breakpoints to the list.
+        
+        @param breakpoints list of breakpoints with file name, line number,
+            condition, temporary flag, enabled flag and ignore count each
+        @type list of (str, int, str, bool, bool, int)
+        """
+        cnt = len(self.breakpoints)
+        self.beginInsertRows(QModelIndex(), cnt, cnt + len(breakpoints) - 1)
+        self.breakpoints += breakpoints
+        self.endInsertRows()
+    
     def setBreakPointByIndex(self, index, fn, line, properties):
         """
         Public method to set the values of a breakpoint given by index.
@@ -321,7 +336,16 @@
             return self.breakpoints[index.row()][:]  # return a copy
         else:
             return []
-
+    
+    def getAllBreakpoints(self):
+        """
+        Public method to get a copy of the breakpoints.
+        
+        @return list of breakpoints
+        @rtype list of list of [str, int, str, bool, bool, int]
+        """
+        return copy.deepcopy(self.breakpoints)
+    
     def getBreakPointIndex(self, fn, lineno):
         """
         Public method to get the index of a breakpoint given by filename and

eric ide

mercurial