diff MainWindow.py @ 126:089ee60b28fb backend

mark feed entries as read in the backend
author Dirk Olmes <dirk@xanthippe.ping.de>
date Mon, 22 Aug 2011 14:04:42 +0200
parents 514e5d7dca98
children 8ec20377bcb0
line wrap: on
line diff
--- a/MainWindow.py	Mon Aug 22 11:22:45 2011 +0200
+++ b/MainWindow.py	Mon Aug 22 14:04:42 2011 +0200
@@ -125,6 +125,7 @@
         self.ui.feedEntryList.doItemsLayout()
 
     def markSelectedEntriesRead(self):
+        entriesToBeMarked = []
         selectedIndexes = self.ui.feedEntryList.selectedIndexes()
         for index in selectedIndexes:
             # selectedIndexes returns one QModelIndex instance per row/column combo.
@@ -132,11 +133,9 @@
             # column
             if index.column() == 0:
                 row = index.row()
-                # use selectedEntry here to ensure it has a valid state after all
-                # selected entries are marked read
-                self.selectedEntry = self.feedEntries[row]
-                self.selectedEntry.markRead()
-        self.session.commit()
+                entriesToBeMarked.append(self.feedEntries[row])
+        self.backend.markFeedEntriesAsRead(entriesToBeMarked)
+        self.selectedEntry = None
         self.ui.feedEntryList.doItemsLayout()
 
     def addFeed(self):