Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindesktop/animationsmodel.h
Show All 25 Lines | |||||
26 | { | 26 | { | ||
27 | 27 | | |||
28 | class AnimationsModel : public EffectsModel | 28 | class AnimationsModel : public EffectsModel | ||
29 | { | 29 | { | ||
30 | Q_OBJECT | 30 | Q_OBJECT | ||
31 | Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) | 31 | Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) | ||
32 | Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) | 32 | Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) | ||
33 | Q_PROPERTY(bool currentConfigurable READ currentConfigurable NOTIFY currentConfigurableChanged) | 33 | Q_PROPERTY(bool currentConfigurable READ currentConfigurable NOTIFY currentConfigurableChanged) | ||
34 | Q_PROPERTY(bool isImmutable READ isImmutable WRITE setIsImmutable NOTIFY isImmutableChanged) | ||||
zzag: I feel like this property belongs in EffectsModel. | |||||
34 | 35 | | |||
35 | public: | 36 | public: | ||
36 | explicit AnimationsModel(QObject *parent = nullptr); | 37 | explicit AnimationsModel(QObject *parent = nullptr); | ||
37 | 38 | | |||
38 | bool enabled() const; | 39 | bool enabled() const; | ||
39 | void setEnabled(bool enabled); | 40 | void setEnabled(bool enabled); | ||
40 | 41 | | |||
41 | int currentIndex() const; | 42 | int currentIndex() const; | ||
42 | void setCurrentIndex(int index); | 43 | void setCurrentIndex(int index); | ||
43 | 44 | | |||
44 | bool currentConfigurable() const; | 45 | bool currentConfigurable() const; | ||
45 | 46 | | |||
47 | bool isImmutable() const; | ||||
48 | void setIsImmutable(bool isImmutable); | ||||
49 | | ||||
46 | void load(); | 50 | void load(); | ||
47 | void save(); | 51 | void save(); | ||
48 | void defaults(); | 52 | void defaults(); | ||
49 | bool isDefaults() const; | 53 | bool isDefaults() const; | ||
50 | bool needsSave() const; | 54 | bool needsSave() const; | ||
51 | 55 | | |||
52 | Q_SIGNALS: | 56 | Q_SIGNALS: | ||
53 | void enabledChanged(); | 57 | void enabledChanged(); | ||
54 | void currentIndexChanged(); | 58 | void currentIndexChanged(); | ||
55 | void currentConfigurableChanged(); | 59 | void currentConfigurableChanged(); | ||
60 | void isImmutableChanged(bool isImmutable); | ||||
zzag: s/isImmutableChanged/immutableChanged/ | |||||
56 | 61 | | |||
57 | protected: | 62 | protected: | ||
58 | bool shouldStore(const EffectData &data) const override; | 63 | bool shouldStore(const EffectData &data) const override; | ||
59 | 64 | | |||
60 | private: | 65 | private: | ||
61 | Status status(int row) const; | 66 | Status status(int row) const; | ||
62 | bool modelCurrentEnabled() const; | 67 | bool modelCurrentEnabled() const; | ||
63 | int modelCurrentIndex() const; | 68 | int modelCurrentIndex() const; | ||
69 | void loadImmutability(); | ||||
64 | 70 | | |||
65 | bool m_enabled = false; | 71 | bool m_enabled = false; | ||
66 | int m_currentIndex = -1; | 72 | int m_currentIndex = -1; | ||
67 | bool m_currentConfigurable = false; | 73 | bool m_currentConfigurable = false; | ||
74 | bool m_isImmutable = false; | ||||
68 | 75 | | |||
69 | Q_DISABLE_COPY(AnimationsModel) | 76 | Q_DISABLE_COPY(AnimationsModel) | ||
70 | }; | 77 | }; | ||
71 | 78 | | |||
72 | } | 79 | } |
I feel like this property belongs in EffectsModel.