diff --git a/startkde/plasma-session/startup.cpp b/startkde/plasma-session/startup.cpp index c79e63b91..32dcfccc2 100644 --- a/startkde/plasma-session/startup.cpp +++ b/startkde/plasma-session/startup.cpp @@ -150,8 +150,6 @@ class NotificationThread : public QThread { Q_OBJECT void run() override { - // Prevent application exit until the thread (and hence the sound) completes - QEventLoopLocker(this); // We cannot parent to the thread itself so let's create // a QObject on the stack and parent everythign to it QObject parent; @@ -196,6 +194,9 @@ class NotificationThread : public QThread m->play(); exec(); } +private: + // Prevent application exit until the thread (and hence the sound) completes + QEventLoopLocker m_locker; }; @@ -261,6 +262,8 @@ Startup::Startup(QObject *parent): connect(sequence.last(), &KJob::finished, this, &Startup::finishStartup); sequence.first()->start(); + + // app will be closed when all KJobs finish thanks to the QEventLoopLocker in each KJob } void Startup::upAndRunning( const QString& msg ) @@ -277,7 +280,6 @@ void Startup::finishStartup() { qCDebug(PLASMA_SESSION) << "Finished"; upAndRunning(QStringLiteral("ready")); - qApp->quit(); } void Startup::updateLaunchEnv(const QString &key, const QString &value)