[GUI] Implement stable sort (#7703)

* NaturalCompare now returns compare result instead of "less than" result
* Change to stable sort in GUI components
* Add Utils::String::naturalLessThan() helper function
* Use Qt::CaseSensitivity type
This commit is contained in:
Mike Tzou 2017-11-30 17:10:30 +08:00 committed by GitHub
parent 74d281526b
commit eac8838dc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 184 additions and 154 deletions

View file

@ -311,7 +311,7 @@ void AutomatedRssDownloader::initCategoryCombobox()
{
// Load torrent categories
QStringList categories = BitTorrent::Session::instance()->categories().keys();
std::sort(categories.begin(), categories.end(), Utils::String::naturalCompareCaseInsensitive);
std::sort(categories.begin(), categories.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>);
m_ui->comboCategory->addItem("");
m_ui->comboCategory->addItems(categories);
}