From 0564b83ddb1cf3d0d81b40bf7b6758e3c0356dc3 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 16 Jan 2015 21:13:30 +0000 Subject: [PATCH] plasma: fixup and cleanup the default layout is done via the scripting support, that's just a no go. plasma-default-layoutrc is possible simpler solution with for the madness that the default plasma settings are done on initial setup but it most likely some features will have to be extended, especially the containment size option. hardcoding panel and default view to always be available by setting virtual desktops and other misc settings accordingly seems better but that will probably break more code thus avoiding it for now --- libs/plasmagenericshell/scripting/scriptengine.cpp | 6 ++++++ libs/plasmagenericshell/scripting/scriptengine.h | 1 + plasma/desktop/shell/CMakeLists.txt | 2 -- plasma/desktop/shell/configupdates/CMakeLists.txt | 0 plasma/desktop/shell/data/layouts/00-defaultLayout.js | 1 - plasma/desktop/shell/main.cpp | 2 +- .../javascript/plasmoid/simplejavascriptapplet.cpp | 6 ------ 7 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 plasma/desktop/shell/configupdates/CMakeLists.txt diff --git a/libs/plasmagenericshell/scripting/scriptengine.cpp b/libs/plasmagenericshell/scripting/scriptengine.cpp index db7f6a0e..05747047 100644 --- a/libs/plasmagenericshell/scripting/scriptengine.cpp +++ b/libs/plasmagenericshell/scripting/scriptengine.cpp @@ -74,6 +74,11 @@ ScriptEngine::~ScriptEngine() { } +QScriptValue ScriptEngine::newActivity(QScriptContext *context, QScriptEngine *engine) +{ + return createContainment("desktop", "desktop", context, engine); +} + QScriptValue ScriptEngine::newPanel(QScriptContext *context, QScriptEngine *engine) { return createContainment("panel", "panel", context, engine); @@ -564,6 +569,7 @@ void ScriptEngine::setupEngine() } m_scriptSelf.setProperty("QRectF", constructQRectFClass(this)); + m_scriptSelf.setProperty("Activity", newFunction(ScriptEngine::newActivity)); m_scriptSelf.setProperty("Panel", newFunction(ScriptEngine::newPanel)); m_scriptSelf.setProperty("panelById", newFunction(ScriptEngine::panelById)); m_scriptSelf.setProperty("panels", newFunction(ScriptEngine::panels)); diff --git a/libs/plasmagenericshell/scripting/scriptengine.h b/libs/plasmagenericshell/scripting/scriptengine.h index 4294505f..56d7a62a 100644 --- a/libs/plasmagenericshell/scripting/scriptengine.h +++ b/libs/plasmagenericshell/scripting/scriptengine.h @@ -69,6 +69,7 @@ private: // containment accessors static QStringList availableContainments(const QString &type); + static QScriptValue newActivity(QScriptContext *context, QScriptEngine *engine); static QScriptValue newPanel(QScriptContext *context, QScriptEngine *engine); static QScriptValue panelById(QScriptContext *context, QScriptEngine *engine); static QScriptValue panels(QScriptContext *context, QScriptEngine *engine); diff --git a/plasma/desktop/shell/CMakeLists.txt b/plasma/desktop/shell/CMakeLists.txt index 00724e96..013ace79 100644 --- a/plasma/desktop/shell/CMakeLists.txt +++ b/plasma/desktop/shell/CMakeLists.txt @@ -4,8 +4,6 @@ include_directories(${KDEBASE_WORKSPACE_SOURCE_DIR}/libs ${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/kephal ) -add_subdirectory(configupdates) - set(plasma_SRCS accessibility/accessiblefactory.cpp accessibility/accessibleplasmaview.cpp diff --git a/plasma/desktop/shell/configupdates/CMakeLists.txt b/plasma/desktop/shell/configupdates/CMakeLists.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/plasma/desktop/shell/data/layouts/00-defaultLayout.js b/plasma/desktop/shell/data/layouts/00-defaultLayout.js index a6a04258..305bfe05 100644 --- a/plasma/desktop/shell/data/layouts/00-defaultLayout.js +++ b/plasma/desktop/shell/data/layouts/00-defaultLayout.js @@ -2,7 +2,6 @@ loadTemplate("org.kde.plasma-desktop.defaultPanel") for (var i = 0; i < screenCount; ++i) { var desktop = new Activity - desktop.name = i18n("Desktop") desktop.screen = i desktop.wallpaperPlugin = 'image' desktop.wallpaperMode = 'SingleImage' diff --git a/plasma/desktop/shell/main.cpp b/plasma/desktop/shell/main.cpp index 051aceb6..299f950d 100644 --- a/plasma/desktop/shell/main.cpp +++ b/plasma/desktop/shell/main.cpp @@ -123,7 +123,7 @@ KDE_EXPORT int kdemain(int argc, char **argv) QAccessible::installFactory(Plasma::accessibleInterfaceFactory); #endif - int rc = app->exec(); + int rc = app->exec(); delete app; return rc; } diff --git a/plasma/generic/scriptengines/javascript/plasmoid/simplejavascriptapplet.cpp b/plasma/generic/scriptengines/javascript/plasmoid/simplejavascriptapplet.cpp index 131bcca0..c3828b63 100644 --- a/plasma/generic/scriptengines/javascript/plasmoid/simplejavascriptapplet.cpp +++ b/plasma/generic/scriptengines/javascript/plasmoid/simplejavascriptapplet.cpp @@ -269,12 +269,6 @@ void SimpleJavaScriptApplet::constraintsEvent(Plasma::Constraints constraints) } } - if (constraints & Plasma::ContextConstraint) { - if (!env->callEventListeners("currentActivityChanged")) { - callPlasmoidFunction("currentActivityChanged", QScriptValueList(), env); - } - } - if (constraints & Plasma::SizeConstraint) { if (!env || !env->callEventListeners("sizeChanged")) { callPlasmoidFunction("sizeChanged", QScriptValueList(), env);