From 2c10b3936b11908f5ccca209e9e4379bb76189e7 Mon Sep 17 00:00:00 2001 From: FranciscoPombal Date: Wed, 7 Oct 2020 13:01:34 +0100 Subject: [PATCH] Change some types (uint -> int) in RSS subsystem --- src/base/rss/rss_session.cpp | 6 +++--- src/base/rss/rss_session.h | 6 +++--- src/gui/rss/rsswidget.cpp | 2 +- src/gui/rss/rsswidget.h | 2 +- src/webui/api/appcontroller.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/base/rss/rss_session.cpp b/src/base/rss/rss_session.cpp index c2b1f722c..9bcfdeb91 100644 --- a/src/base/rss/rss_session.cpp +++ b/src/base/rss/rss_session.cpp @@ -65,7 +65,7 @@ QPointer Session::m_instance = nullptr; Session::Session() : m_processingEnabled(SettingsStorage::instance()->loadValue(SettingsKey_ProcessingEnabled, false).toBool()) , m_workingThread(new QThread(this)) - , m_refreshInterval(SettingsStorage::instance()->loadValue(SettingsKey_RefreshInterval, 30).toUInt()) + , m_refreshInterval(SettingsStorage::instance()->loadValue(SettingsKey_RefreshInterval, 30).toInt()) , m_maxArticlesPerFeed(SettingsStorage::instance()->loadValue(SettingsKey_MaxArticlesPerFeed, 50).toInt()) { Q_ASSERT(!m_instance); // only one instance is allowed @@ -475,12 +475,12 @@ Feed *Session::feedByURL(const QString &url) const return m_feedsByURL.value(url); } -uint Session::refreshInterval() const +int Session::refreshInterval() const { return m_refreshInterval; } -void Session::setRefreshInterval(const uint refreshInterval) +void Session::setRefreshInterval(const int refreshInterval) { if (m_refreshInterval != refreshInterval) { SettingsStorage::instance()->storeValue(SettingsKey_RefreshInterval, refreshInterval); diff --git a/src/base/rss/rss_session.h b/src/base/rss/rss_session.h index e4d8b945d..c31acee4b 100644 --- a/src/base/rss/rss_session.h +++ b/src/base/rss/rss_session.h @@ -101,8 +101,8 @@ namespace RSS int maxArticlesPerFeed() const; void setMaxArticlesPerFeed(int n); - uint refreshInterval() const; - void setRefreshInterval(uint refreshInterval); + int refreshInterval() const; + void setRefreshInterval(int refreshInterval); bool addFolder(const QString &path, QString *error = nullptr); bool addFeed(const QString &url, const QString &path, QString *error = nullptr); @@ -152,7 +152,7 @@ namespace RSS AsyncFileStorage *m_confFileStorage; AsyncFileStorage *m_dataFileStorage; QTimer m_refreshTimer; - uint m_refreshInterval; + int m_refreshInterval; int m_maxArticlesPerFeed; QHash m_itemsByPath; QHash m_feedsByUID; diff --git a/src/gui/rss/rsswidget.cpp b/src/gui/rss/rsswidget.cpp index 25065f3b2..c945906dc 100644 --- a/src/gui/rss/rsswidget.cpp +++ b/src/gui/rss/rsswidget.cpp @@ -521,7 +521,7 @@ void RSSWidget::restoreSlidersPosition() m_ui->splitterMain->restoreState(stateMain); } -void RSSWidget::updateRefreshInterval(uint val) +void RSSWidget::updateRefreshInterval(int val) const { RSS::Session::instance()->setRefreshInterval(val); } diff --git a/src/gui/rss/rsswidget.h b/src/gui/rss/rsswidget.h index 791610446..8a6b6f958 100644 --- a/src/gui/rss/rsswidget.h +++ b/src/gui/rss/rsswidget.h @@ -54,7 +54,7 @@ public: public slots: void deleteSelectedItems(); - void updateRefreshInterval(uint val); + void updateRefreshInterval(int val) const; signals: void unreadCountUpdated(int count); diff --git a/src/webui/api/appcontroller.cpp b/src/webui/api/appcontroller.cpp index 069788529..cb1525ae1 100644 --- a/src/webui/api/appcontroller.cpp +++ b/src/webui/api/appcontroller.cpp @@ -254,7 +254,7 @@ void AppController::preferencesAction() data["dyndns_domain"] = pref->getDynDomainName(); // RSS settings - data["rss_refresh_interval"] = static_cast(RSS::Session::instance()->refreshInterval()); + data["rss_refresh_interval"] = RSS::Session::instance()->refreshInterval(); data["rss_max_articles_per_feed"] = RSS::Session::instance()->maxArticlesPerFeed(); data["rss_processing_enabled"] = RSS::Session::instance()->isProcessingEnabled(); data["rss_auto_downloading_enabled"] = RSS::AutoDownloader::instance()->isProcessingEnabled(); @@ -654,7 +654,7 @@ void AppController::setPreferencesAction() pref->setDynDomainName(it.value().toString()); if (hasKey("rss_refresh_interval")) - RSS::Session::instance()->setRefreshInterval(it.value().toUInt()); + RSS::Session::instance()->setRefreshInterval(it.value().toInt()); if (hasKey("rss_max_articles_per_feed")) RSS::Session::instance()->setMaxArticlesPerFeed(it.value().toInt()); if (hasKey("rss_processing_enabled"))