Skip to content

Commit 7d1b60c

Browse files
committed
Cleanup SplashScreen class
Cleaning up after replacing the QSplashScreen base class with the QWidget class.
1 parent ed12fd8 commit 7d1b60c

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
@@ -217,7 +217,7 @@ public Q_SLOTS:
217217
void requestedInitialize();
218218
void requestedShutdown();
219219
void stopThread();
220-
void splashFinished(QWidget *window);
220+
void splashFinished();
221221

222222
private:
223223
QThread *coreThread;
@@ -357,9 +357,9 @@ void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle)
357357
{
358358
SplashScreen *splash = new SplashScreen(m_node, 0, networkStyle);
359359
// We don't hold a direct pointer to the splash screen after creation, but the splash
360-
// screen will take care of deleting itself when slotFinish happens.
360+
// screen will take care of deleting itself when finish() happens.
361361
splash->show();
362-
connect(this, &BitcoinApplication::splashFinished, splash, &SplashScreen::slotFinish);
362+
connect(this, &BitcoinApplication::splashFinished, splash, &SplashScreen::finish);
363363
connect(this, &BitcoinApplication::requestedShutdown, splash, &QWidget::close);
364364
}
365365

@@ -500,7 +500,7 @@ void BitcoinApplication::initializeResult(bool success)
500500
{
501501
window->show();
502502
}
503-
Q_EMIT splashFinished(window);
503+
Q_EMIT splashFinished();
504504

505505
#ifdef ENABLE_WALLET
506506
// Now that initialization/startup is done, process any command-line
@@ -514,7 +514,7 @@ void BitcoinApplication::initializeResult(bool success)
514514
#endif
515515
pollShutdownTimer->start(200);
516516
} else {
517-
Q_EMIT splashFinished(window); // Make sure splash screen doesn't stick around during shutdown
517+
Q_EMIT splashFinished(); // Make sure splash screen doesn't stick around during shutdown
518518
quit(); // Exit first main loop invocation
519519
}
520520
}

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)