mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 11:49:01 +03:00
- Take "RSS refresh interval" into consideration without restarting qBT
This commit is contained in:
parent
e97b805365
commit
3762c37517
6 changed files with 17 additions and 3 deletions
|
@ -825,6 +825,7 @@ void GUI::loadPreferences(bool configure_session) {
|
|||
// RSS
|
||||
if(Preferences::isRSSEnabled()) {
|
||||
displayRSSTab(true);
|
||||
rssWidget->updateRefreshInterval(Preferences::getRefreshInterval());
|
||||
} else {
|
||||
displayRSSTab(false);
|
||||
}
|
||||
|
|
|
@ -351,9 +351,9 @@ public:
|
|||
return settings.value(QString::fromUtf8("Preferences/RSS/RSSEnabled"), false).toBool();
|
||||
}
|
||||
|
||||
static int getRSSRefreshInterval() {
|
||||
static unsigned int getRSSRefreshInterval() {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
return settings.value(QString::fromUtf8("Preferences/RSS/RSSRefresh"), 5).toInt();
|
||||
return settings.value(QString::fromUtf8("Preferences/RSS/RSSRefresh"), 5).toUInt();
|
||||
}
|
||||
|
||||
static int getRSSMaxArticlesPerFeed() {
|
||||
|
|
|
@ -291,6 +291,13 @@ RssManager::~RssManager(){
|
|||
qDebug("RSSManager deleted");
|
||||
}
|
||||
|
||||
void RssManager::updateRefreshInterval(unsigned int val){
|
||||
if(refreshInterval != val) {
|
||||
refreshInterval = val;
|
||||
newsRefresher.start(refreshInterval*60000);
|
||||
}
|
||||
}
|
||||
|
||||
void RssManager::loadStreamList(){
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
QStringList streamsUrl = settings.value("Rss/streamList").toStringList();
|
||||
|
@ -611,7 +618,7 @@ short RssStream::readDoc(const QDomDocument& doc) {
|
|||
|
||||
void RssStream::resizeList() {
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
unsigned int max_articles = settings.value(QString::fromUtf8("Preferences/RSS/RSSMaxArticlesPerFeed"), 100).toInt();
|
||||
unsigned int max_articles = settings.value(QString::fromUtf8("Preferences/RSS/RSSMaxArticlesPerFeed"), 50).toInt();
|
||||
unsigned int nb_articles = this->size();
|
||||
if(nb_articles > max_articles) {
|
||||
QList<RssItem*> listItem = RssManager::sortNewsList(this->values());
|
||||
|
|
|
@ -488,6 +488,7 @@ public slots:
|
|||
void forwardFeedInfosChanged(QString url, QString aliasOrUrl, unsigned int nbUnread);
|
||||
void forwardFeedIconChanged(QString url, QString icon_path);
|
||||
void moveFile(RssFile* file, RssFolder* dest_folder);
|
||||
void updateRefreshInterval(unsigned int val);
|
||||
|
||||
public:
|
||||
RssManager(bittorrent *BTSession);
|
||||
|
|
|
@ -561,6 +561,10 @@ void RSSImp::updateFeedInfos(QString url, QString aliasOrUrl, unsigned int nbUnr
|
|||
}
|
||||
}
|
||||
|
||||
void RSSImp::updateRefreshInterval(unsigned int val) {
|
||||
rssmanager->updateRefreshInterval(val);
|
||||
}
|
||||
|
||||
RSSImp::RSSImp(bittorrent *BTSession) : QWidget(), BTSession(BTSession){
|
||||
setupUi(this);
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ private:
|
|||
|
||||
public slots:
|
||||
void deleteSelectedItems();
|
||||
void updateRefreshInterval(unsigned int val);
|
||||
|
||||
protected slots:
|
||||
void on_newFeedButton_clicked();
|
||||
|
|
Loading…
Reference in a new issue