Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletcontroller.cpp
// Copyright (c) 2019 The Bitcoin Core developers | // Copyright (c) 2019 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <qt/walletcontroller.h> | #include <qt/walletcontroller.h> | ||||
#include <qt/askpassphrasedialog.h> | #include <qt/askpassphrasedialog.h> | ||||
#include <qt/clientmodel.h> | #include <qt/clientmodel.h> | ||||
#include <qt/createwalletdialog.h> | #include <qt/createwalletdialog.h> | ||||
#include <qt/guiconstants.h> | #include <qt/guiconstants.h> | ||||
#include <qt/guiutil.h> | #include <qt/guiutil.h> | ||||
#include <interfaces/handler.h> | #include <interfaces/handler.h> | ||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <util/string.h> | #include <util/string.h> | ||||
#include <util/threadnames.h> | |||||
#include <util/translation.h> | #include <util/translation.h> | ||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#include <QApplication> | #include <QApplication> | ||||
#include <QMutexLocker> | #include <QMutexLocker> | ||||
#include <QTimer> | #include <QTimer> | ||||
#include <QWindow> | #include <QWindow> | ||||
Show All 13 Lines | WalletController::WalletController(ClientModel &client_model, | ||||
for (std::unique_ptr<interfaces::Wallet> &wallet : | for (std::unique_ptr<interfaces::Wallet> &wallet : | ||||
m_node.walletClient().getWallets()) { | m_node.walletClient().getWallets()) { | ||||
getOrCreateWallet(std::move(wallet)); | getOrCreateWallet(std::move(wallet)); | ||||
} | } | ||||
m_activity_worker->moveToThread(m_activity_thread); | m_activity_worker->moveToThread(m_activity_thread); | ||||
m_activity_thread->start(); | m_activity_thread->start(); | ||||
QTimer::singleShot(0, m_activity_worker, | |||||
[]() { util::ThreadRename("qt-walletctrl"); }); | |||||
} | } | ||||
// Not using the default destructor because not all member types definitions are | // Not using the default destructor because not all member types definitions are | ||||
// available in the header, just forward declared. | // available in the header, just forward declared. | ||||
WalletController::~WalletController() { | WalletController::~WalletController() { | ||||
m_activity_thread->quit(); | m_activity_thread->quit(); | ||||
m_activity_thread->wait(); | m_activity_thread->wait(); | ||||
delete m_activity_worker; | delete m_activity_worker; | ||||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |