From a869e0e4066b13d8d27e4fceeb022e899de6b822 Mon Sep 17 00:00:00 2001 From: Fabian Vogt 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 f4da579..847b023 100644 --- a/src/package/contents/ui/Advanced.qml +++ b/src/package/contents/ui/Advanced.qml @@ -71,7 +71,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" KCM.SettingStateBinding { visible: autologinBox.checked configObject: kcm.sddmSettings 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