Helpviewer/History/HistoryTreeModel.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3002
6ffc581f00f1
child 3145
a9de05d4a22f
--- a/Helpviewer/History/HistoryTreeModel.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/Helpviewer/History/HistoryTreeModel.py	Fri Oct 18 23:00:41 2013 +0200
@@ -68,7 +68,8 @@
                     return date.toString("yyyy-MM-dd")
                 if index.column() == 1:
                     return self.trUtf8(
-                        "%n item(s)", "", self.rowCount(index.sibling(index.row(), 0)))
+                        "%n item(s)", "",
+                        self.rowCount(index.sibling(index.row(), 0)))
         
         elif role == Qt.DecorationRole:
             if index.column() == 0 and not index.parent().isValid():
@@ -113,8 +114,8 @@
             totalRows = self.sourceModel().rowCount()
             
             for row in range(totalRows):
-                rowDate = \
-                    self.sourceModel().index(row, 0).data(HistoryModel.DateRole)
+                rowDate = self.sourceModel().index(row, 0)\
+                    .data(HistoryModel.DateRole)
                 if rowDate != currentDate:
                     self.__sourceRowCache.append(row)
                     currentDate = rowDate
@@ -213,7 +214,8 @@
         """
         if not index.isValid():
             return Qt.ItemFlags(Qt.NoItemFlags)
-        return Qt.ItemFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsDragEnabled)
+        return Qt.ItemFlags(
+            Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsDragEnabled)
     
     def setSourceModel(self, sourceModel):
         """
@@ -224,7 +226,8 @@
         if self.sourceModel() is not None:
             self.sourceModel().modelReset.disconnect(self.__sourceReset)
             self.sourceModel().layoutChanged.disconnect(self.__sourceReset)
-            self.sourceModel().rowsInserted.disconnect(self.__sourceRowsInserted)
+            self.sourceModel().rowsInserted.disconnect(
+                self.__sourceRowsInserted)
             self.sourceModel().rowsRemoved.disconnect(self.__sourceRowsRemoved)
         
         super(HistoryTreeModel, self).setSourceModel(sourceModel)
@@ -266,7 +269,8 @@
                 self.beginInsertRows(QModelIndex(), 0, 0)
                 self.endInsertRows()
             else:
-                self.beginInsertRows(treeParent, treeIndex.row(), treeIndex.row())
+                self.beginInsertRows(treeParent, treeIndex.row(),
+                                     treeIndex.row())
                 self.endInsertRows()
     
     def mapFromSource(self, sourceIndex):
@@ -299,7 +303,7 @@
         
         @param row row of the first entry to remove (integer)
         @param count number of entries to remove (integer)
-        @param index of the parent entry (QModelIndex)
+        @param parent index of the parent entry (QModelIndex)
         @return flag indicating successful removal (boolean)
         """
         if row < 0 or \
@@ -321,7 +325,8 @@
             for i in range(row + count - 1, row - 1, -1):
                 dateParent = self.index(i, 0)
                 offset = self.__sourceDateRow(dateParent.row())
-                if not self.sourceModel().removeRows(offset, self.rowCount(dateParent)):
+                if not self.sourceModel().removeRows(
+                        offset, self.rowCount(dateParent)):
                     return False
         return True
     

eric ide

mercurial