diff --git a/startkde/CMakeLists.txt b/startkde/CMakeLists.txt index 5ed11fef9..c90789c58 100644 --- a/startkde/CMakeLists.txt +++ b/startkde/CMakeLists.txt @@ -1,5 +1,4 @@ add_subdirectory(kcminit) -add_subdirectory(ksyncdbusenv) add_subdirectory(waitforname) add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII) @@ -18,11 +17,11 @@ add_executable(startplasma-waylandsession startplasma.cpp startplasma-waylandses add_executable(kde-systemd-start-condition kde-systemd-start-condition.cpp) target_include_directories(startplasma-x11 PRIVATE ${X11_X11_INCLUDE_PATH}) -target_link_libraries(startplasma-x11 PRIVATE Qt5::Core Qt5::DBus KF5::ConfigCore +target_link_libraries(startplasma-x11 PRIVATE Qt5::Core Qt5::DBus KF5::ConfigCore PW::KWorkspace ${X11_X11_LIB} # for kcheckrunning ) -target_link_libraries(startplasma-wayland PRIVATE Qt5::Core Qt5::DBus KF5::ConfigCore) -target_link_libraries(startplasma-waylandsession PRIVATE Qt5::Core Qt5::DBus KF5::ConfigCore) +target_link_libraries(startplasma-wayland PRIVATE Qt5::Core Qt5::DBus KF5::ConfigCore PW::KWorkspace) +target_link_libraries(startplasma-waylandsession PRIVATE Qt5::Core Qt5::DBus KF5::ConfigCore PW::KWorkspace) target_link_libraries(kde-systemd-start-condition PUBLIC KF5::ConfigCore KF5::Service) add_subdirectory(plasma-session) add_subdirectory(plasma-shutdown) diff --git a/startkde/ksyncdbusenv/CMakeLists.txt b/startkde/ksyncdbusenv/CMakeLists.txt deleted file mode 100644 index fdb7654ce..000000000 --- a/startkde/ksyncdbusenv/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_executable(ksyncdbusenv ksyncdbusenv.cpp) -ecm_mark_nongui_executable(ksyncdbusenv) -target_link_libraries(ksyncdbusenv Qt5::Core Qt5::DBus) - -install(TARGETS ksyncdbusenv DESTINATION ${KDE_INSTALL_LIBEXECDIR}) diff --git a/startkde/ksyncdbusenv/ksyncdbusenv.cpp b/startkde/ksyncdbusenv/ksyncdbusenv.cpp deleted file mode 100644 index 8a01e7d6a..000000000 --- a/startkde/ksyncdbusenv/ksyncdbusenv.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2014 Martin Graesslin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include -#include -#include -#include -#include -#include -#include - -typedef QMap EnvMap; -Q_DECLARE_METATYPE(EnvMap) - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - - EnvMap envMap; - for (const QString &key : env.keys()) { - envMap.insert(key, env.value(key)); - } - - QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DBus"), - QStringLiteral("/org/freedesktop/DBus"), - QStringLiteral("org.freedesktop.DBus"), - QStringLiteral("UpdateActivationEnvironment")); - qDBusRegisterMetaType(); - msg.setArguments(QList({QVariant::fromValue(envMap)})); - - QDBusPendingCall reply = QDBusConnection::sessionBus().asyncCall(msg); - reply.waitForFinished(); - if (reply.isError()) { - qDebug() << reply.error().name() << reply.error().message(); - } - return reply.isError() ? 1 : 0; -} diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp index b3b1185f9..beea80533 100644 --- a/startkde/startplasma.cpp +++ b/startkde/startplasma.cpp @@ -33,6 +33,8 @@ #include +#include + #include "startplasma.h" QTextStream out(stderr); @@ -284,14 +286,9 @@ void cleanupPlasmaEnvironment() // In that case, the update in startplasma might be too late. bool syncDBusEnvironment() { - int exitCode; // At this point all environment variables are set, let's send it to the DBus session server to update the activation environment - if (!QStandardPaths::findExecutable(QStringLiteral("dbus-update-activation-environment")).isEmpty()) { - exitCode = runSync(QStringLiteral("dbus-update-activation-environment"), { QStringLiteral("--systemd"), QStringLiteral("--all") }); - } else { - exitCode = runSync(QStringLiteral(CMAKE_INSTALL_FULL_LIBEXECDIR "/ksyncdbusenv"), {}); - } - return exitCode == 0; + auto job = new UpdateLaunchEnvJob(QProcessEnvironment::systemEnvironment()); + return job->exec(); } void setupFontDpi()