[sddm-kcm] Write settings to /etc/sddm.conf.d instead of etc/sddm.conf
ClosedPublic

Authored by filipf on Jun 15 2019, 4:49 PM.

Details

Summary

As of SDDM release 0.16.0 it advised to use /etc/sddm.conf.d/ as the directory for user settings.

This patch aims to achieve it by saving in that very same directory under the filename "kde_settings.conf".

It must also remove identical entries from the old "sddm.conf" file because SDDM will simply load them instead of new user set values.

BUG: 386241
FIXED-IN: 5.17

Test Plan
  • compiles
  • writes to new config file
  • reads from new config file
  • deletes identical entries from old config file when writing them to new one

Diff Detail

Repository
R123 SDDM Configuration Panel (KCM)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
filipf created this revision.Jun 15 2019, 4:49 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 15 2019, 4:49 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.Jun 15 2019, 4:49 PM
filipf edited the test plan for this revision. (Show Details)Jun 15 2019, 4:50 PM
filipf added reviewers: davidedmundson, ngraham, Plasma.
davidedmundson requested changes to this revision.Jun 15 2019, 5:01 PM
davidedmundson added inline comments.
sddmauthhelper.cpp
90

if something is going into the file "kde_settings.conf" then we want to remove it from sddmOldConfig

Nothing in args is sent with this filename

src/sddmkcm.cpp
60

This file doesn't need to be changed at all

74–75

as it's all done here

src/themesmodel.cpp
93 ↗(On Diff #59883)

this needs to be using the same logic as sddmkcm.cpp

probably easier if they share the same kconfig instance

This revision now requires changes to proceed.Jun 15 2019, 5:01 PM
filipf updated this revision to Diff 59890.Jun 15 2019, 9:09 PM
  • revert 2 unecessary changes to file location
  • actually delete duplicate entries from sddm.conf
  • tidy up comment
filipf marked 3 inline comments as done.Jun 15 2019, 9:12 PM
filipf added inline comments.
sddmauthhelper.cpp
90

Thanks! This is what I was not figuring out properly all along.

filipf retitled this revision from [sddm-kcm] WIP: Write settings to /etc/sddm.conf.d instead of etc/sddm.conf to [sddm-kcm] Write settings to /etc/sddm.conf.d instead of etc/sddm.conf.Jun 15 2019, 9:13 PM
filipf edited the test plan for this revision. (Show Details)
davidedmundson accepted this revision.Jun 15 2019, 9:41 PM

Good stuff, thanks

This revision is now accepted and ready to land.Jun 15 2019, 9:41 PM
GB_2 added a subscriber: GB_2.EditedJun 15 2019, 9:44 PM

I think plasma-settings.conf is a better filename.

ngraham accepted this revision.Jun 16 2019, 4:40 PM

Nice work!

filipf marked an inline comment as done.Jun 16 2019, 4:41 PM
In D21832#480344, @GB_2 wrote:

I think plasma-settings.conf is a better filename.

Probably, but I'm not sure it's super important have the distinction in this case.

This revision was automatically updated to reflect the committed changes.
fvogt added a subscriber: fvogt.Jun 17 2019, 9:20 AM

I argued in https://bugs.kde.org/show_bug.cgi?id=386241 that this is the wrong way. Any reason you implemented this anyway?

sitter added a subscriber: sitter.Jun 17 2019, 9:34 AM

I would actually note that the file should be 0_kde_settings.conf (assuming/hoping sddm orders the configs) otherwise a user can manually create best_config.conf and get overridden by what was set in the KCM what with k being loaded after b.

Users shouldn't be creating random files in this directory.

But if considering the possibility, according to tests configs are ordered alphabetically so we'd need to have a z_kde_settings.conf (if not intervening in SDDM).