From 8949a8ad752287df1fe5d8fe008d5cb7e7cca569 Mon Sep 17 00:00:00 2001 From: Tim Delaney Date: Sat, 31 Dec 2016 16:58:01 +1100 Subject: [PATCH] RSS: allow resetting rule to no category. Closes #5539. --HG-- branch : magao-dev --- src/gui/rss/automatedrssdownloader.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/rss/automatedrssdownloader.cpp b/src/gui/rss/automatedrssdownloader.cpp index cd253f849..ad83bf461 100644 --- a/src/gui/rss/automatedrssdownloader.cpp +++ b/src/gui/rss/automatedrssdownloader.cpp @@ -253,13 +253,9 @@ void AutomatedRssDownloader::updateRuleDefinitionBox() ui->checkRegex->blockSignals(true); ui->checkRegex->setChecked(rule->useRegex()); ui->checkRegex->blockSignals(false); - if (rule->category().isEmpty()) { - ui->comboCategory->setCurrentIndex(-1); + ui->comboCategory->setCurrentIndex(ui->comboCategory->findText(rule->category())); + if (rule->category().isEmpty()) ui->comboCategory->clearEditText(); - } - else { - ui->comboCategory->setCurrentIndex(ui->comboCategory->findText(rule->category())); - } ui->comboAddPaused->setCurrentIndex(rule->addPaused()); ui->spinIgnorePeriod->setValue(rule->ignoreDays()); QDateTime dateTime = rule->lastMatch(); @@ -317,6 +313,7 @@ void AutomatedRssDownloader::initCategoryCombobox() // Load torrent categories QStringList categories = BitTorrent::Session::instance()->categories(); std::sort(categories.begin(), categories.end(), Utils::String::naturalCompareCaseInsensitive); + ui->comboCategory->addItem(QString("")); ui->comboCategory->addItems(categories); }