Changeset View
Changeset View
Standalone View
Standalone View
kded/config.h
Show All 24 Lines | |||||
25 | #include <memory> | 25 | #include <memory> | ||
26 | 26 | | |||
27 | class Config | 27 | class Config | ||
28 | { | 28 | { | ||
29 | public: | 29 | public: | ||
30 | explicit Config(KScreen::ConfigPtr config); | 30 | explicit Config(KScreen::ConfigPtr config); | ||
31 | ~Config() = default; | 31 | ~Config() = default; | ||
32 | 32 | | |||
33 | static void setDirPath(const QString &path); | | |||
34 | static QString dirPath() { | | |||
35 | return s_dirPath; | | |||
36 | } | | |||
37 | | ||||
38 | QString id() const; | 33 | QString id() const; | ||
39 | 34 | | |||
40 | bool fileExists() const; | 35 | bool fileExists() const; | ||
41 | std::unique_ptr<Config> readFile(); | 36 | std::unique_ptr<Config> readFile(); | ||
42 | std::unique_ptr<Config> readOpenLidFile(); | 37 | std::unique_ptr<Config> readOpenLidFile(); | ||
43 | bool writeFile(); | 38 | bool writeFile(); | ||
44 | bool writeOpenLidFile(); | 39 | bool writeOpenLidFile(); | ||
45 | 40 | | |||
Show All 16 Lines | 53 | private: | |||
62 | std::unique_ptr<Config> readFile(const QString &fileName); | 57 | std::unique_ptr<Config> readFile(const QString &fileName); | ||
63 | bool writeFile(const QString &filePath); | 58 | bool writeFile(const QString &filePath); | ||
64 | 59 | | |||
65 | bool canBeApplied(KScreen::ConfigPtr config) const; | 60 | bool canBeApplied(KScreen::ConfigPtr config) const; | ||
66 | 61 | | |||
67 | KScreen::ConfigPtr m_data; | 62 | KScreen::ConfigPtr m_data; | ||
68 | KScreen::Config::ValidityFlags m_validityFlags; | 63 | KScreen::Config::ValidityFlags m_validityFlags; | ||
69 | 64 | | |||
70 | static QString s_dirPath; | | |||
71 | static QString s_configsDirName; | 65 | static QString s_configsDirName; | ||
72 | static QString s_fixedConfigFileName; | 66 | static QString s_fixedConfigFileName; | ||
73 | 67 | | |||
74 | static QString configsDirPath(); | 68 | static QString configsDirPath(); | ||
75 | }; | 69 | }; | ||
76 | 70 | | |||
77 | #endif | 71 | #endif |