Changeset View
Changeset View
Standalone View
Standalone View
kded/config.h
Show All 16 Lines | |||||
17 | #ifndef KDED_CONFIG_H | 17 | #ifndef KDED_CONFIG_H | ||
18 | #define KDED_CONFIG_H | 18 | #define KDED_CONFIG_H | ||
19 | 19 | | |||
20 | 20 | | |||
21 | #include <kscreen/config.h> | 21 | #include <kscreen/config.h> | ||
22 | 22 | | |||
23 | #include <memory> | 23 | #include <memory> | ||
24 | 24 | | |||
25 | class Config | 25 | class ControlConfig; | ||
26 | | ||||
27 | class Config : public QObject | ||||
26 | { | 28 | { | ||
29 | Q_OBJECT | ||||
27 | public: | 30 | public: | ||
28 | explicit Config(KScreen::ConfigPtr config); | 31 | explicit Config(KScreen::ConfigPtr config, QObject *parent = nullptr); | ||
29 | ~Config() = default; | 32 | ~Config() = default; | ||
30 | 33 | | |||
31 | QString id() const; | 34 | QString id() const; | ||
32 | 35 | | |||
33 | bool fileExists() const; | 36 | bool fileExists() const; | ||
34 | std::unique_ptr<Config> readFile(); | 37 | std::unique_ptr<Config> readFile(); | ||
35 | std::unique_ptr<Config> readOpenLidFile(); | 38 | std::unique_ptr<Config> readOpenLidFile(); | ||
36 | bool writeFile(); | 39 | bool writeFile(); | ||
Show All 17 Lines | 54 | private: | |||
54 | QString filePath(); | 57 | QString filePath(); | ||
55 | std::unique_ptr<Config> readFile(const QString &fileName); | 58 | std::unique_ptr<Config> readFile(const QString &fileName); | ||
56 | bool writeFile(const QString &filePath); | 59 | bool writeFile(const QString &filePath); | ||
57 | 60 | | |||
58 | bool canBeApplied(KScreen::ConfigPtr config) const; | 61 | bool canBeApplied(KScreen::ConfigPtr config) const; | ||
59 | 62 | | |||
60 | KScreen::ConfigPtr m_data; | 63 | KScreen::ConfigPtr m_data; | ||
61 | KScreen::Config::ValidityFlags m_validityFlags; | 64 | KScreen::Config::ValidityFlags m_validityFlags; | ||
65 | ControlConfig *m_control; | ||||
62 | 66 | | |||
63 | static QString s_configsDirName; | 67 | static QString s_configsDirName; | ||
64 | static QString s_fixedConfigFileName; | 68 | static QString s_fixedConfigFileName; | ||
65 | 69 | | |||
66 | static QString configsDirPath(); | 70 | static QString configsDirPath(); | ||
67 | }; | 71 | }; | ||
68 | 72 | | |||
69 | #endif | 73 | #endif |