1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 23:07:59 +00:00

- Clean up RSS preferences loading

This commit is contained in:
Christophe Dumez 2009-12-07 22:04:20 +00:00
parent 22ec528cdf
commit be11f4e039

View File

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