Helpviewer/Download/DownloadModel.py

changeset 5656
9c21b2746218
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
--- a/Helpviewer/Download/DownloadModel.py	Thu Mar 23 18:58:56 2017 +0100
+++ b/Helpviewer/Download/DownloadModel.py	Thu Mar 23 19:06:13 2017 +0100
@@ -45,19 +45,22 @@
         
         return None
     
-    def rowCount(self, parent=QModelIndex()):
+    def rowCount(self, parent=None):
         """
         Public method to get the number of rows of the model.
         
         @param parent parent index (QModelIndex)
         @return number of rows (integer)
         """
+        if parent is None:
+            parent = QModelIndex()
+        
         if parent.isValid():
             return 0
         else:
             return self.__manager.count()
     
-    def removeRows(self, row, count, parent=QModelIndex()):
+    def removeRows(self, row, count, parent=None):
         """
         Public method to remove bookmarks from the model.
         
@@ -66,6 +69,9 @@
         @param parent index of the parent bookmark node (QModelIndex)
         @return flag indicating successful removal (boolean)
         """
+        if parent is None:
+            parent = QModelIndex()
+        
         if parent.isValid():
             return False
         

eric ide

mercurial