1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-27 23:14:31 +00:00

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

This commit is contained in:
FranciscoPombal 2020-10-07 13:01:34 +01:00
parent deffdbe881
commit 2c10b3936b
5 changed files with 10 additions and 10 deletions

View File

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

View File

@ -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<QString, Item *> m_itemsByPath;
QHash<QUuid, Feed *> m_feedsByUID;

View File

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

View File

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

View File

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