shellsettingsplugin: Never affect panels when not in Plasma Mobile

If the navigation bar setting is triggered, it can affect the Desktop session as well. Add a check to only change Plasma panels in Plasma Mobile.
This commit is contained in:
Devin Lin 2024-07-03 11:58:50 -04:00
parent a58144fb18
commit 29f387bb57

View file

@ -9,6 +9,7 @@
#include <KIO/CommandLauncherJob>
#include <KNotificationJobUiDelegate>
#include <KPluginFactory>
#include <KRuntimePlatform>
#include <QDBusConnection>
#include <QDBusMessage>
@ -168,6 +169,12 @@ void MobileShellSettings::setConvergenceModeEnabled(bool enabled)
void MobileShellSettings::updateNavigationBarsInPlasma(bool navigationPanelEnabled)
{
// Do not update panels when not in Plasma Mobile
bool isMobilePlatform = KRuntimePlatform::runtimePlatform().contains("phone");
if (!isMobilePlatform) {
return;
}
auto message = QDBusMessage::createMethodCall(QLatin1String("org.kde.plasmashell"),
QLatin1String("/PlasmaShell"),
QLatin1String("org.kde.PlasmaShell"),