mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Simplify natural sort classes interface
Now the comparison function/class should be constructed before usage. This change also make it easier to plug in into various containers which will require a compare function type (such as std::set).
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
|
||||
#include "base/bittorrent/infohash.h"
|
||||
#include "base/bittorrent/torrent.h"
|
||||
#include "base/utils/string.h"
|
||||
#include "transferlistmodel.h"
|
||||
|
||||
namespace
|
||||
@@ -143,7 +142,7 @@ int TransferListSortModel::compare(const QModelIndex &left, const QModelIndex &r
|
||||
case TransferListModel::TR_SAVE_PATH:
|
||||
case TransferListModel::TR_TAGS:
|
||||
case TransferListModel::TR_TRACKER:
|
||||
return Utils::String::naturalCompare(leftValue.toString(), rightValue.toString(), Qt::CaseInsensitive);
|
||||
return m_naturalCompare(leftValue.toString(), rightValue.toString());
|
||||
|
||||
case TransferListModel::TR_AMOUNT_DOWNLOADED:
|
||||
case TransferListModel::TR_AMOUNT_DOWNLOADED_SESSION:
|
||||
|
||||
Reference in New Issue
Block a user