mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Clean up RSS preferences loading
This commit is contained in:
parent
22ec528cdf
commit
be11f4e039
1 changed files with 3 additions and 4 deletions
|
@ -29,6 +29,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "rss.h"
|
#include "rss.h"
|
||||||
|
#include "preferences.h"
|
||||||
|
|
||||||
#ifdef QT_4_5
|
#ifdef QT_4_5
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
@ -286,8 +287,7 @@ void RssFolder::addFile(RssFile * item) {
|
||||||
RssManager::RssManager(Bittorrent *BTSession): RssFolder(0, this, BTSession, QString::null) {
|
RssManager::RssManager(Bittorrent *BTSession): RssFolder(0, this, BTSession, QString::null) {
|
||||||
loadStreamList();
|
loadStreamList();
|
||||||
connect(&newsRefresher, SIGNAL(timeout()), this, SLOT(refreshAll()));
|
connect(&newsRefresher, SIGNAL(timeout()), this, SLOT(refreshAll()));
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
refreshInterval = Preferences::getRSSRefreshInterval();
|
||||||
refreshInterval = settings.value(QString::fromUtf8("Preferences/RSS/RSSRefresh"), 5).toInt();
|
|
||||||
newsRefresher.start(refreshInterval*60000);
|
newsRefresher.start(refreshInterval*60000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,8 +624,7 @@ short RssStream::readDoc(const QDomDocument& doc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RssStream::resizeList() {
|
void RssStream::resizeList() {
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
unsigned int max_articles = Preferences::getRSSMaxArticlesPerFeed();
|
||||||
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());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue