Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwintabbox/main.h
Show All 18 Lines | |||||
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
20 | *********************************************************************/ | 20 | *********************************************************************/ | ||
21 | 21 | | |||
22 | #ifndef __MAIN_H__ | 22 | #ifndef __MAIN_H__ | ||
23 | #define __MAIN_H__ | 23 | #define __MAIN_H__ | ||
24 | 24 | | |||
25 | #include <kcmodule.h> | 25 | #include <kcmodule.h> | ||
26 | #include <ksharedconfig.h> | 26 | #include <ksharedconfig.h> | ||
27 | 27 | #include "tabboxconfig.h" | |||
28 | #include "ui_main.h" | | |||
29 | | ||||
30 | class KShortcutsEditor; | | |||
31 | class KActionCollection; | | |||
32 | 28 | | |||
33 | namespace KWin | 29 | namespace KWin | ||
34 | { | 30 | { | ||
31 | class KWinTabBoxConfigForm; | ||||
35 | enum class BuiltInEffect; | 32 | enum class BuiltInEffect; | ||
36 | namespace TabBox | 33 | namespace TabBox | ||
37 | { | 34 | { | ||
38 | class TabBoxSettings; | 35 | class TabBoxSettings; | ||
39 | class SwitchEffectSettings; | 36 | class SwitchEffectSettings; | ||
40 | class PluginsSettings; | 37 | class PluginsSettings; | ||
41 | } | 38 | } | ||
42 | 39 | | |||
43 | 40 | | |||
44 | | ||||
45 | class KWinTabBoxConfigForm : public QWidget, public Ui::KWinTabBoxConfigForm | | |||
46 | { | | |||
47 | Q_OBJECT | | |||
48 | | ||||
49 | public: | | |||
50 | explicit KWinTabBoxConfigForm(QWidget* parent); | | |||
51 | }; | | |||
52 | | ||||
53 | class KWinTabBoxConfig : public KCModule | 41 | class KWinTabBoxConfig : public KCModule | ||
54 | { | 42 | { | ||
55 | Q_OBJECT | 43 | Q_OBJECT | ||
56 | 44 | | |||
57 | public: | 45 | public: | ||
58 | explicit KWinTabBoxConfig(QWidget* parent, const QVariantList& args); | 46 | explicit KWinTabBoxConfig(QWidget* parent, const QVariantList& args); | ||
59 | ~KWinTabBoxConfig() override; | 47 | ~KWinTabBoxConfig() override; | ||
60 | 48 | | |||
61 | public Q_SLOTS: | 49 | public Q_SLOTS: | ||
62 | void save() override; | 50 | void save() override; | ||
63 | void load() override; | 51 | void load() override; | ||
64 | void defaults() override; | 52 | void defaults() override; | ||
65 | 53 | | |||
66 | private Q_SLOTS: | 54 | private Q_SLOTS: | ||
67 | void effectSelectionChanged(int index); | 55 | void updateUnmanagedState(); | ||
68 | void configureEffectClicked(); | 56 | void configureEffectClicked(); | ||
69 | void tabBoxToggled(bool on); | | |||
70 | void shortcutChanged(const QKeySequence &seq); | | |||
71 | void slotGHNS(); | 57 | void slotGHNS(); | ||
58 | | ||||
72 | private: | 59 | private: | ||
73 | void updateUiFromConfig(KWinTabBoxConfigForm *ui, const TabBox::TabBoxSettings *config); | 60 | void updateUiFromConfig(KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config); | ||
74 | void updateConfigFromUi(const KWinTabBoxConfigForm *ui, TabBox::TabBoxSettings *config); | 61 | void updateConfigFromUi(const KWinTabBoxConfigForm *form, TabBox::TabBoxSettings *config); | ||
62 | void updateUiFromDefaultConfig(KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config); | ||||
75 | void initLayoutLists(); | 63 | void initLayoutLists(); | ||
64 | void createConnections(KWinTabBoxConfigForm *form, TabBox::TabBoxSettings *config); | ||||
65 | bool updateUnmanagedIsNeedSave(const KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config); | ||||
66 | bool updateUnmanagedIsDefault(const KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config); | ||||
76 | 67 | | |||
77 | private: | 68 | private: | ||
78 | enum Mode { | 69 | KWinTabBoxConfigForm *m_primaryTabBoxUi = nullptr; | ||
79 | CoverSwitch = 0, | 70 | KWinTabBoxConfigForm *m_alternativeTabBoxUi = nullptr; | ||
ervin: Since you touched that line anyway and the pointer isn't in the ctor initialization list, why… | |||||
80 | FlipSwitch = 1, | | |||
81 | Layout = 2 | | |||
82 | }; | | |||
83 | KWinTabBoxConfigForm* m_primaryTabBoxUi; | | |||
84 | KWinTabBoxConfigForm* m_alternativeTabBoxUi; | | |||
85 | KSharedConfigPtr m_config; | 71 | KSharedConfigPtr m_config; | ||
86 | KActionCollection* m_actionCollection; | 72 | | ||
87 | KShortcutsEditor* m_editor; | | |||
88 | TabBox::TabBoxSettings *m_tabBoxConfig; | 73 | TabBox::TabBoxSettings *m_tabBoxConfig; | ||
89 | TabBox::TabBoxSettings *m_tabBoxAlternativeConfig; | 74 | TabBox::TabBoxSettings *m_tabBoxAlternativeConfig; | ||
90 | TabBox::SwitchEffectSettings *m_coverSwitchConfig; | 75 | TabBox::SwitchEffectSettings *m_coverSwitchConfig; | ||
91 | TabBox::SwitchEffectSettings *m_flipSwitchConfig; | 76 | TabBox::SwitchEffectSettings *m_flipSwitchConfig; | ||
92 | TabBox::PluginsSettings *m_pluginsConfig; | 77 | TabBox::PluginsSettings *m_pluginsConfig; | ||
93 | 78 | | |||
79 | // Builtin effects' names | ||||
80 | QString m_coverSwitch; | ||||
81 | QString m_flipSwitch; | ||||
94 | }; | 82 | }; | ||
95 | 83 | | |||
96 | } // namespace | 84 | } // namespace | ||
97 | 85 | | |||
98 | #endif | 86 | #endif |
Since you touched that line anyway and the pointer isn't in the ctor initialization list, why not append a = nullptr here? (likewise for m_alternativeTabBoxUi, m_actionCollection and m_editor)
Avoiding uninitialized members is generally a good idea.