diff AddFeed.py @ 123:862760b161b4 backend

restructured adding a feed so that only the URL is passed into the backend - the rest of the operation is backend-internal
author Dirk Olmes <dirk@xanthippe.ping.de>
date Mon, 22 Aug 2011 10:30:33 +0200
parents 510a5d00e98a
children bb3c851b18b1
line wrap: on
line diff
--- a/AddFeed.py	Sun Aug 21 18:39:02 2011 +0200
+++ b/AddFeed.py	Mon Aug 22 10:30:33 2011 +0200
@@ -14,20 +14,13 @@
 
     def accept(self):
         try:
-            self.createFeed()
-            self.session.commit() # TODO this should be the responsibility of the FeedUpdater
+            url = self.getUrl()
+            self.backend.createFeed(url)
         except AttributeError as ae:
             logging.getLogger("AddFeed").info(ae)
-
-            self.exception = ae
-            self.session.rollback() # TODO this should be the responsibility of the FeedUpdater
+            self.exception = ae       
         QtGui.QDialog.accept(self)
 
-    def createFeed(self):
-        url = self.getUrl()
-        # TODO get status and display in status area of the main window
-        self.backend.feedUpdater().createNewFeed(url)
-
     def getUrl(self):
         text = self.ui.url.text()
         # the content of a QLineEdit is a QString, convert it to a Python string