From 5d000862ab7ce5a66771976e2d84080da830f9f8 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 3 Feb 2014 20:01:43 +0100 Subject: [PATCH] Work on auto-update. --- src/core/defs.h.in | 1 + src/core/feeddownloader.h | 14 +++++++------- src/gui/feedmessageviewer.cpp | 2 +- src/gui/feedsview.cpp | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/defs.h.in b/src/core/defs.h.in index 4079bea62..c51af58eb 100755 --- a/src/core/defs.h.in +++ b/src/core/defs.h.in @@ -40,6 +40,7 @@ #define MIN_CATEGORY_NAME_LENGTH 3 #define INTERNAL_URL_NEWSPAPER "@APP_LOW_NAME@:newspaper" #define DEFAULT_AUTO_UPDATE_INTERVAL 15 +#define AUTO_UPDATE_INTERVAL 60000 #define APP_DB_INIT_FILE "db_init.sql" #define APP_DB_INIT_MEMORY "db_init_memory.sql" diff --git a/src/core/feeddownloader.h b/src/core/feeddownloader.h index bd152d58f..b546148a9 100644 --- a/src/core/feeddownloader.h +++ b/src/core/feeddownloader.h @@ -19,6 +19,13 @@ class FeedDownloader : public QObject { explicit FeedDownloader(QObject *parent = 0); virtual ~FeedDownloader(); + public slots: + // Performs update of all feeds from the "feeds" parameter. + // New messages are downloaded for each feed and they + // are stored persistently in the database. + // Appropriate signals are emitted. + void updateFeeds(const QList &feeds); + signals: // Emitted if feed updates started. void started(); @@ -32,13 +39,6 @@ class FeedDownloader : public QObject { // and "total" number indicates total number of feeds // which are in the initial queue. void progress(FeedsModelFeed *feed, int current, int total); - - public slots: - // Performs update of all feeds from the "feeds" parameter. - // New messages are downloaded for each feed and they - // are stored persistently in the database. - // Appropriate signals are emitted. - void updateFeeds(const QList &feeds); }; #endif // FEEDDOWNLOADER_H diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp index 04fc11dd6..0548c09e9 100644 --- a/src/gui/feedmessageviewer.cpp +++ b/src/gui/feedmessageviewer.cpp @@ -51,7 +51,7 @@ FeedMessageViewer::FeedMessageViewer(QWidget *parent) // asi udelat metodu pro update v teto tride // ta obali update v m_feedsView // a nastavit jako single shot -> true nejak nevim - m_autoUpdateTimer->setInterval(1000); + m_autoUpdateTimer->setInterval(AUTO_UPDATE_INTERVAL); m_autoUpdateTimer->setSingleShot(false); m_autoUpdateTimer->start(); } diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index 189ea2d74..4108a021d 100644 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -108,6 +108,7 @@ void FeedsView::updateScheduledFeeds() { // feeds which should be updated and // request their update. // TODO: emit feedsUpdateRequested(selectedFeeds()); + // tady vybrat feedy ktery se maj updatovat ted } else { if (SystemTrayIcon::isSystemTrayActivated()) {