Properly registering existing activities before loading layout.js

Reviewers: #plasma, mart, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D2288
wilder-5.14
Ivan Čukić 10 years ago
parent 1e5114e536
commit 4b3e5cd211
  1. 13
      shell/shellcorona.cpp

@ -328,7 +328,12 @@ void ShellCorona::load()
loadLayout("plasma-" + m_shell + "-appletsrc");
checkActivities();
if (containments().isEmpty()) {
// Seems like we never really get to this point since loadLayout already
// (virtually) calls loadDefaultLayout if it does not load anything
// from the config file. Maybe if the config file is not empty,
// but still does not have any containments
loadDefaultLayout();
processUpdateScripts();
} else {
@ -539,6 +544,14 @@ void ShellCorona::loadDefaultLayout()
QString code = file.readAll();
qDebug() << "evaluating startup script:" << script;
// We need to know which activities are here in order for
// the scripting engine to work. activityAdded does not mind
// if we pass it the same activity multiple times
QStringList existingActivities = m_activityController->activities();
foreach (const QString &id, existingActivities) {
activityAdded(id);
}
WorkspaceScripting::ScriptEngine scriptEngine(this);
connect(&scriptEngine, &WorkspaceScripting::ScriptEngine::printError, this,

Loading…
Cancel
Save