Skip to content

Commit 06d519f

Browse files
committed
qt: Add SynchronizationState enum to signal parameter
1 parent 3c709aa commit 06d519f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/qt/bitcoin.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <uint256.h>
3535
#include <util/system.h>
3636
#include <util/threadnames.h>
37+
#include <validation.h>
3738

3839
#include <memory>
3940

@@ -61,6 +62,7 @@ Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
6162
// Declare meta types used for QMetaObject::invokeMethod
6263
Q_DECLARE_METATYPE(bool*)
6364
Q_DECLARE_METATYPE(CAmount)
65+
Q_DECLARE_METATYPE(SynchronizationState)
6466
Q_DECLARE_METATYPE(uint256)
6567

6668
static QString GetLangTerritory()
@@ -435,6 +437,7 @@ int GuiMain(int argc, char* argv[])
435437

436438
// Register meta types used for QMetaObject::invokeMethod and Qt::QueuedConnection
437439
qRegisterMetaType<bool*>();
440+
qRegisterMetaType<SynchronizationState>();
438441
#ifdef ENABLE_WALLET
439442
qRegisterMetaType<WalletModel*>();
440443
#endif

src/qt/clientmodel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ static void BlockTipChanged(ClientModel* clientmodel, SynchronizationState sync_
257257
Q_ARG(int, height),
258258
Q_ARG(QDateTime, QDateTime::fromTime_t(blockTime)),
259259
Q_ARG(double, verificationProgress),
260-
Q_ARG(bool, fHeader));
260+
Q_ARG(bool, fHeader),
261+
Q_ARG(SynchronizationState, sync_state));
261262
assert(invoked);
262263
nLastUpdateNotification = now;
263264
}

src/qt/clientmodel.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
#include <memory>
1313

1414
class BanTableModel;
15+
class CBlockIndex;
1516
class OptionsModel;
1617
class PeerTableModel;
17-
18-
class CBlockIndex;
18+
enum class SynchronizationState;
1919

2020
namespace interfaces {
2121
class Handler;
@@ -100,7 +100,7 @@ class ClientModel : public QObject
100100

101101
Q_SIGNALS:
102102
void numConnectionsChanged(int count);
103-
void numBlocksChanged(int count, const QDateTime& blockDate, double nVerificationProgress, bool header);
103+
void numBlocksChanged(int count, const QDateTime& blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state);
104104
void mempoolSizeChanged(long count, size_t mempoolSizeInBytes);
105105
void networkActiveChanged(bool networkActive);
106106
void alertsChanged(const QString &warnings);

0 commit comments

Comments
 (0)