Commit 9e3fd921 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Port to UpdateLaunchEnvJob

Differential Revision: https://phabricator.kde.org/D27023
parent f9df8bb6
......@@ -9,8 +9,6 @@ set(kcm_colors_SRCS
)
# needed for krdb
qt5_add_dbus_interface(kcm_colors_SRCS ${KINIT_DBUS_INTERFACES_DIR}/kf5_org.kde.KLauncher.xml klauncher_iface)
kconfig_add_kcfg_files(kcm_colors_SRCS colorssettings.kcfgc GENERATE_MOC)
add_library(kcm_colors MODULE ${kcm_colors_SRCS})
......@@ -26,6 +24,7 @@ target_link_libraries(kcm_colors
KF5::NewStuffCore
KF5::QuickAddons
KF5::WindowSystem
PW::KWorkspace
)
if(X11_FOUND)
......
......@@ -13,10 +13,6 @@ xcursor/sortproxymodel.cpp
../krdb/krdb.cpp )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/xcursor/ )
set(klauncher_xml ${KINIT_DBUS_INTERFACES_DIR}/kf5_org.kde.KLauncher.xml)
qt5_add_dbus_interface(libnoinst_SRCS ${klauncher_xml} klauncher_iface)
########### next target ###############
set(kcm_cursortheme_PART_SRCS kcmcursortheme.cpp ${libnoinst_SRCS})
......@@ -41,6 +37,7 @@ target_link_libraries(kcm_cursortheme
KF5::QuickAddons
${X11_LIBRARIES}
XCB::XCB
PW::KWorkspace
)
if (X11_Xcursor_FOUND)
......
......@@ -51,8 +51,9 @@
#include <X11/Xlib.h>
#include <X11/Xcursor/Xcursor.h>
#include <updatelaunchenvjob.h>
#include "cursorthemesettings.h"
#include <klauncher_iface.h>
#ifdef HAVE_XFIXES
# include <X11/extensions/Xfixes.h>
......@@ -293,10 +294,7 @@ bool CursorThemeConfig::applyTheme(const CursorTheme *theme, const int size)
QByteArray themeName = QFile::encodeName(theme->name());
// Set up the proper launch environment for newly started apps
OrgKdeKLauncherInterface klauncher(QStringLiteral("org.kde.klauncher5"),
QStringLiteral("/KLauncher"),
QDBusConnection::sessionBus());
klauncher.setLaunchEnv(QStringLiteral("XCURSOR_THEME"), themeName);
UpdateLaunchEnvJob launchEnvJob(QStringLiteral("XCURSOR_THEME"), themeName);
// Update the Xcursor X resources
runRdb(0);
......
......@@ -16,9 +16,6 @@ if(X11_FOUND)
set(kcm_fonts_PART_SRCS ${kcm_fonts_PART_SRCS} ${libkxftconfig_SRCS})
endif()
set(klauncher_xml ${KINIT_DBUS_INTERFACES_DIR}/kf5_org.kde.KLauncher.xml)
qt5_add_dbus_interface(kcm_fonts_PART_SRCS ${klauncher_xml} klauncher_iface)
kconfig_add_kcfg_files(kcm_fonts_PART_SRCS fontssettings.kcfgc GENERATE_MOC)
add_library(kcm_fonts MODULE ${kcm_fonts_PART_SRCS})
......@@ -31,7 +28,8 @@ if(X11_FOUND)
KF5::Plasma
KF5::PlasmaQuick
KF5::Declarative
KF5::QuickAddons)
KF5::QuickAddons
PW::KWorkspace)
if(FONTCONFIG_FOUND)
target_link_libraries(kcm_fonts ${FONTCONFIG_LIBRARIES})
endif()
......
......@@ -34,8 +34,10 @@
#include <QByteArray>
#include <QTextStream>
#include <QDateTime>
#include <QDebug>
#include <QDBusConnection>
#include <klauncher_iface.h>
#include <QSaveFile>
#include <QTemporaryFile>
#include <KColorUtils>
#include <kcolorscheme.h>
......@@ -46,6 +48,8 @@
#include <kdelibs4migration.h>
#include <KWindowSystem>
#include <updatelaunchenvjob.h>
#include "krdb.h"
#if HAVE_X11
#include <X11/Xlib.h>
......@@ -108,8 +112,7 @@ static void applyGtkStyles(bool active, int version)
// Pass env. var to kdeinit.
QString name = gtkEnvVar(version);
QString value = list.join(QLatin1Char(':'));
org::kde::KLauncher klauncher(QStringLiteral("org.kde.klauncher5"), QStringLiteral("/KLauncher"), QDBusConnection::sessionBus());
klauncher.setLaunchEnv(name, value);
UpdateLaunchEnvJob(name, value);
}
// -----------------------------------------------------------------------------
......
......@@ -20,9 +20,6 @@ if (X11_Xcursor_FOUND)
)
endif ()
set(klauncher_xml ${KINIT_DBUS_INTERFACES_DIR}/kf5_org.kde.KLauncher.xml)
qt5_add_dbus_interface(kcm_lookandfeel_SRCS ${klauncher_xml} klauncher_iface)
kconfig_add_kcfg_files(kcm_lookandfeel_SRCS lookandfeelsettings.kcfgc GENERATE_MOC)
add_library(kcm_lookandfeel MODULE ${kcm_lookandfeel_SRCS})
......@@ -38,6 +35,7 @@ target_link_libraries(kcm_lookandfeel
KF5::KDELibs4Support
KF5::Declarative
KF5::QuickAddons
PW::KWorkspace
Qt5::DBus
Qt5::Widgets
......@@ -87,8 +85,6 @@ if (X11_Xcursor_FOUND)
)
endif ()
qt5_add_dbus_interface(lookandfeeltool_SRCS ${klauncher_xml} klauncher_iface)
kconfig_add_kcfg_files(lookandfeeltool_SRCS lookandfeelsettings.kcfgc GENERATE_MOC)
add_executable(lookandfeeltool ${lookandfeeltool_SRCS})
......@@ -105,6 +101,7 @@ target_link_libraries(lookandfeeltool
KF5::Declarative
KF5::QuickAddons
KF5::NewStuff
PW::KWorkspace
Qt5::DBus
Qt5::Widgets
......
......@@ -16,9 +16,6 @@ if (X11_Xcursor_FOUND)
)
endif ()
set(klauncher_xml ${KINIT_DBUS_INTERFACES_DIR}/kf5_org.kde.KLauncher.xml)
qt5_add_dbus_interface(kcmTest_SRCS ${klauncher_xml} klauncher_iface)
kconfig_add_kcfg_files(kcmTest_SRCS ../lookandfeelsettings.kcfgc GENERATE_MOC)
add_executable(kcmTest ${kcmTest_SRCS})
......@@ -37,6 +34,7 @@ target_link_libraries(kcmTest
KF5::Declarative
KF5::QuickAddons
KF5::NewStuff
PW::KWorkspace
Qt5::DBus
Qt5::Widgets
......
......@@ -22,7 +22,6 @@
#include "../krdb/krdb.h"
#include "config-kcm.h"
#include "config-workspace.h"
#include <klauncher_iface.h>
#include <KAboutData>
#include <KSharedConfig>
......@@ -32,6 +31,8 @@
#include <KRun>
#include <KService>
#include <QDBusConnection>
#include <QDBusMessage>
#include <QDebug>
#include <QQuickItem>
#include <QQuickWindow>
......@@ -45,6 +46,8 @@
#include <X11/Xlib.h>
#include <updatelaunchenvjob.h>
#include "lookandfeelsettings.h"
#ifdef HAVE_XCURSOR
......@@ -489,11 +492,7 @@ void KCMLookandFeel::setCursorTheme(const QString themeName)
return;
}
// Set up the proper launch environment for newly started apps
OrgKdeKLauncherInterface klauncher(QStringLiteral("org.kde.klauncher5"),
QStringLiteral("/KLauncher"),
QDBusConnection::sessionBus());
klauncher.setLaunchEnv(QStringLiteral("XCURSOR_THEME"), themeName);
UpdateLaunchEnvJob launchEnvJob(QStringLiteral("XCURSOR_THEME"), themeName);
// Update the Xcursor X resources
runRdb(0);
......
......@@ -24,9 +24,6 @@ ecm_qt_declare_logging_category(common_SRCS
Critical
)
set(klauncher_xml ${KINIT_DBUS_INTERFACES_DIR}/kf5_org.kde.KLauncher.xml)
qt5_add_dbus_interface(common_SRCS ${klauncher_xml} klauncher_iface)
include(backends/x11.cmake)
include(backends/kwin_wl.cmake)
......@@ -45,6 +42,7 @@ target_link_libraries(kapplymousetheme
KF5::CoreAddons
KF5::ConfigCore
KF5::I18n
PW::KWorkspace
)
install(TARGETS kapplymousetheme ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -76,6 +74,7 @@ target_link_libraries(kcm_mouse
KF5::KIOCore
KF5::KIOWidgets
KF5::Declarative
PW::KWorkspace
Qt5::DBus
Qt5::QuickWidgets
......
......@@ -34,7 +34,7 @@
#include <KSharedConfig>
#include <KConfigGroup>
#include <klauncher_iface.h>
#include <updatelaunchenvjob.h>
#include <X11/X.h>
#include <X11/Xlib.h>
......@@ -147,13 +147,10 @@ void X11Backend::kcmInit()
// Tell klauncher to set the XCURSOR_THEME and XCURSOR_SIZE environment
// variables when launching applications.
OrgKdeKLauncherInterface klauncher(QStringLiteral("org.kde.klauncher5"),
QStringLiteral("/KLauncher"),
QDBusConnection::sessionBus());
if (!theme.isEmpty()) {
klauncher.setLaunchEnv(QStringLiteral("XCURSOR_THEME"), theme);
UpdateLaunchEnvJob launchEnvJob(QStringLiteral("XCURSOR_THEME"), theme);
}
if (!size.isEmpty()) {
klauncher.setLaunchEnv(QStringLiteral("XCURSOR_SIZE"), size);
UpdateLaunchEnvJob launchEnvJob(QStringLiteral("XCURSOR_SIZE"), size);
}
}
......@@ -12,8 +12,6 @@ set(kcm_style_PART_SRCS
gtkpage.cpp
previewitem.cpp
)
set(klauncher_xml ${KINIT_DBUS_INTERFACES_DIR}/kf5_org.kde.KLauncher.xml)
qt5_add_dbus_interface(kcm_style_PART_SRCS ${klauncher_xml} klauncher_iface)
ki18n_wrap_ui(kcm_style_PART_SRCS stylepreview.ui)
......@@ -38,6 +36,7 @@ target_link_libraries(kcm_style
KF5::WindowSystem
KF5::Archive
KF5::NewStuff
PW::KWorkspace
)
kcoreaddons_desktop_to_json(kcm_style "kcm_style.desktop")
......
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