diff backend/couchdb/Preferences.py @ 156:2d159eb2a91b

displaying the preferences dialog works, saving prefs doesn't yet
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sat, 27 Aug 2011 10:17:07 +0200
parents 8ec20377bcb0
children e8bb107a74e1
line wrap: on
line diff
--- a/backend/couchdb/Preferences.py	Sat Aug 27 08:52:03 2011 +0200
+++ b/backend/couchdb/Preferences.py	Sat Aug 27 10:17:07 2011 +0200
@@ -12,6 +12,13 @@
         except StopIteration:
             return None
 
+    def _booleanValueForKey(self, key):
+        value = self._valueForKey(key)
+        if value is None:
+            return False
+        else:
+            return value
+
     def isProxyConfigured(self):
         return self.proxyHost() is not None
 
@@ -22,10 +29,21 @@
         return self._valueForKey("proxyPort")
 
     def showOnlyUnreadFeeds(self):
-        return self._valueForKey("showOnlyUnreadFeeds")
+        return self._booleanValueForKey("showOnlyUnreadFeeds")
 
     def startMaximized(self):
-        return self._valueForKey("startMaximized")
+        return self._booleanValueForKey("startMaximized")
 
     def hideReadFeedEntries(self):
-        return self._valueForKey("hideReadFeedEntries")
\ No newline at end of file
+        return self._booleanValueForKey("hideReadFeedEntries")
+
+    def daysToKeepFeedEntries(self):
+        days = self._valueForKey("daysToKeepFeedEntries")
+        if days is not None:
+            return days
+        else:
+            return 60
+
+    def rollback(self):
+        # this method does nothing
+        pass