X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=psa_harmattan%2Ffeedingit%2Fdeb_dist%2Ffeedingit-0.1.0%2Fpysrc%2Ffeedingit.py;fp=psa_harmattan%2Ffeedingit%2Fdeb_dist%2Ffeedingit-0.1.0%2Fpysrc%2Ffeedingit.py;h=a951ec98937c74cb15eb133170f71a68038f5c7f;hb=e9b6d97afa02e67a6aae080e6820685d0a513af3;hp=9d70a3c36c588cdb10c84818ef765988089d4e33;hpb=4a48b1271cfdf4c6b5665e8a53b115d1e6876fdb;p=feedingit diff --git a/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/pysrc/feedingit.py b/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/pysrc/feedingit.py index 9d70a3c..a951ec9 100644 --- a/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/pysrc/feedingit.py +++ b/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/pysrc/feedingit.py @@ -31,6 +31,7 @@ from cgi import escape from re import sub class Controller(QtCore.QObject): + cachedList = None def __init__(self, listing): QtCore.QObject.__init__(self) @@ -70,18 +71,30 @@ class Controller(QtCore.QObject): @QtCore.Slot(str,result=str) def getArticlesXml(self, key): + feed = listing.getFeed(key) + self.cachedList = feed.getIds(onlyUnread=True) #onlyUnread = arguments.get("onlyUnread","False") return self._handler.generateArticlesXml(key, config.getHideReadArticles()) - @QtCore.Slot(str,str,result=str) - def getNextId(self, key, articleid): - feed = listing.getFeed(key) - return feed.getNextId(articleid) + @QtCore.Slot(str,str,bool,result=str) + def getNextId(self, key, articleid, onlyUnread): + if (onlyUnread): + print self.cachedList, articleid + index = self.cachedList.index(articleid) + return self.cachedList[(index + 1) % len(self.cachedList)] + else: + feed = listing.getFeed(key) + return feed.getNextId(articleid) - @QtCore.Slot(str,str,result=str) - def getPreviousId(self, key, articleid): - feed = listing.getFeed(key) - return feed.getPreviousId(articleid) + @QtCore.Slot(str,str,bool,result=str) + def getPreviousId(self, key, articleid, onlyUnread): + if (onlyUnread): + print self.cachedList, articleid + index = self.cachedList.index(articleid) + return self.cachedList[(index - 1) % len(self.cachedList)] + else: + feed = listing.getFeed(key) + return feed.getPreviousId(articleid) @QtCore.Slot(result=str) def getCategoryXml(self): @@ -221,6 +234,13 @@ class Controller(QtCore.QObject): elif (setting == "fontSize" ): config.setFontSize(value) config.saveConfig() + + @QtCore.Slot(str, str) + def openSettings(self): + bus = dbus.SessionBus() + settingService = bus.get_object('com.nokia.DuiControlPanel', '/') + setting = shareService.get_dbus_method('appletPage', 'com.nokia.DuiControlPanelIf') + setting("feedingitsync") @QtCore.Slot(str, str) def share(self, key, articleid):