Browse Source

Change some types (uint -> int) in RSS subsystem

adaptive-webui-19844
FranciscoPombal 4 years ago
parent
commit
2c10b3936b
  1. 6
      src/base/rss/rss_session.cpp
  2. 6
      src/base/rss/rss_session.h
  3. 2
      src/gui/rss/rsswidget.cpp
  4. 2
      src/gui/rss/rsswidget.h
  5. 4
      src/webui/api/appcontroller.cpp

6
src/base/rss/rss_session.cpp

@ -65,7 +65,7 @@ QPointer<Session> Session::m_instance = nullptr; @@ -65,7 +65,7 @@ QPointer<Session> 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 @@ -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);

6
src/base/rss/rss_session.h

@ -101,8 +101,8 @@ namespace RSS @@ -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 @@ -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<QString, Item *> m_itemsByPath;
QHash<QUuid, Feed *> m_feedsByUID;

2
src/gui/rss/rsswidget.cpp

@ -521,7 +521,7 @@ void RSSWidget::restoreSlidersPosition() @@ -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);
}

2
src/gui/rss/rsswidget.h

@ -54,7 +54,7 @@ public: @@ -54,7 +54,7 @@ public:
public slots:
void deleteSelectedItems();
void updateRefreshInterval(uint val);
void updateRefreshInterval(int val) const;
signals:
void unreadCountUpdated(int count);

4
src/webui/api/appcontroller.cpp

@ -254,7 +254,7 @@ void AppController::preferencesAction() @@ -254,7 +254,7 @@ void AppController::preferencesAction()
data["dyndns_domain"] = pref->getDynDomainName();
// RSS settings
data["rss_refresh_interval"] = static_cast<double>(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() @@ -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"))

Loading…
Cancel
Save