Browse Source

- Clean up RSS preferences loading

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
be11f4e039
  1. 7
      src/rss.cpp

7
src/rss.cpp

@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
*/
#include "rss.h"
#include "preferences.h"
#ifdef QT_4_5
#include <QHash>
@ -286,8 +287,7 @@ void RssFolder::addFile(RssFile * item) { @@ -286,8 +287,7 @@ void RssFolder::addFile(RssFile * item) {
RssManager::RssManager(Bittorrent *BTSession): RssFolder(0, this, BTSession, QString::null) {
loadStreamList();
connect(&newsRefresher, SIGNAL(timeout()), this, SLOT(refreshAll()));
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
refreshInterval = settings.value(QString::fromUtf8("Preferences/RSS/RSSRefresh"), 5).toInt();
refreshInterval = Preferences::getRSSRefreshInterval();
newsRefresher.start(refreshInterval*60000);
}
@ -624,8 +624,7 @@ short RssStream::readDoc(const QDomDocument& doc) { @@ -624,8 +624,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"), 50).toInt();
unsigned int max_articles = Preferences::getRSSMaxArticlesPerFeed();
unsigned int nb_articles = this->size();
if(nb_articles > max_articles) {
QList<RssItem*> listItem = RssManager::sortNewsList(this->values());

Loading…
Cancel
Save