kcm_sddm/0001-Support-default.session-symlink.patch

46 lines
1.9 KiB
Diff

From 6e280bcc5cac94a409c2c28bc07068b4f3a95060 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Tue, 11 Jul 2017 13:13:13 +0200
Subject: [PATCH 1/3] Support default.session symlink
Display it under a different name, otherwise it is indistinguishable from
a normal session. Use it as default when the combobox is disabled.
---
src/package/contents/ui/Advanced.qml | 2 +-
src/sessionmodel.cpp | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/package/contents/ui/Advanced.qml b/src/package/contents/ui/Advanced.qml
index 88bd73e..0b10c6c 100644
--- a/src/package/contents/ui/Advanced.qml
+++ b/src/package/contents/ui/Advanced.qml
@@ -70,7 +70,7 @@ Kirigami.Page {
textRole: "name"
valueRole: "file"
onActivated: kcm.sddmSettings.session = currentValue
- onEnabledChanged: enabled ? kcm.sddmSettings.session = currentValue : kcm.sddmSettings.session = ""
+ onEnabledChanged: enabled ? kcm.sddmSettings.session = currentValue : kcm.sddmSettings.session = "default.desktop"
Component.onCompleted: currentIndex = Math.max(indexOfValue(kcm.sddmSettings.session), 0)
KCM.SettingStateBinding {
visible: autologinBox.checked
diff --git a/src/sessionmodel.cpp b/src/sessionmodel.cpp
index 16999dd..50e22d4 100644
--- a/src/sessionmodel.cpp
+++ b/src/sessionmodel.cpp
@@ -109,6 +109,12 @@ void SessionModel::loadDir(const QString &path, SessionType type)
isHidden = line.mid(7).toLower() == QLatin1String("true");
}
}
+
+ if (session == QLatin1String( "default.desktop" )) {
+ si->name = tr("(System Default)");
+ isHidden = false;
+ }
+
if (!isHidden) {
// add to sessions list
d->sessions.push_back(si);
--
2.25.1