Reduce build warnings and enable Qt build
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
#include "wallet/wallet.h"
|
||||
#include "askpassphrasedialog.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFont>
|
||||
|
||||
@@ -82,7 +84,7 @@ public:
|
||||
cachedAddressTable.clear();
|
||||
{
|
||||
LOCK(wallet->cs_wallet);
|
||||
for (const PAIRTYPE(CTxDestination, CAddressBookData) & item : wallet->mapAddressBook) {
|
||||
for (const auto& item : wallet->mapAddressBook) {
|
||||
const CBitcoinAddress& address = item.first;
|
||||
bool fMine = IsMine(*wallet, address.Get());
|
||||
AddressTableEntry::Type addressType = translateTransactionType(
|
||||
@@ -96,15 +98,15 @@ 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)
|
||||
{
|
||||
// Find address / label in model
|
||||
QList<AddressTableEntry>::iterator lower = qLowerBound(
|
||||
QList<AddressTableEntry>::iterator lower = std::lower_bound(
|
||||
cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
|
||||
QList<AddressTableEntry>::iterator upper = qUpperBound(
|
||||
QList<AddressTableEntry>::iterator upper = std::upper_bound(
|
||||
cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
|
||||
int lowerIndex = (lower - cachedAddressTable.begin());
|
||||
int upperIndex = (upper - cachedAddressTable.begin());
|
||||
@@ -145,9 +147,9 @@ public:
|
||||
void updateEntry(const QString &pubCoin, const QString &isUsed, int status)
|
||||
{
|
||||
// Find address / label in model
|
||||
QList<AddressTableEntry>::iterator lower = qLowerBound(
|
||||
QList<AddressTableEntry>::iterator lower = std::lower_bound(
|
||||
cachedAddressTable.begin(), cachedAddressTable.end(), pubCoin, AddressTableEntryLessThan());
|
||||
QList<AddressTableEntry>::iterator upper = qUpperBound(
|
||||
QList<AddressTableEntry>::iterator upper = std::upper_bound(
|
||||
cachedAddressTable.begin(), cachedAddressTable.end(), pubCoin, AddressTableEntryLessThan());
|
||||
int lowerIndex = (lower - cachedAddressTable.begin());
|
||||
bool inModel = (lower != upper);
|
||||
@@ -317,7 +319,7 @@ QVariant AddressTableModel::headerData(int section, Qt::Orientation orientation,
|
||||
Qt::ItemFlags AddressTableModel::flags(const QModelIndex& index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
return Qt::ItemFlags();
|
||||
AddressTableEntry* rec = static_cast<AddressTableEntry*>(index.internalPointer());
|
||||
|
||||
Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
||||
|
||||
Reference in New Issue
Block a user