Fix possible rule saving issue

Matching articles are now previewable in the rss downloader dialog
Make sure Rss downloading is enabled before checking for matching rules
This commit is contained in:
Christophe Dumez
2010-11-13 19:36:46 +00:00
parent 345222cf42
commit c387c15eb0
18 changed files with 174 additions and 48 deletions

View File

@@ -33,6 +33,7 @@
#include <QDebug>
#include "rssdownloadrulelist.h"
#include "rsssettings.h"
#include "qinisettings.h"
RssDownloadRuleList* RssDownloadRuleList::m_instance = 0;
@@ -56,6 +57,7 @@ void RssDownloadRuleList::drop()
RssDownloadRule RssDownloadRuleList::findMatchingRule(const QString &feed_url, const QString &article_title) const
{
Q_ASSERT(RssSettings::isRssDownloadingEnabled());
QStringList rule_names = feedRules(feed_url);
foreach(const QString &rule_name, rule_names) {
RssDownloadRule rule = m_rules[rule_name];
@@ -127,6 +129,7 @@ void RssDownloadRuleList::loadRulesFromVariantHash(const QVariantHash &h)
void RssDownloadRuleList::saveRule(const RssDownloadRule &rule)
{
qDebug() << Q_FUNC_INFO << rule.name();
Q_ASSERT(rule.isValid());
if(m_rules.contains(rule.name())) {
removeRule(rule.name());