Changeset View
Changeset View
Standalone View
Standalone View
kcms/componentchooser/componentchooser.h
Show All 29 Lines | |||||
30 | { | 30 | { | ||
31 | Q_OBJECT | 31 | Q_OBJECT | ||
32 | 32 | | |||
33 | public: | 33 | public: | ||
34 | CfgPlugin(QWidget *parent): QComboBox(parent) {} | 34 | CfgPlugin(QWidget *parent): QComboBox(parent) {} | ||
35 | virtual ~CfgPlugin(){} | 35 | virtual ~CfgPlugin(){} | ||
36 | virtual void load(KConfig *cfg)=0; | 36 | virtual void load(KConfig *cfg)=0; | ||
37 | virtual void save(KConfig *cfg)=0; | 37 | virtual void save(KConfig *cfg)=0; | ||
38 | | ||||
38 | bool hasChanged() const | 39 | bool hasChanged() const | ||
39 | { | 40 | { | ||
40 | return m_currentIndex != -1 && m_currentIndex != currentIndex(); | 41 | return count() > 1 && m_currentIndex != currentIndex(); | ||
41 | } | 42 | } | ||
42 | 43 | | |||
43 | void defaults() | 44 | void defaults() | ||
44 | { | 45 | { | ||
45 | if (m_defaultIndex != -1) { | 46 | if (m_defaultIndex != -1) { | ||
46 | setCurrentIndex(m_defaultIndex); | 47 | setCurrentIndex(m_defaultIndex); | ||
47 | } | 48 | } | ||
48 | } | 49 | } | ||
49 | 50 | | |||
50 | bool isDefaults() const | 51 | bool isDefaults() const | ||
anthonyfieroni: { in new line, add const | |||||
51 | { | 52 | { | ||
52 | return m_defaultIndex == -1 || m_defaultIndex == currentIndex(); | 53 | return m_defaultIndex == -1 || m_defaultIndex == currentIndex(); | ||
53 | } | 54 | } | ||
54 | 55 | | |||
55 | Q_SIGNALS: | 56 | Q_SIGNALS: | ||
56 | void changed(bool); | 57 | void changed(bool); | ||
57 | 58 | | |||
58 | protected: | 59 | protected: | ||
Show All 33 Lines |
{ in new line, add const