--- a/WebBrowser/OpenSearch/OpenSearchEngineModel.py Thu Mar 23 18:58:56 2017 +0100 +++ b/WebBrowser/OpenSearch/OpenSearchEngineModel.py Thu Mar 23 19:06:13 2017 +0100 @@ -37,7 +37,7 @@ self.tr("Keywords"), ] - def removeRows(self, row, count, parent=QModelIndex()): + def removeRows(self, row, count, parent=None): """ Public method to remove entries from the model. @@ -46,6 +46,9 @@ @param parent parent index (QModelIndex) @return flag indicating success (boolean) """ + if parent is None: + parent = QModelIndex() + if parent.isValid(): return False @@ -68,23 +71,26 @@ return True - 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.enginesCount() - 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) + @param parent parent index (QModelIndex) (Unused) @return number of columns (integer) """ return 2