From 8a8a9554e9c37a2e3892fc155eb4ce6735454897 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 13 Mar 2013 13:30:37 +0100 Subject: [PATCH] execute the update scripts, if any --- src/shell/desktopcorona.cpp | 8 ++++++++ src/shell/desktopcorona.h | 5 +++++ src/shell/main.cpp | 1 + 3 files changed, 14 insertions(+) diff --git a/src/shell/desktopcorona.cpp b/src/shell/desktopcorona.cpp index 36970eab5..890f31061 100644 --- a/src/shell/desktopcorona.cpp +++ b/src/shell/desktopcorona.cpp @@ -73,6 +73,14 @@ void DesktopCorona::loadDefaultLayout() } } +void DesktopCorona::processUpdateScripts() +{ + foreach (const QString &script, WorkspaceScripting::ScriptEngine::pendingUpdateScripts()) { + WorkspaceScripting::DesktopScriptEngine scriptEngine(this, false); + scriptEngine.evaluateScript(script); + } +} + void DesktopCorona::checkScreens(bool signalWhenExists) { // quick sanity check to ensure we have containments for each screen diff --git a/src/shell/desktopcorona.h b/src/shell/desktopcorona.h index aec8c8c53..2fd700345 100644 --- a/src/shell/desktopcorona.h +++ b/src/shell/desktopcorona.h @@ -46,6 +46,11 @@ public: **/ void loadDefaultLayout(); + /** + * Execute any update script + */ + void processUpdateScripts(); + /** * Ensures we have the necessary containments for every screen */ diff --git a/src/shell/main.cpp b/src/shell/main.cpp index 7eb83a891..6179e4b52 100644 --- a/src/shell/main.cpp +++ b/src/shell/main.cpp @@ -56,6 +56,7 @@ int main(int argc, char** argv) if (corona->containments().isEmpty()) { corona->loadDefaultLayout(); } + corona->processUpdateScripts(); corona->checkScreens(); return app.exec();