Fix comparison function signature

This commit fixes build on CentOS 7 with GCC 4.8.5

Github-Pull: #17634
Rebased-From: b66861e2e5e8a49e11e7489cf22c3007bc7082cc
This commit is contained in:
Hennadii Stepanov 2019-11-29 20:15:45 +02:00 committed by João Barbosa
parent eac49073eb
commit b8101fb7ac
2 changed files with 5 additions and 6 deletions

View file

@ -11,8 +11,7 @@
#include <clientversion.h> #include <clientversion.h>
#include <streams.h> #include <streams.h>
#include <algorithm> #include <utility>
RecentRequestsTableModel::RecentRequestsTableModel(WalletModel *parent) : RecentRequestsTableModel::RecentRequestsTableModel(WalletModel *parent) :
QAbstractTableModel(parent), walletModel(parent) QAbstractTableModel(parent), walletModel(parent)
@ -213,10 +212,10 @@ void RecentRequestsTableModel::updateDisplayUnit()
updateAmountColumnTitle(); updateAmountColumnTitle();
} }
bool RecentRequestEntryLessThan::operator()(RecentRequestEntry &left, RecentRequestEntry &right) const bool RecentRequestEntryLessThan::operator()(const RecentRequestEntry& left, const RecentRequestEntry& right) const
{ {
RecentRequestEntry *pLeft = &left; const RecentRequestEntry* pLeft = &left;
RecentRequestEntry *pRight = &right; const RecentRequestEntry* pRight = &right;
if (order == Qt::DescendingOrder) if (order == Qt::DescendingOrder)
std::swap(pLeft, pRight); std::swap(pLeft, pRight);

View file

@ -43,7 +43,7 @@ class RecentRequestEntryLessThan
public: public:
RecentRequestEntryLessThan(int nColumn, Qt::SortOrder fOrder): RecentRequestEntryLessThan(int nColumn, Qt::SortOrder fOrder):
column(nColumn), order(fOrder) {} column(nColumn), order(fOrder) {}
bool operator()(RecentRequestEntry &left, RecentRequestEntry &right) const; bool operator()(const RecentRequestEntry& left, const RecentRequestEntry& right) const;
private: private:
int column; int column;