WebBrowser/CookieJar/CookieExceptionsModel.py

changeset 5656
9c21b2746218
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
diff -r d75dfc0d10f2 -r 9c21b2746218 WebBrowser/CookieJar/CookieExceptionsModel.py
--- a/WebBrowser/CookieJar/CookieExceptionsModel.py	Thu Mar 23 18:58:56 2017 +0100
+++ b/WebBrowser/CookieJar/CookieExceptionsModel.py	Thu Mar 23 19:06:13 2017 +0100
@@ -103,25 +103,31 @@
         
         return None
     
-    def columnCount(self, parent=QModelIndex()):
+    def columnCount(self, parent=None):
         """
         Public method to get the number of columns of the model.
         
         @param parent parent index (QModelIndex)
         @return number of columns (integer)
         """
+        if parent is None:
+            parent = QModelIndex()
+        
         if parent.isValid():
             return 0
         else:
             return len(self.__headers)
     
-    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() or self.__cookieJar is None:
             return 0
         else:
@@ -129,7 +135,7 @@
                 len(self.__blockedCookies) + \
                 len(self.__sessionCookies)
     
-    def removeRows(self, row, count, parent=QModelIndex()):
+    def removeRows(self, row, count, parent=None):
         """
         Public method to remove entries from the model.
         
@@ -138,6 +144,9 @@
         @param parent parent index (QModelIndex)
         @return flag indicating success (boolean)
         """
+        if parent is None:
+            parent = QModelIndex()
+        
         if parent.isValid() or self.__cookieJar is None:
             return False
         

eric ide

mercurial