From 98abdaa5d54daeb506acefeff901d8c4ba5c9eb6 Mon Sep 17 00:00:00 2001 From: xiphon Date: Sun, 16 Feb 2020 02:52:53 +0000 Subject: build: fix all warnings, treat warnings as errors --- src/qt/FutureScheduler.cpp | 2 +- src/qt/FutureScheduler.h | 14 +++----------- src/qt/KeysFiles.cpp | 14 ++------------ src/qt/KeysFiles.h | 7 ++----- 4 files changed, 8 insertions(+), 29 deletions(-) (limited to 'src/qt') diff --git a/src/qt/FutureScheduler.cpp b/src/qt/FutureScheduler.cpp index 17551c15..b15101e4 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) +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 776fb08c..ab9f323d 100644 --- a/src/qt/FutureScheduler.h +++ b/src/qt/FutureScheduler.h @@ -22,20 +22,12 @@ public: void shutdownWaitForFinished() noexcept; QPair> run(std::function function) noexcept; - QPair> run(std::function function, const QJSValue &callback); + QPair> run(std::function function, const QJSValue &callback); private: bool add() noexcept; void done() noexcept; - template - QFutureWatcher *newWatcher() - { - QFutureWatcher *watcher = new QFutureWatcher(); - - return watcher; - } - template QPair> execute(std::function(QFutureWatcher *)> makeFuture) noexcept { @@ -43,8 +35,8 @@ private: { try { - auto *watcher = newWatcher(); - connect(watcher, &QFutureWatcher::finished, [this, watcher] { + auto *watcher = new QFutureWatcher(); + connect(watcher, &QFutureWatcher::finished, [watcher] { watcher->deleteLater(); }); watcher->setFuture(makeFuture(watcher)); diff --git a/src/qt/KeysFiles.cpp b/src/qt/KeysFiles.cpp index 85697c6d..0d633439 100644 --- a/src/qt/KeysFiles.cpp +++ b/src/qt/KeysFiles.cpp @@ -43,8 +43,8 @@ #include "KeysFiles.h" -WalletKeysFiles::WalletKeysFiles(const qint64 &modified, const qint64 &created, const QString &path, const quint8 &networkType, const QString &address) - : m_modified(modified), m_created(created), m_path(path), m_networkType(networkType), m_address(address) +WalletKeysFiles::WalletKeysFiles(const qint64 &modified, const QString &path, const quint8 &networkType, const QString &address) + : m_modified(modified), m_path(path), m_networkType(networkType), m_address(address) { } @@ -58,11 +58,6 @@ QString WalletKeysFiles::address() const return m_address; } -qint64 WalletKeysFiles::created() const -{ - return m_created; -} - QString WalletKeysFiles::path() const { return m_path; @@ -134,10 +129,8 @@ void WalletKeysFilesModel::findWallets(const QString &moneroAccountsDir) const QFileInfo info(wallet); const QDateTime modifiedAt = info.lastModified(); - const QDateTime createdAt = info.created(); // @TODO: QFileInfo::birthTime() >= Qt 5.10 this->addWalletKeysFile(WalletKeysFiles(modifiedAt.toSecsSinceEpoch(), - createdAt.toSecsSinceEpoch(), info.absoluteFilePath(), networkType, address)); } } @@ -167,8 +160,6 @@ QVariant WalletKeysFilesModel::data(const QModelIndex & index, int role) const { return walletKeyFile.networkType(); else if (role == AddressRole) return walletKeyFile.address(); - else if (role == CreatedRole) - return walletKeyFile.created(); return QVariant(); } @@ -178,6 +169,5 @@ QHash WalletKeysFilesModel::roleNames() const { roles[PathRole] = "path"; roles[NetworkTypeRole] = "networktype"; roles[AddressRole] = "address"; - roles[CreatedRole] = "created"; return roles; } diff --git a/src/qt/KeysFiles.h b/src/qt/KeysFiles.h index afdc0216..6a9339e3 100644 --- a/src/qt/KeysFiles.h +++ b/src/qt/KeysFiles.h @@ -37,17 +37,15 @@ class WalletKeysFiles { public: - WalletKeysFiles(const qint64 &modified, const qint64 &created, const QString &path, const quint8 &networkType, const QString &address); + WalletKeysFiles(const qint64 &modified, const QString &path, const quint8 &networkType, const QString &address); qint64 modified() const; - qint64 created() const; QString path() const; quint8 networkType() const; QString address() const; private: qint64 m_modified; - qint64 m_created; QString m_path; quint8 m_networkType; QString m_address; @@ -61,8 +59,7 @@ public: ModifiedRole = Qt::UserRole + 1, PathRole, NetworkTypeRole, - AddressRole, - CreatedRole + AddressRole }; WalletKeysFilesModel(WalletManager *walletManager, QObject *parent = 0); -- cgit v1.2.3