mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
qt, refactor: Fix code styling of moved InitExecutor class
This commit is contained in:
parent
c82165a557
commit
8169fc4e73
2 changed files with 8 additions and 10 deletions
|
@ -15,8 +15,8 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
InitExecutor::InitExecutor(interfaces::Node& node) :
|
InitExecutor::InitExecutor(interfaces::Node& node)
|
||||||
QObject(), m_node(node)
|
: QObject(), m_node(node)
|
||||||
{
|
{
|
||||||
this->moveToThread(&m_thread);
|
this->moveToThread(&m_thread);
|
||||||
m_thread.start();
|
m_thread.start();
|
||||||
|
@ -30,7 +30,7 @@ InitExecutor::~InitExecutor()
|
||||||
qDebug() << __func__ << ": Stopped thread";
|
qDebug() << __func__ << ": Stopped thread";
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitExecutor::handleRunawayException(const std::exception *e)
|
void InitExecutor::handleRunawayException(const std::exception* e)
|
||||||
{
|
{
|
||||||
PrintExceptionContinue(e, "Runaway exception");
|
PrintExceptionContinue(e, "Runaway exception");
|
||||||
Q_EMIT runawayException(QString::fromStdString(m_node.getWarnings().translated));
|
Q_EMIT runawayException(QString::fromStdString(m_node.getWarnings().translated));
|
||||||
|
@ -38,8 +38,7 @@ void InitExecutor::handleRunawayException(const std::exception *e)
|
||||||
|
|
||||||
void InitExecutor::initialize()
|
void InitExecutor::initialize()
|
||||||
{
|
{
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
util::ThreadRename("qt-init");
|
util::ThreadRename("qt-init");
|
||||||
qDebug() << __func__ << ": Running initialization in thread";
|
qDebug() << __func__ << ": Running initialization in thread";
|
||||||
interfaces::BlockAndHeaderTipInfo tip_info;
|
interfaces::BlockAndHeaderTipInfo tip_info;
|
||||||
|
@ -54,8 +53,7 @@ void InitExecutor::initialize()
|
||||||
|
|
||||||
void InitExecutor::shutdown()
|
void InitExecutor::shutdown()
|
||||||
{
|
{
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
qDebug() << __func__ << ": Running Shutdown in thread";
|
qDebug() << __func__ << ": Running Shutdown in thread";
|
||||||
m_node.appShutdown();
|
m_node.appShutdown();
|
||||||
qDebug() << __func__ << ": Shutdown finished";
|
qDebug() << __func__ << ": Shutdown finished";
|
||||||
|
|
|
@ -19,7 +19,7 @@ QT_END_NAMESPACE
|
||||||
/** Class encapsulating Bitcoin Core startup and shutdown.
|
/** Class encapsulating Bitcoin Core startup and shutdown.
|
||||||
* Allows running startup and shutdown in a different thread from the UI thread.
|
* Allows running startup and shutdown in a different thread from the UI thread.
|
||||||
*/
|
*/
|
||||||
class InitExecutor: public QObject
|
class InitExecutor : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -33,11 +33,11 @@ public Q_SLOTS:
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info);
|
void initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info);
|
||||||
void shutdownResult();
|
void shutdownResult();
|
||||||
void runawayException(const QString &message);
|
void runawayException(const QString& message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Pass fatal exception message to UI thread
|
/// Pass fatal exception message to UI thread
|
||||||
void handleRunawayException(const std::exception *e);
|
void handleRunawayException(const std::exception* e);
|
||||||
|
|
||||||
interfaces::Node& m_node;
|
interfaces::Node& m_node;
|
||||||
QThread m_thread;
|
QThread m_thread;
|
||||||
|
|
Loading…
Add table
Reference in a new issue