Reduce build warnings and enable Qt build

This commit is contained in:
root
2026-04-28 16:50:31 +00:00
parent 34864c5254
commit 43b88c7110
43 changed files with 164 additions and 87 deletions
+9 -7
View File
@@ -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;
+2 -2
View File
@@ -357,7 +357,7 @@ void BitcoinApplication::createWindow(const NetworkStyle* networkStyle)
void BitcoinApplication::createSplashScreen(const NetworkStyle* networkStyle)
{
SplashScreen* splash = new SplashScreen(0, networkStyle);
SplashScreen* splash = new SplashScreen(Qt::WindowFlags(), networkStyle);
// We don't hold a direct pointer to the splash screen after creation, so use
// Qt::WA_DeleteOnClose to make sure that the window will be deleted eventually.
splash->setAttribute(Qt::WA_DeleteOnClose);
@@ -502,7 +502,6 @@ int main(int argc, char* argv[])
Q_INIT_RESOURCE(agrarian_locale);
Q_INIT_RESOURCE(agrarian);
BitcoinApplication app(argc, argv);
#if QT_VERSION > 0x050100
// Generate high-dpi pixmaps
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
@@ -513,6 +512,7 @@ int main(int argc, char* argv[])
#ifdef Q_OS_MAC
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
BitcoinApplication app(argc, argv);
// Register meta types used for QMetaObject::invokeMethod
qRegisterMetaType<bool*>();
+4 -2
View File
@@ -12,6 +12,8 @@
#include "sync.h"
#include "utiltime.h"
#include <algorithm>
#include <QDebug>
#include <QList>
@@ -63,7 +65,7 @@ public:
if (sortColumn >= 0)
// sort cachedBanlist (use stable sort to prevent rows jumping around unneceesarily)
qStableSort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));
std::stable_sort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));
}
int size() const
@@ -147,7 +149,7 @@ QVariant BanTableModel::headerData(int section, Qt::Orientation orientation, int
Qt::ItemFlags BanTableModel::flags(const QModelIndex &index) const
{
if(!index.isValid())
return 0;
return Qt::ItemFlags();
Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
return retval;
+5 -1
View File
@@ -98,7 +98,11 @@ public:
const QFontMetrics fm(fontMetrics());
int h = lineEdit()->minimumSizeHint().height();
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
int w = fm.horizontalAdvance(BitcoinUnits::format(BitcoinUnits::AGR, BitcoinUnits::maxMoney(), false, BitcoinUnits::separatorAlways));
#else
int w = fm.width(BitcoinUnits::format(BitcoinUnits::AGR, BitcoinUnits::maxMoney(), false, BitcoinUnits::separatorAlways));
#endif
w += 2; // cursor blinking space
QStyleOptionSpinBox opt;
@@ -159,7 +163,7 @@ protected:
StepEnabled stepEnabled() const
{
StepEnabled rv = 0;
StepEnabled rv = StepEnabled();
if (isReadOnly()) // Disable steps when AmountSpinBox is read-only
return StepNone;
if (text().isEmpty()) // Allow step-up with empty field
+4
View File
@@ -1283,7 +1283,11 @@ void BitcoinGUI::updateTorIcon()
bool tor_enabled = clientModel->getTorInfo(ip_port);
if (tor_enabled) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
if (labelTorIcon->pixmap(Qt::ReturnByValue).isNull()) {
#else
if (labelTorIcon->pixmap() == 0) {
#endif
QString ip_port_q = QString::fromStdString(ip_port);
labelTorIcon->setPixmap(QIcon(":/icons/onion").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
labelTorIcon->setToolTip(tr("Tor is <b>enabled</b>: %1").arg(ip_port_q));
+7
View File
@@ -52,7 +52,9 @@
#include <QDoubleValidator>
#include <QFileDialog>
#include <QFont>
#include <QGuiApplication>
#include <QLineEdit>
#include <QScreen>
#include <QSettings>
#include <QTextDocument> // for Qt::mightBeRichText
#include <QThread>
@@ -787,7 +789,12 @@ void restoreWindowGeometry(const QString& strSetting, const QSize& defaultSize,
QSize size = settings.value(strSetting + "Size", defaultSize).toSize();
if (!pos.x() && !pos.y()) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QScreen* screenHandle = QGuiApplication::primaryScreen();
QRect screen = screenHandle ? screenHandle->geometry() : QRect(QPoint(), size);
#else
QRect screen = QApplication::desktop()->screenGeometry();
#endif
pos.setX((screen.width() - size.width()) / 2);
pos.setY((screen.height() - size.height()) / 2);
}
+4 -4
View File
@@ -219,12 +219,12 @@ QVariant OptionsModel::data(const QModelIndex& index, int role) const
return settings.value("fUseProxy", false);
case ProxyIP: {
// contains IP at index 0 and port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
return strlIpPort.at(0);
}
case ProxyPort: {
// contains IP at index 0 and port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
return strlIpPort.at(1);
}
@@ -308,7 +308,7 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
break;
case ProxyIP: {
// contains current IP at index 0 and current port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
// if that key doesn't exist or has a changed IP
if (!settings.contains("addrProxy") || strlIpPort.at(0) != value.toString()) {
// construct new value from new IP and current port
@@ -319,7 +319,7 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
} break;
case ProxyPort: {
// contains current IP at index 0 and current port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
// if that key doesn't exist or has a changed port
if (!settings.contains("addrProxy") || strlIpPort.at(1) != value.toString()) {
// construct new value from current IP and new port
+8 -5
View File
@@ -36,6 +36,7 @@
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QSslCertificate>
#include <QSslConfiguration>
#include <QSslError>
#include <QSslSocket>
#include <QStringList>
@@ -129,9 +130,11 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store)
if (certFile != "-system-") {
certList = QSslCertificate::fromPath(certFile);
// Use those certificates when fetching payment requests, too:
QSslSocket::setDefaultCaCertificates(certList);
QSslConfiguration sslConfiguration = QSslConfiguration::defaultConfiguration();
sslConfiguration.setCaCertificates(certList);
QSslConfiguration::setDefaultConfiguration(sslConfiguration);
} else
certList = QSslSocket::systemCaCertificates();
certList = QSslConfiguration::systemCaCertificates();
int nRootCerts = 0;
const QDateTime currentTime = QDateTime::currentDateTime();
@@ -372,7 +375,7 @@ void PaymentServer::handleURIOrFile(const QString& s)
if (uri.hasQueryItem("r")) // payment request URI
{
QByteArray temp;
temp.append(uri.queryItemValue("r"));
temp.append(uri.queryItemValue("r").toUtf8());
QString decoded = QUrl::fromPercentEncoding(temp);
QUrl fetchUrl(decoded, QUrl::StrictMode);
@@ -507,7 +510,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins
QList<std::pair<CScript, CAmount> > sendingTos = request.getPayTo();
QStringList addresses;
foreach (const PAIRTYPE(CScript, CAmount) & sendingTo, sendingTos) {
for (const auto& sendingTo : sendingTos) {
// Extract and check destination addresses
CTxDestination dest;
if (ExtractDestination(sendingTo.first, dest)) {
@@ -597,7 +600,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien
}
}
int length = payment.ByteSize();
int length = static_cast<int>(payment.ByteSizeLong());
netRequest.setHeader(QNetworkRequest::ContentLengthHeader, length);
QByteArray serData(length, '\0');
if (payment.SerializeToArray(serData.data(), length)) {
+4 -2
View File
@@ -12,6 +12,8 @@
#include "net.h"
#include "sync.h"
#include <algorithm>
#include <QDebug>
#include <QList>
#include <QTimer>
@@ -83,7 +85,7 @@ public:
if (sortColumn >= 0)
// sort cacheNodeStats (use stable sort to prevent rows jumping around unneceesarily)
qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));
std::stable_sort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));
// build index map
mapNodeRows.clear();
@@ -185,7 +187,7 @@ QVariant PeerTableModel::headerData(int section, Qt::Orientation orientation, in
Qt::ItemFlags PeerTableModel::flags(const QModelIndex& index) const
{
if (!index.isValid())
return 0;
return Qt::ItemFlags();
Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
return retval;
-4
View File
@@ -706,10 +706,6 @@ void PrivacyDialog::setBalance(const CAmount& balance, const CAmount& unconfirme
}
}
CAmount matureZerocoinBalance = zerocoinBalance - unconfirmedZerocoinBalance - immatureZerocoinBalance;
CAmount nLockedBalance = 0;
if (walletModel) {
nLockedBalance = walletModel->getLockedBalance();
}
ui->labelzAvailableAmount->setText(QString::number(zerocoinBalance/COIN) + QString(" zAGR "));
ui->labelzAvailableAmount_2->setText(QString::number(matureZerocoinBalance/COIN) + QString(" zAGR "));
+1 -2
View File
@@ -255,7 +255,7 @@ void ReceiveCoinsDialog::copyColumnToClipboard(int column)
return;
// correct for selection mode ContiguousSelection
QModelIndex firstIndex = selection.at(0);
GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.child(firstIndex.row(), column), Qt::EditRole).toString());
GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.sibling(firstIndex.row(), column), Qt::EditRole).toString());
}
// context menu
@@ -300,4 +300,3 @@ void ReceiveCoinsDialog::receiveAddressUsed()
clear();
}
}
+28 -1
View File
@@ -40,14 +40,26 @@ QRImageWidget::QRImageWidget(QWidget* parent) : QLabel(parent), contextMenu(0)
QImage QRImageWidget::exportImage()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
const QPixmap pixmapValue = pixmap(Qt::ReturnByValue);
if (pixmapValue.isNull())
return QImage();
return pixmapValue.toImage().scaled(EXPORT_IMAGE_SIZE, EXPORT_IMAGE_SIZE);
#else
if (!pixmap())
return QImage();
return pixmap()->toImage().scaled(EXPORT_IMAGE_SIZE, EXPORT_IMAGE_SIZE);
#endif
}
void QRImageWidget::mousePressEvent(QMouseEvent* event)
{
if (event->button() == Qt::LeftButton && pixmap()) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
const bool hasPixmap = !pixmap(Qt::ReturnByValue).isNull();
#else
const bool hasPixmap = pixmap();
#endif
if (event->button() == Qt::LeftButton && hasPixmap) {
event->accept();
QMimeData* mimeData = new QMimeData;
mimeData->setImageData(exportImage());
@@ -62,8 +74,13 @@ void QRImageWidget::mousePressEvent(QMouseEvent* event)
void QRImageWidget::saveImage()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
if (pixmap(Qt::ReturnByValue).isNull())
return;
#else
if (!pixmap())
return;
#endif
QString fn = GUIUtil::getSaveFileName(this, tr("Save QR Code"), QString(), tr("PNG Image (*.png)"), NULL);
if (!fn.isEmpty()) {
exportImage().save(fn);
@@ -72,15 +89,25 @@ void QRImageWidget::saveImage()
void QRImageWidget::copyImage()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
if (pixmap(Qt::ReturnByValue).isNull())
return;
#else
if (!pixmap())
return;
#endif
QApplication::clipboard()->setImage(exportImage());
}
void QRImageWidget::contextMenuEvent(QContextMenuEvent* event)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
if (pixmap(Qt::ReturnByValue).isNull())
return;
#else
if (!pixmap())
return;
#endif
contextMenu->exec(event->globalPos());
}
+2 -1
View File
@@ -11,6 +11,7 @@
#include "optionsmodel.h"
#include "streams.h"
#include <algorithm>
RecentRequestsTableModel::RecentRequestsTableModel(CWallet* wallet, WalletModel* parent) : walletModel(parent)
{
@@ -198,7 +199,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));
emit dataChanged(index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex()));
}
+16
View File
@@ -20,7 +20,9 @@
#include <QApplication>
#include <QCloseEvent>
#include <QDesktopWidget>
#include <QGuiApplication>
#include <QPainter>
#include <QScreen>
SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle* networkStyle) : QWidget(0, f), curAlignment(0)
{
@@ -52,7 +54,11 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle* networkStyle)
// check font size and drawing with
pixPaint.setFont(QFont(font, 28 * fontFactor));
QFontMetrics fm = pixPaint.fontMetrics();
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
int titleTextWidth = fm.horizontalAdvance(titleText);
#else
int titleTextWidth = fm.width(titleText);
#endif
if (titleTextWidth > 160) {
// strange font rendering, Arial probably not found
fontFactor = 0.75;
@@ -79,7 +85,11 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle* networkStyle)
boldFont.setWeight(QFont::Bold);
pixPaint.setFont(boldFont);
fm = pixPaint.fontMetrics();
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
int titleAddTextWidth = fm.horizontalAdvance(titleAddText);
#else
int titleAddTextWidth = fm.width(titleAddText);
#endif
pixPaint.drawText(pixmap.width() - titleAddTextWidth - 10, pixmap.height() - 25, titleAddText);
}
@@ -92,7 +102,13 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle* networkStyle)
QRect r(QPoint(), pixmap.size());
resize(r.size());
setFixedSize(r.size());
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QScreen* screenHandle = QGuiApplication::primaryScreen();
QRect screen = screenHandle ? screenHandle->geometry() : QRect(QPoint(), r.size());
move(screen.center() - r.center());
#else
move(QApplication::desktop()->screenGeometry().center() - r.center());
#endif
subscribeToCoreSignals();
}
+1
View File
@@ -8,6 +8,7 @@
#include <QColor>
#include <QPainter>
#include <QPainterPath>
#include <QTimer>
#include <cmath>
+2 -2
View File
@@ -254,14 +254,14 @@ QString TransactionDesc::toHTML(CWallet* wallet, CWalletTx& wtx, TransactionReco
strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>";
// Message from normal agrarian:URI (agrarian:XyZ...?message=example)
foreach (const PAIRTYPE(string, string) & r, wtx.vOrderForm)
for (const auto& r : wtx.vOrderForm)
if (r.first == "Message")
strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(r.second, true) + "<br>";
//
// PaymentRequest info:
//
foreach (const PAIRTYPE(string, string) & r, wtx.vOrderForm) {
for (const auto& r : wtx.vOrderForm) {
if (r.first == "PaymentRequest") {
PaymentRequestPlus req;
req.parse(QByteArray::fromRawData(r.second.data(), r.second.size()));
+1 -1
View File
@@ -217,7 +217,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet*
if (fAllToMe > mine) fAllToMe = mine;
}
if (fAllFromMeDenom && fAllToMeDenom && nFromMe * nToMe) {
if (fAllFromMeDenom && fAllToMeDenom && nFromMe && nToMe) {
parts.append(TransactionRecord(hash, nTime, TransactionRecord::ObfuscationDenominate, "", -nDebit, nCredit));
parts.last().involvesWatchAddress = false; // maybe pass to TransactionRecord as constructor argument
} else if (fAllFromMe && fAllToMe) {
+4 -2
View File
@@ -20,6 +20,8 @@
#include "util.h"
#include "wallet/wallet.h"
#include <algorithm>
#include <QColor>
#include <QDateTime>
#include <QDebug>
@@ -95,9 +97,9 @@ public:
qDebug() << "TransactionTablePriv::updateWallet : " + QString::fromStdString(hash.ToString()) + " " + QString::number(status);
// Find bounds of this transaction in model
QList<TransactionRecord>::iterator lower = qLowerBound(
QList<TransactionRecord>::iterator lower = std::lower_bound(
cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan());
QList<TransactionRecord>::iterator upper = qUpperBound(
QList<TransactionRecord>::iterator upper = std::upper_bound(
cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan());
int lowerIndex = (lower - cachedWallet.begin());
int upperIndex = (upper - cachedWallet.begin());
+10 -9
View File
@@ -33,6 +33,7 @@
#include <QSettings>
#include <QSignalMapper>
#include <QTableView>
#include <QTime>
#include <QUrl>
#include <QVBoxLayout>
@@ -230,7 +231,7 @@ void TransactionView::setModel(WalletModel* model)
if (model->getOptionsModel()) {
// Add third party transaction URLs to context menu
QStringList listUrls = model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts);
QStringList listUrls = model->getOptionsModel()->getThirdPartyTxUrls().split("|", Qt::SkipEmptyParts);
for (int i = 0; i < listUrls.size(); ++i) {
QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host();
if (!host.isEmpty()) {
@@ -275,30 +276,30 @@ void TransactionView::chooseDate(int idx)
break;
case Today:
transactionProxyModel->setDateRange(
QDateTime(current),
QDateTime(current, QTime(0, 0)),
TransactionFilterProxy::MAX_DATE);
break;
case ThisWeek: {
// Find last Monday
QDate startOfWeek = current.addDays(-(current.dayOfWeek() - 1));
transactionProxyModel->setDateRange(
QDateTime(startOfWeek),
QDateTime(startOfWeek, QTime(0, 0)),
TransactionFilterProxy::MAX_DATE);
} break;
case ThisMonth:
transactionProxyModel->setDateRange(
QDateTime(QDate(current.year(), current.month(), 1)),
QDateTime(QDate(current.year(), current.month(), 1), QTime(0, 0)),
TransactionFilterProxy::MAX_DATE);
break;
case LastMonth:
transactionProxyModel->setDateRange(
QDateTime(QDate(current.year(), current.month() - 1, 1)),
QDateTime(QDate(current.year(), current.month(), 1)));
QDateTime(QDate(current.year(), current.month() - 1, 1), QTime(0, 0)),
QDateTime(QDate(current.year(), current.month(), 1), QTime(0, 0)));
break;
case ThisYear:
transactionProxyModel->setDateRange(
QDateTime(QDate(current.year(), 1, 1)),
QDateTime(QDate(current.year(), 1, 1), QTime(0, 0)),
TransactionFilterProxy::MAX_DATE);
break;
case Range:
@@ -565,8 +566,8 @@ void TransactionView::dateRangeChanged()
if (!transactionProxyModel)
return;
transactionProxyModel->setDateRange(
QDateTime(dateFrom->date()),
QDateTime(dateTo->date()).addDays(1));
QDateTime(dateFrom->date(), QTime(0, 0)),
QDateTime(dateTo->date(), QTime(0, 0)).addDays(1));
}
void TransactionView::focusTransaction(const QModelIndex& idx)
+1 -1
View File
@@ -44,7 +44,7 @@ class ShutdownWindow : public QWidget
Q_OBJECT
public:
ShutdownWindow(QWidget* parent = 0, Qt::WindowFlags f = 0);
ShutdownWindow(QWidget* parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
static void showShutdownWindow(BitcoinGUI* window);
protected:
+2 -2
View File
@@ -769,8 +769,8 @@ void WalletModel::listZerocoinMints(std::set<CMintMeta>& setMints, bool fUnusedO
void WalletModel::loadReceiveRequests(std::vector<std::string>& vReceiveRequests)
{
LOCK(wallet->cs_wallet);
for (const PAIRTYPE(CTxDestination, CAddressBookData) & item : wallet->mapAddressBook)
for (const PAIRTYPE(std::string, std::string) & item2 : item.second.destdata)
for (const auto& item : wallet->mapAddressBook)
for (const auto& item2 : item.second.destdata)
if (item2.first.size() > 2 && item2.first.substr(0, 2) == "rr") // receive request
vReceiveRequests.push_back(item2.second);
}