Changeset View
Changeset View
Standalone View
Standalone View
src/config.cpp
Show All 32 Lines | |||||
33 | class Q_DECL_HIDDEN Config::Private : public QObject | 33 | class Q_DECL_HIDDEN Config::Private : public QObject | ||
34 | { | 34 | { | ||
35 | Q_OBJECT | 35 | Q_OBJECT | ||
36 | public: | 36 | public: | ||
37 | Private(Config *parent) | 37 | Private(Config *parent) | ||
38 | : QObject(parent) | 38 | : QObject(parent) | ||
39 | , valid(true) | 39 | , valid(true) | ||
40 | , supportedFeatures(Config::Feature::None) | 40 | , supportedFeatures(Config::Feature::None) | ||
41 | , tabletModeAvailable(false) | ||||
42 | , tabletModeEngaged(false) | ||||
41 | , q(parent) | 43 | , q(parent) | ||
42 | { } | 44 | { } | ||
43 | 45 | | |||
44 | KScreen::OutputPtr findPrimaryOutput() const | 46 | KScreen::OutputPtr findPrimaryOutput() const | ||
45 | { | 47 | { | ||
46 | auto iter = std::find_if(outputs.constBegin(), outputs.constEnd(), | 48 | auto iter = std::find_if(outputs.constBegin(), outputs.constEnd(), | ||
47 | [](const KScreen::OutputPtr &output) -> bool { | 49 | [](const KScreen::OutputPtr &output) -> bool { | ||
48 | return output->isPrimary(); | 50 | return output->isPrimary(); | ||
Show All 36 Lines | 67 | { | |||
85 | return iter; | 87 | return iter; | ||
86 | } | 88 | } | ||
87 | 89 | | |||
88 | bool valid; | 90 | bool valid; | ||
89 | ScreenPtr screen; | 91 | ScreenPtr screen; | ||
90 | OutputPtr primaryOutput; | 92 | OutputPtr primaryOutput; | ||
91 | OutputList outputs; | 93 | OutputList outputs; | ||
92 | Features supportedFeatures; | 94 | Features supportedFeatures; | ||
95 | bool tabletModeAvailable; | ||||
96 | bool tabletModeEngaged; | ||||
93 | 97 | | |||
94 | private: | 98 | private: | ||
95 | Config *q; | 99 | Config *q; | ||
96 | }; | 100 | }; | ||
97 | 101 | | |||
98 | bool Config::canBeApplied(const ConfigPtr &config) | 102 | bool Config::canBeApplied(const ConfigPtr &config) | ||
99 | { | 103 | { | ||
100 | return canBeApplied(config, ValidityFlag::None); | 104 | return canBeApplied(config, ValidityFlag::None); | ||
▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | 258 | { | |||
255 | return d->supportedFeatures; | 259 | return d->supportedFeatures; | ||
256 | } | 260 | } | ||
257 | 261 | | |||
258 | void Config::setSupportedFeatures(const Config::Features &features) | 262 | void Config::setSupportedFeatures(const Config::Features &features) | ||
259 | { | 263 | { | ||
260 | d->supportedFeatures = features; | 264 | d->supportedFeatures = features; | ||
261 | } | 265 | } | ||
262 | 266 | | |||
267 | bool Config::tabletModeAvailable() const | ||||
268 | { | ||||
269 | return d->tabletModeAvailable; | ||||
270 | } | ||||
271 | | ||||
272 | void Config::setTabletModeAvailable(bool available) | ||||
273 | { | ||||
274 | d->tabletModeAvailable = available; | ||||
275 | } | ||||
276 | | ||||
277 | bool Config::tabletModeEngaged() const | ||||
278 | { | ||||
279 | return d->tabletModeEngaged; | ||||
280 | } | ||||
281 | | ||||
282 | void Config::setTabletModeEngaged(bool engaged) | ||||
283 | { | ||||
284 | d->tabletModeEngaged = engaged; | ||||
285 | } | ||||
286 | | ||||
263 | OutputList Config::outputs() const | 287 | OutputList Config::outputs() const | ||
264 | { | 288 | { | ||
265 | return d->outputs; | 289 | return d->outputs; | ||
266 | } | 290 | } | ||
267 | 291 | | |||
268 | OutputList Config::connectedOutputs() const | 292 | OutputList Config::connectedOutputs() const | ||
269 | { | 293 | { | ||
270 | OutputList outputs; | 294 | OutputList outputs; | ||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |