diff --git a/app/settings/settingsdialog/tablayoutshandler.cpp b/app/settings/settingsdialog/tablayoutshandler.cpp index 7a50fa679..c5e056426 100644 --- a/app/settings/settingsdialog/tablayoutshandler.cpp +++ b/app/settings/settingsdialog/tablayoutshandler.cpp @@ -376,11 +376,12 @@ void TabLayouts::switchLayout() void TabLayouts::toggleActivitiesManager() { - QDBusInterface iface("org.kde.plasmashell", "/PlasmaShell", "", QDBusConnection::sessionBus()); + QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.plasmashell"), + QStringLiteral("/PlasmaShell"), + QStringLiteral("org.kde.PlasmaShell"), + QStringLiteral("toggleActivityManager")); - if (iface.isValid()) { - iface.call("toggleActivityManager"); - } + QDBusConnection::sessionBus().call(message, QDBus::NoBlock); } void TabLayouts::toggleEnabledLayout() diff --git a/app/settings/universalsettings.cpp b/app/settings/universalsettings.cpp index e0010542f..856e7b342 100644 --- a/app/settings/universalsettings.cpp +++ b/app/settings/universalsettings.cpp @@ -370,11 +370,12 @@ void UniversalSettings::kwin_forwardMetaToLatte(bool forward) m_kwinrcModifierOnlyShortcutsGroup.writeEntry("Meta", forwardStr); m_kwinrcModifierOnlyShortcutsGroup.sync(); - QDBusInterface iface("org.kde.KWin", "/KWin", "", QDBusConnection::sessionBus()); + QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KWin"), + QStringLiteral("/KWin"), + QStringLiteral("org.kde.KWin"), + QStringLiteral("reconfigure")); - if (iface.isValid()) { - iface.call("reconfigure"); - } + QDBusConnection::sessionBus().call(message, QDBus::NoBlock); } void UniversalSettings::kwin_setDisabledMaximizedBorders(bool disable) @@ -389,13 +390,18 @@ void UniversalSettings::kwin_setDisabledMaximizedBorders(bool disable) return; } - m_kwinrcWindowsGroup.writeEntry("BorderlessMaximizedWindows", disable); - m_kwinrcWindowsGroup.sync(); - QDBusInterface iface("org.kde.KWin", "/KWin", "", QDBusConnection::sessionBus()); if (iface.isValid()) { - iface.call("reconfigure"); + m_kwinrcWindowsGroup.writeEntry("BorderlessMaximizedWindows", disable); + m_kwinrcWindowsGroup.sync(); + + QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KWin"), + QStringLiteral("/KWin"), + QStringLiteral("org.kde.KWin"), + QStringLiteral("reconfigure")); + + QDBusConnection::sessionBus().call(message, QDBus::NoBlock); m_kwinBorderlessMaximizedWindows = disable; } }