Sort labels in RSS Downloader dialog, closes #3140.

This commit is contained in:
Chocobo1 2015-06-20 15:06:49 +08:00
parent 65d3ca8c3f
commit cf91685f6f
3 changed files with 101 additions and 6 deletions

View file

@ -43,6 +43,7 @@
#include "guiiconprovider.h"
#include "autoexpandabledialog.h"
#include "core/utils/fs.h"
#include "core/utils/string.h"
AutomatedRssDownloader::AutomatedRssDownloader(const QWeakPointer<RssManager>& manager, QWidget *parent) :
QDialog(parent),
@ -308,10 +309,10 @@ RssDownloadRulePtr AutomatedRssDownloader::getCurrentRule() const
void AutomatedRssDownloader::initLabelCombobox()
{
// Load custom labels
const QStringList customLabels = Preferences::instance()->getTorrentLabels();
foreach (const QString& label, customLabels) {
ui->comboLabel->addItem(label);
}
QStringList customLabels = Preferences::instance()->getTorrentLabels();
std::sort(customLabels.begin(), customLabels.end(), Utils::String::NaturalCompare());
foreach (const QString& l, customLabels)
ui->comboLabel->addItem(l);
}
void AutomatedRssDownloader::saveEditedRule()