Skip to content

Commit f3bdc14

Browse files
committed
refactor, qt: Add SHUTDOWN_POLLING_DELAY constant
A named constant is better for the code readability. Also it could be reused in an alternative GUI implementation (e.g., QML-based).
1 parent 0e193de commit f3bdc14

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/qt/bitcoin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHead
414414
QTimer::singleShot(100ms, paymentServer, &PaymentServer::uiReady);
415415
}
416416
#endif
417-
pollShutdownTimer->start(200ms);
417+
pollShutdownTimer->start(SHUTDOWN_POLLING_DELAY);
418418
} else {
419419
Q_EMIT splashFinished(); // Make sure splash screen doesn't stick around during shutdown
420420
requestShutdown();

src/qt/guiconstants.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ using namespace std::chrono_literals;
1313
/* A delay between model updates */
1414
static constexpr auto MODEL_UPDATE_DELAY{250ms};
1515

16+
/* A delay between shutdown pollings */
17+
static constexpr auto SHUTDOWN_POLLING_DELAY{200ms};
18+
1619
/* AskPassphraseDialog -- Maximum passphrase length */
1720
static const int MAX_PASSPHRASE_SIZE = 1024;
1821

0 commit comments

Comments
 (0)