From 3a33ddeecdea52bbf35549ffb0d4904eba1ebff6 Mon Sep 17 00:00:00 2001 From: xiphon Date: Wed, 28 Aug 2019 16:21:53 +0000 Subject: [PATCH] fix invalid include paths, compilation warnings, update README.md --- README.md | 2 -- src/libwalletqt/UnsignedTransaction.cpp | 6 +++--- src/libwalletqt/UnsignedTransaction.h | 6 +++--- src/libwalletqt/Wallet.cpp | 8 ++++---- src/libwalletqt/Wallet.h | 4 ++-- src/model/AddressBookModel.cpp | 2 +- src/model/SubaddressAccountModel.cpp | 2 +- src/model/SubaddressModel.cpp | 2 +- src/qt/FutureScheduler.cpp | 2 +- src/qt/FutureScheduler.h | 6 +++--- src/qt/KeysFiles.cpp | 6 +++--- src/qt/KeysFiles.h | 4 ++-- src/qt/MoneroSettings.cpp | 2 +- src/qt/utils.cpp | 2 +- 14 files changed, 26 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 557234a1..05ad630d 100644 --- a/README.md +++ b/README.md @@ -237,8 +237,6 @@ The Monero GUI on Windows is 64 bits only; 32-bit Windows GUI builds are not off git clone https://github.com/monero-project/monero-gui.git ``` - **Note:** Due to some bug in the build process, "monero-gui" repo can't be a top level directory. - 7. Build ``` diff --git a/src/libwalletqt/UnsignedTransaction.cpp b/src/libwalletqt/UnsignedTransaction.cpp index 77e2614d..99b7740d 100644 --- a/src/libwalletqt/UnsignedTransaction.cpp +++ b/src/libwalletqt/UnsignedTransaction.cpp @@ -40,7 +40,7 @@ QString UnsignedTransaction::errorString() const return QString::fromStdString(m_pimpl->errorString()); } -quint64 UnsignedTransaction::amount(int index) const +quint64 UnsignedTransaction::amount(size_t index) const { std::vector arr = m_pimpl->amount(); if(index > arr.size() - 1) @@ -48,7 +48,7 @@ quint64 UnsignedTransaction::amount(int index) const return arr[index]; } -quint64 UnsignedTransaction::fee(int index) const +quint64 UnsignedTransaction::fee(size_t index) const { std::vector arr = m_pimpl->fee(); if(index > arr.size() - 1) @@ -56,7 +56,7 @@ quint64 UnsignedTransaction::fee(int index) const return arr[index]; } -quint64 UnsignedTransaction::mixin(int index) const +quint64 UnsignedTransaction::mixin(size_t index) const { std::vector arr = m_pimpl->mixin(); if(index > arr.size() - 1) diff --git a/src/libwalletqt/UnsignedTransaction.h b/src/libwalletqt/UnsignedTransaction.h index 5b54e299..f679f9a9 100644 --- a/src/libwalletqt/UnsignedTransaction.h +++ b/src/libwalletqt/UnsignedTransaction.h @@ -56,9 +56,9 @@ public: Status status() const; QString errorString() const; - Q_INVOKABLE quint64 amount(int index) const; - Q_INVOKABLE quint64 fee(int index) const; - Q_INVOKABLE quint64 mixin(int index) const; + Q_INVOKABLE quint64 amount(size_t index) const; + Q_INVOKABLE quint64 fee(size_t index) const; + Q_INVOKABLE quint64 mixin(size_t index) const; QStringList recipientAddress() const; QStringList paymentId() const; quint64 txCount() const; diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 592559e2..5b0f0719 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -963,16 +963,16 @@ Wallet::Wallet(Monero::Wallet *w, QObject *parent) , m_historyModel(nullptr) , m_addressBook(nullptr) , m_addressBookModel(nullptr) - , m_subaddress(nullptr) - , m_subaddressModel(nullptr) - , m_subaddressAccount(nullptr) - , m_subaddressAccountModel(nullptr) , m_daemonBlockChainHeight(0) , m_daemonBlockChainHeightTtl(DAEMON_BLOCKCHAIN_HEIGHT_CACHE_TTL_SECONDS) , m_daemonBlockChainTargetHeight(0) , m_daemonBlockChainTargetHeightTtl(DAEMON_BLOCKCHAIN_TARGET_HEIGHT_CACHE_TTL_SECONDS) , m_connectionStatusTtl(WALLET_CONNECTION_STATUS_CACHE_TTL_SECONDS) , m_currentSubaddressAccount(0) + , m_subaddress(nullptr) + , m_subaddressModel(nullptr) + , m_subaddressAccount(nullptr) + , m_subaddressAccountModel(nullptr) , m_scheduler(this) { m_history = new TransactionHistory(m_walletImpl->history(), this); diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 4d60b060..fb2dc3f8 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -395,6 +395,8 @@ private: mutable TransactionHistoryModel * m_historyModel; mutable TransactionHistorySortFilterModel * m_historySortFilterModel; QString m_paymentId; + AddressBook * m_addressBook; + mutable AddressBookModel * m_addressBookModel; mutable QTime m_daemonBlockChainHeightTime; mutable quint64 m_daemonBlockChainHeight; int m_daemonBlockChainHeightTtl; @@ -406,8 +408,6 @@ private: mutable QTime m_connectionStatusTime; mutable bool m_initialized; uint32_t m_currentSubaddressAccount; - AddressBook * m_addressBook; - mutable AddressBookModel * m_addressBookModel; Subaddress * m_subaddress; mutable SubaddressModel * m_subaddressModel; SubaddressAccount * m_subaddressAccount; diff --git a/src/model/AddressBookModel.cpp b/src/model/AddressBookModel.cpp index 72bcf950..5c00ad6f 100644 --- a/src/model/AddressBookModel.cpp +++ b/src/model/AddressBookModel.cpp @@ -50,7 +50,7 @@ void AddressBookModel::endReset(){ endResetModel(); } -int AddressBookModel::rowCount(const QModelIndex &parent) const +int AddressBookModel::rowCount(const QModelIndex &) const { return m_addressBook->count(); } diff --git a/src/model/SubaddressAccountModel.cpp b/src/model/SubaddressAccountModel.cpp index 6fabaa44..b8258296 100644 --- a/src/model/SubaddressAccountModel.cpp +++ b/src/model/SubaddressAccountModel.cpp @@ -49,7 +49,7 @@ void SubaddressAccountModel::endReset(){ endResetModel(); } -int SubaddressAccountModel::rowCount(const QModelIndex &parent) const +int SubaddressAccountModel::rowCount(const QModelIndex &) const { return m_subaddressAccount->count(); } diff --git a/src/model/SubaddressModel.cpp b/src/model/SubaddressModel.cpp index b3150d83..3b56923e 100644 --- a/src/model/SubaddressModel.cpp +++ b/src/model/SubaddressModel.cpp @@ -50,7 +50,7 @@ void SubaddressModel::endReset(){ endResetModel(); } -int SubaddressModel::rowCount(const QModelIndex &parent) const +int SubaddressModel::rowCount(const QModelIndex &) const { return m_subaddress->count(); } diff --git a/src/qt/FutureScheduler.cpp b/src/qt/FutureScheduler.cpp index bdd47829..17551c15 100644 --- a/src/qt/FutureScheduler.cpp +++ b/src/qt/FutureScheduler.cpp @@ -38,7 +38,7 @@ QPair> FutureScheduler::run(std::function function) }); } -QPair> FutureScheduler::run(std::function function, const QJSValue &callback) noexcept +QPair> FutureScheduler::run(std::function function, const QJSValue &callback) { if (!callback.isCallable()) { diff --git a/src/qt/FutureScheduler.h b/src/qt/FutureScheduler.h index 28c2dfdf..e76021c3 100644 --- a/src/qt/FutureScheduler.h +++ b/src/qt/FutureScheduler.h @@ -20,9 +20,9 @@ public: ~FutureScheduler(); void shutdownWaitForFinished() noexcept; - + QPair> run(std::function function) noexcept; - QPair> run(std::function function, const QJSValue &callback) noexcept; + QPair> run(std::function function, const QJSValue &callback); private: bool add() noexcept; @@ -38,7 +38,7 @@ private: watcher->moveToThread(schedulerThread); } watcher->setParent(this); - + return watcher; } diff --git a/src/qt/KeysFiles.cpp b/src/qt/KeysFiles.cpp index 55820c77..85697c6d 100644 --- a/src/qt/KeysFiles.cpp +++ b/src/qt/KeysFiles.cpp @@ -36,9 +36,9 @@ #include #include #include -#include "src/libwalletqt/WalletManager.h" -#include "src/NetworkType.h" -#include "src/qt/utils.h" +#include "libwalletqt/WalletManager.h" +#include "NetworkType.h" +#include "qt/utils.h" #include "KeysFiles.h" diff --git a/src/qt/KeysFiles.h b/src/qt/KeysFiles.h index 78348b2d..afdc0216 100644 --- a/src/qt/KeysFiles.h +++ b/src/qt/KeysFiles.h @@ -30,8 +30,8 @@ #define KEYSFILES_H #include -#include "src/libwalletqt/WalletManager.h" -#include "src/NetworkType.h" +#include "libwalletqt/WalletManager.h" +#include "NetworkType.h" #include class WalletKeysFiles diff --git a/src/qt/MoneroSettings.cpp b/src/qt/MoneroSettings.cpp index 1de786a6..409f010c 100644 --- a/src/qt/MoneroSettings.cpp +++ b/src/qt/MoneroSettings.cpp @@ -40,7 +40,7 @@ #include #include -#include "src/qt/MoneroSettings.h" +#include "qt/MoneroSettings.h" /*! \qmlmodule moneroSettings 1.0 diff --git a/src/qt/utils.cpp b/src/qt/utils.cpp index 4418a050..35b5a835 100644 --- a/src/qt/utils.cpp +++ b/src/qt/utils.cpp @@ -29,7 +29,7 @@ #include #include -#include "src/qt/TailsOS.h" +#include "TailsOS.h" #include "utils.h" bool fileExists(QString path) {