# HG changeset patch # User Dirk Olmes # Date 1313944742 -7200 # Node ID f5afe0c1f4d2e2f4a7e7b27a49530fb3bd24358e # Parent 510a5d00e98a2fec5f0c2efa300d059bd42053be move more operations to the backend diff -r 510a5d00e98a -r f5afe0c1f4d2 MainWindow.py --- a/MainWindow.py Sun Aug 21 04:17:13 2011 +0200 +++ b/MainWindow.py Sun Aug 21 18:39:02 2011 +0200 @@ -117,13 +117,11 @@ subprocess.Popen([browser, self.selectedEntry.link]) def toggleReadOnSelectedEntry(self): - self.selectedEntry.toggleRead() - self.session.commit() + self.backend.toggleRead(self.selectedEntry) self.ui.feedEntryList.doItemsLayout() def markSelectedFeedRead(self): - self.selectedFeed.markAllEntriesRead() - self.session.commit() + self.backend.markAllEntriesRead(self.selectedFeed) self.ui.feedEntryList.doItemsLayout() def markSelectedEntriesRead(self): diff -r 510a5d00e98a -r f5afe0c1f4d2 backend/sqlalchemy/SqlAlchemyBackend.py --- a/backend/sqlalchemy/SqlAlchemyBackend.py Sun Aug 21 04:17:13 2011 +0200 +++ b/backend/sqlalchemy/SqlAlchemyBackend.py Sun Aug 21 18:39:02 2011 +0200 @@ -36,6 +36,14 @@ def getFeeds(self): return FeedList.getFeeds(self.session) + def toggleRead(self, feedEntry): + feedEntry.toggleRead() + self.session.commit() + + def markAllEntriesRead(self, feed): + feed.markAllEntriesRead() + self.session.commit() + def dispose(self): # save all uncommitted state, just in case self.session.commit()