Commit 5bd54084 authored by David Edmundson's avatar David Edmundson

Make --test mode run without spawning kactivitymanagerd

Summary:
This allows us to run the plasma-tests repo on your system without it
destroying all your real activities. Even though one run tests in a
nested
dbus sessions, kactivities will still load and meddle with your real
database
at the same time as the real daemon is. That gets messy and broken.

It also allows us to remove a hack in the plasma-tests script.

Test Plan:
Ran normal plasma, everything is the same.
Ran plasma-tests everything there now works properly

Reviewers: #plasma, hein

Reviewed By: #plasma, hein

Subscribers: apol, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6133
parent cd384e4a
......@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
ShellManager::s_fixedShell = cliOptions.value(shellPluginOption);
if (!cliOptions.isSet(noRespawnOption)) {
if (!cliOptions.isSet(noRespawnOption) && !cliOptions.isSet(testOption)) {
KCrash::setFlags(KCrash::AutoRestart);
}
......@@ -135,6 +135,8 @@ int main(int argc, char *argv[])
QDir(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)).removeRecursively();
ShellManager::s_testModeLayout = layoutUrl.toLocalFile();
qApp->setProperty("org.kde.KActivities.core.disableAutostart", true);
QObject::connect(ShellManager::instance(), &ShellManager::shellChanged,
ShellManager::instance(),
[layoutUrl]() {
......
......@@ -316,9 +316,7 @@ void ShellCorona::setShell(const QString &shell)
connect(m_activityController, &KActivities::Controller::serviceStatusChanged, this, &ShellCorona::load, Qt::UniqueConnection);
if (m_activityController->serviceStatus() == KActivities::Controller::Running) {
load();
}
load();
}
......@@ -640,7 +638,8 @@ QString ShellCorona::shell() const
void ShellCorona::load()
{
if (m_shell.isEmpty() ||
m_activityController->serviceStatus() != KActivities::Controller::Running) {
(m_activityController->serviceStatus() != KActivities::Controller::Running &&
!qApp->property("org.kde.KActivities.core.disableAutostart").toBool())) {
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment