Fix comparison function signature

This commit fixes build on CentOS 7 with GCC 4.8.5
This commit is contained in:
Hennadii Stepanov 2019-11-29 20:15:45 +02:00
parent abb30de63f
commit b66861e2e5
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 5 additions and 6 deletions

View file

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

View file

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