diff options
| author | fanquake <[email protected]> | 2019-08-21 09:44:19 +0800 |
|---|---|---|
| committer | fanquake <[email protected]> | 2019-08-22 13:42:44 +0800 |
| commit | 59373e3e94015316bcaa03a7b9c2e6f442641720 (patch) | |
| tree | f9d1c72b02ddcc2082b17ab07df11207541c4646 /src | |
| parent | refactor: replace qStableSort with std::stable_sort (diff) | |
| download | discoin-59373e3e94015316bcaa03a7b9c2e6f442641720.tar.xz discoin-59373e3e94015316bcaa03a7b9c2e6f442641720.zip | |
refactor: replace qSort with std::sort
Diffstat (limited to 'src')
| -rw-r--r-- | src/qt/addresstablemodel.cpp | 4 | ||||
| -rw-r--r-- | src/qt/recentrequeststablemodel.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp index 29423db3d..a402500d7 100644 --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -10,6 +10,8 @@ #include <key_io.h> #include <wallet/wallet.h> +#include <algorithm> + #include <QFont> #include <QDebug> @@ -89,7 +91,7 @@ public: // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order // Even though the map is already sorted this re-sorting step is needed because the originating map // is sorted by binary address, not by base58() address. - qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan()); + std::sort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan()); } void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status) diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index aa746017f..1611ec823 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -11,6 +11,8 @@ #include <clientversion.h> #include <streams.h> +#include <algorithm> + RecentRequestsTableModel::RecentRequestsTableModel(WalletModel *parent) : QAbstractTableModel(parent), walletModel(parent) @@ -202,7 +204,7 @@ void RecentRequestsTableModel::addNewRequest(RecentRequestEntry &recipient) void RecentRequestsTableModel::sort(int column, Qt::SortOrder order) { - qSort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order)); + std::sort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order)); Q_EMIT dataChanged(index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex())); } |