mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 14:57:52 +00:00
- Take "RSS refresh interval" into consideration without restarting qBT
This commit is contained in:
parent
e97b805365
commit
3762c37517
@ -825,6 +825,7 @@ void GUI::loadPreferences(bool configure_session) {
|
|||||||
// RSS
|
// RSS
|
||||||
if(Preferences::isRSSEnabled()) {
|
if(Preferences::isRSSEnabled()) {
|
||||||
displayRSSTab(true);
|
displayRSSTab(true);
|
||||||
|
rssWidget->updateRefreshInterval(Preferences::getRefreshInterval());
|
||||||
} else {
|
} else {
|
||||||
displayRSSTab(false);
|
displayRSSTab(false);
|
||||||
}
|
}
|
||||||
|
@ -351,9 +351,9 @@ public:
|
|||||||
return settings.value(QString::fromUtf8("Preferences/RSS/RSSEnabled"), false).toBool();
|
return settings.value(QString::fromUtf8("Preferences/RSS/RSSEnabled"), false).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int getRSSRefreshInterval() {
|
static unsigned int getRSSRefreshInterval() {
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
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() {
|
static int getRSSMaxArticlesPerFeed() {
|
||||||
|
@ -291,6 +291,13 @@ RssManager::~RssManager(){
|
|||||||
qDebug("RSSManager deleted");
|
qDebug("RSSManager deleted");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RssManager::updateRefreshInterval(unsigned int val){
|
||||||
|
if(refreshInterval != val) {
|
||||||
|
refreshInterval = val;
|
||||||
|
newsRefresher.start(refreshInterval*60000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RssManager::loadStreamList(){
|
void RssManager::loadStreamList(){
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
QStringList streamsUrl = settings.value("Rss/streamList").toStringList();
|
QStringList streamsUrl = settings.value("Rss/streamList").toStringList();
|
||||||
@ -611,7 +618,7 @@ short RssStream::readDoc(const QDomDocument& doc) {
|
|||||||
|
|
||||||
void RssStream::resizeList() {
|
void RssStream::resizeList() {
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
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();
|
unsigned int nb_articles = this->size();
|
||||||
if(nb_articles > max_articles) {
|
if(nb_articles > max_articles) {
|
||||||
QList<RssItem*> listItem = RssManager::sortNewsList(this->values());
|
QList<RssItem*> listItem = RssManager::sortNewsList(this->values());
|
||||||
|
@ -488,6 +488,7 @@ public slots:
|
|||||||
void forwardFeedInfosChanged(QString url, QString aliasOrUrl, unsigned int nbUnread);
|
void forwardFeedInfosChanged(QString url, QString aliasOrUrl, unsigned int nbUnread);
|
||||||
void forwardFeedIconChanged(QString url, QString icon_path);
|
void forwardFeedIconChanged(QString url, QString icon_path);
|
||||||
void moveFile(RssFile* file, RssFolder* dest_folder);
|
void moveFile(RssFile* file, RssFolder* dest_folder);
|
||||||
|
void updateRefreshInterval(unsigned int val);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RssManager(bittorrent *BTSession);
|
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){
|
RSSImp::RSSImp(bittorrent *BTSession) : QWidget(), BTSession(BTSession){
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ private:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void deleteSelectedItems();
|
void deleteSelectedItems();
|
||||||
|
void updateRefreshInterval(unsigned int val);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void on_newFeedButton_clicked();
|
void on_newFeedButton_clicked();
|
||||||
|
Loading…
Reference in New Issue
Block a user