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 | 28 | | |||
30 | class KShortcutsEditor; | 29 | class KShortcutsEditor; | ||
31 | class KActionCollection; | 30 | class KActionCollection; | ||
32 | 31 | | |||
33 | namespace KWin | 32 | namespace KWin | ||
34 | { | 33 | { | ||
34 | class KWinTabBoxConfigForm; | ||||
35 | enum class BuiltInEffect; | 35 | enum class BuiltInEffect; | ||
36 | namespace TabBox | 36 | namespace TabBox | ||
37 | { | 37 | { | ||
38 | class TabBoxSettings; | 38 | class TabBoxSettings; | ||
39 | class SwitchEffectSettings; | 39 | class SwitchEffectSettings; | ||
40 | class PluginsSettings; | 40 | class PluginsSettings; | ||
41 | } | 41 | } | ||
42 | 42 | | |||
43 | 43 | | |||
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 | 44 | class KWinTabBoxConfig : public KCModule | ||
54 | { | 45 | { | ||
55 | Q_OBJECT | 46 | Q_OBJECT | ||
56 | 47 | | |||
57 | public: | 48 | public: | ||
58 | explicit KWinTabBoxConfig(QWidget* parent, const QVariantList& args); | 49 | explicit KWinTabBoxConfig(QWidget* parent, const QVariantList& args); | ||
59 | ~KWinTabBoxConfig() override; | 50 | ~KWinTabBoxConfig() override; | ||
60 | 51 | | |||
61 | public Q_SLOTS: | 52 | public Q_SLOTS: | ||
62 | void save() override; | 53 | void save() override; | ||
63 | void load() override; | 54 | void load() override; | ||
64 | void defaults() override; | 55 | void defaults() override; | ||
65 | 56 | | |||
66 | private Q_SLOTS: | 57 | private Q_SLOTS: | ||
67 | void effectSelectionChanged(int index); | 58 | void updateUnmanagedState(); | ||
68 | void configureEffectClicked(); | 59 | void configureEffectClicked(); | ||
69 | void tabBoxToggled(bool on); | | |||
70 | void shortcutChanged(const QKeySequence &seq); | 60 | void shortcutChanged(const QKeySequence &seq); | ||
71 | void slotGHNS(); | 61 | void slotGHNS(); | ||
62 | | ||||
72 | private: | 63 | private: | ||
73 | void updateUiFromConfig(KWinTabBoxConfigForm *ui, const TabBox::TabBoxSettings *config); | 64 | void updateUiFromConfig(KWinTabBoxConfigForm *ui, const TabBox::TabBoxSettings *config); | ||
74 | void updateConfigFromUi(const KWinTabBoxConfigForm *ui, TabBox::TabBoxSettings *config); | | |||
75 | void initLayoutLists(); | 65 | void initLayoutLists(); | ||
66 | void createConnections(KWinTabBoxConfigForm *ui, TabBox::TabBoxSettings *config); | ||||
76 | 67 | | |||
77 | private: | 68 | private: | ||
78 | enum Mode { | | |||
79 | CoverSwitch = 0, | | |||
80 | FlipSwitch = 1, | | |||
81 | Layout = 2 | | |||
82 | }; | | |||
83 | KWinTabBoxConfigForm* m_primaryTabBoxUi; | 69 | KWinTabBoxConfigForm *m_primaryTabBoxUi; | ||
84 | KWinTabBoxConfigForm* m_alternativeTabBoxUi; | 70 | KWinTabBoxConfigForm *m_alternativeTabBoxUi; | ||
ervin: Since you touched that line anyway and the pointer isn't in the ctor initialization list, why… | |||||
85 | KSharedConfigPtr m_config; | 71 | KSharedConfigPtr m_config; | ||
86 | KActionCollection* m_actionCollection; | 72 | KActionCollection *m_actionCollection; | ||
87 | KShortcutsEditor* m_editor; | 73 | KShortcutsEditor *m_editor; | ||
88 | TabBox::TabBoxSettings *m_tabBoxConfig; | 74 | TabBox::TabBoxSettings *m_tabBoxConfig; | ||
89 | TabBox::TabBoxSettings *m_tabBoxAlternativeConfig; | 75 | TabBox::TabBoxSettings *m_tabBoxAlternativeConfig; | ||
90 | TabBox::SwitchEffectSettings *m_coverSwitchConfig; | 76 | TabBox::SwitchEffectSettings *m_coverSwitchConfig; | ||
91 | TabBox::SwitchEffectSettings *m_flipSwitchConfig; | 77 | TabBox::SwitchEffectSettings *m_flipSwitchConfig; | ||
92 | TabBox::PluginsSettings *m_pluginsConfig; | 78 | TabBox::PluginsSettings *m_pluginsConfig; | ||
93 | 79 | | |||
80 | // Builtin effects' names | ||||
81 | QString m_coverSwitch; | ||||
82 | QString m_flipSwitch; | ||||
94 | }; | 83 | }; | ||
95 | 84 | | |||
96 | } // namespace | 85 | } // namespace | ||
97 | 86 | | |||
98 | #endif | 87 | #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.