[kde-workspace] ksplash/ksplashqml: [ksplash] Make KPlashQML stages ready to be run asynchronously

Àlex Fiestas afiestas at kde.org
Tue Dec 17 18:18:08 UTC 2013


Git commit c1d668f167a9bd3ac4db1475564dea49e8f7adac by Àlex Fiestas.
Committed on 17/12/2013 at 18:12.
Pushed by afiestas into branch 'master'.

[ksplash] Make KPlashQML stages ready to be run asynchronously

Since we ported to DBus we are using ASync calls to send the
QDBusMessages that indicate to KSplash that a new stage has happened.
Since we are using an async method we can't take into account the order
anymore.

I tried changing all calls to be sync and then KSplash works correctly
which shows that we are starting the session correctly but it is better
if we keep these calls async because you know, the future is async.

CCMAIL: plasma-devel at kde.org

M  +5    -14   ksplash/ksplashqml/SplashApp.cpp
M  +1    -0    ksplash/ksplashqml/SplashApp.h

http://commits.kde.org/kde-workspace/c1d668f167a9bd3ac4db1475564dea49e8f7adac

diff --git a/ksplash/ksplashqml/SplashApp.cpp b/ksplash/ksplashqml/SplashApp.cpp
index 20bde13..893bf1b 100644
--- a/ksplash/ksplashqml/SplashApp.cpp
+++ b/ksplash/ksplashqml/SplashApp.cpp
@@ -74,20 +74,11 @@ void SplashApp::timerEvent(QTimerEvent * event)
 
 void SplashApp::setStage(const QString &stage)
 {
-    if (stage == QLatin1String("initial") && m_stage < 0)
-        setStage(0); // not actually used
-    else if (stage == QLatin1String("kded") && m_stage < 1)
-        setStage(1);
-    else if (stage == QLatin1String("confupdate") && m_stage < 2)
-        setStage(2);
-    else if (stage == QLatin1String("kcminit") && m_stage < 3)
-        setStage(3);
-    else if (stage == QLatin1String("ksmserver") && m_stage < 4)
-        setStage(4);
-    else if (stage == QLatin1String("wm") && m_stage < 5)
-        setStage(5);
-    else if (stage == QLatin1String("desktop") && m_stage < 6)
-        setStage(6);
+    if (m_stages.contains(stage)) {
+        return;
+    }
+    m_stages.append(stage);
+    setStage(m_stages.count());
 }
 
 void SplashApp::setStage(int stage)
diff --git a/ksplash/ksplashqml/SplashApp.h b/ksplash/ksplashqml/SplashApp.h
index 3ba3147..e720998 100644
--- a/ksplash/ksplashqml/SplashApp.h
+++ b/ksplash/ksplashqml/SplashApp.h
@@ -47,6 +47,7 @@ private:
     int m_stage;
     QList<SplashWindow *> m_windows;
     bool m_testing;
+    QStringList m_stages;
     QBasicTimer m_timer;
     QDesktopWidget *m_desktop;
 


More information about the Plasma-devel mailing list