Work on auto-update.

This commit is contained in:
Martin Rotter 2014-02-03 20:01:43 +01:00
parent 13c5c629df
commit 5d000862ab
4 changed files with 10 additions and 8 deletions

View File

@ -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"

View File

@ -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<FeedsModelFeed*> &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<FeedsModelFeed*> &feeds);
};
#endif // FEEDDOWNLOADER_H

View File

@ -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();
}

View File

@ -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()) {