File indexing completed on 2024-04-28 16:55:19

0001 /*
0002     SPDX-FileCopyrightText: 2020 David Redondo <kde@david-redondo.de>
0003     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 
0006 #ifndef SDDMSETTINGSBASE_H
0007 #define SDDMSETTINGSBASE_H
0008 
0009 #include <KConfigSkeleton>
0010 
0011 // The configuration of SDDM works as follows:
0012 // - The system configuration comes from files in /usr/lib/sddm.conf.d/
0013 // - User supplied config files are in /etc/sddm/conf.d/
0014 // - And the most specific file is /etc/sdddm/conf
0015 // Overwrite order is in the opposite order of mention.
0016 // Because KConfig can't model this we use two KConfig objects, one to read the defaults from
0017 // /usr/lib/sddm.conf.d/* supplied here, and another one passed via the constructor to the KConfigSkeleton
0018 // to read the user configuration. The generated skeleton inherits this class and calls these methods
0019 // to access the defaults
0020 class SddmSettingsBase : public KConfigSkeleton
0021 {
0022     Q_OBJECT
0023 public:
0024     SddmSettingsBase(KSharedConfigPtr config, QObject *parent = nullptr);
0025     Q_PROPERTY(QString defaultUser READ defaultUser CONSTANT)
0026 protected:
0027     QString defaultCurrent() const;
0028     unsigned int defaultMinimumUid() const;
0029     unsigned int defaultMaximumUid() const;
0030     QString defaultUser() const;
0031     QString defaultSession() const;
0032     bool defaultRelogin() const;
0033     QString defaultHaltCommand() const;
0034     QString defaultRebootCommand() const;
0035 
0036 private:
0037     KSharedConfigPtr m_defaultConfig;
0038 };
0039 
0040 #endif