Skip to content

Commit 2b12268

Browse files
committed
Merge #14854: qt: Cleanup SplashScreen class
7d1b60c Cleanup SplashScreen class (Hennadii Stepanov) Pull request description: Cleaning up after replacing the `QSplashScreen` base class with the `QWidget` class (#4941 by @laanwj). cc @jonasschnelli Tree-SHA512: 72e2d67905d85247a11ae6a884f74f710f765adf20db7d1daf0927e6990687e836b486c4ff93bc6dabc3759ed667acfe1d69c8b94fae7181ab271a3fa7a0229a
2 parents b8b0b8c + 7d1b60c commit 2b12268

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

src/qt/bitcoin.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public Q_SLOTS:
212212
void requestedInitialize();
213213
void requestedShutdown();
214214
void stopThread();
215-
void splashFinished(QWidget *window);
215+
void splashFinished();
216216

217217
private:
218218
QThread *coreThread;
@@ -352,9 +352,9 @@ void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle)
352352
{
353353
SplashScreen *splash = new SplashScreen(m_node, 0, networkStyle);
354354
// We don't hold a direct pointer to the splash screen after creation, but the splash
355-
// screen will take care of deleting itself when slotFinish happens.
355+
// screen will take care of deleting itself when finish() happens.
356356
splash->show();
357-
connect(this, &BitcoinApplication::splashFinished, splash, &SplashScreen::slotFinish);
357+
connect(this, &BitcoinApplication::splashFinished, splash, &SplashScreen::finish);
358358
connect(this, &BitcoinApplication::requestedShutdown, splash, &QWidget::close);
359359
}
360360

@@ -495,7 +495,7 @@ void BitcoinApplication::initializeResult(bool success)
495495
{
496496
window->show();
497497
}
498-
Q_EMIT splashFinished(window);
498+
Q_EMIT splashFinished();
499499

500500
#ifdef ENABLE_WALLET
501501
// Now that initialization/startup is done, process any command-line
@@ -509,7 +509,7 @@ void BitcoinApplication::initializeResult(bool success)
509509
#endif
510510
pollShutdownTimer->start(200);
511511
} else {
512-
Q_EMIT splashFinished(window); // Make sure splash screen doesn't stick around during shutdown
512+
Q_EMIT splashFinished(); // Make sure splash screen doesn't stick around during shutdown
513513
quit(); // Exit first main loop invocation
514514
}
515515
}

src/qt/splashscreen.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,8 @@ bool SplashScreen::eventFilter(QObject * obj, QEvent * ev) {
145145
return QObject::eventFilter(obj, ev);
146146
}
147147

148-
void SplashScreen::slotFinish(QWidget *mainWin)
148+
void SplashScreen::finish()
149149
{
150-
Q_UNUSED(mainWin);
151-
152150
/* If the window is minimized, hide() will be ignored. */
153151
/* Make sure we de-minimize the splashscreen window before hiding */
154152
if (isMinimized())

src/qt/splashscreen.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
#ifndef BITCOIN_QT_SPLASHSCREEN_H
66
#define BITCOIN_QT_SPLASHSCREEN_H
77

8-
#include <functional>
9-
#include <QSplashScreen>
8+
#include <QWidget>
109

1110
#include <memory>
1211

@@ -37,8 +36,8 @@ class SplashScreen : public QWidget
3736
void closeEvent(QCloseEvent *event);
3837

3938
public Q_SLOTS:
40-
/** Slot to call finish() method as it's not defined as slot */
41-
void slotFinish(QWidget *mainWin);
39+
/** Hide the splash screen window and schedule the splash screen object for deletion */
40+
void finish();
4241

4342
/** Show message and progress */
4443
void showMessage(const QString &message, int alignment, const QColor &color);

0 commit comments

Comments
 (0)