Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwineffects/kcm.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 42 | auto about = new KAboutData( | |||
---|---|---|---|---|---|
47 | KAboutLicense::GPL | 47 | KAboutLicense::GPL | ||
48 | ); | 48 | ); | ||
49 | about->addAuthor(i18n("Vlad Zahorodnii"), QString(), QStringLiteral("vladzzag@gmail.com")); | 49 | about->addAuthor(i18n("Vlad Zahorodnii"), QString(), QStringLiteral("vladzzag@gmail.com")); | ||
50 | setAboutData(about); | 50 | setAboutData(about); | ||
51 | 51 | | |||
52 | setButtons(Apply | Default); | 52 | setButtons(Apply | Default); | ||
53 | 53 | | |||
54 | connect(m_model, &EffectsModel::dataChanged, this, &DesktopEffectsKCM::updateNeedsSave); | 54 | connect(m_model, &EffectsModel::dataChanged, this, &DesktopEffectsKCM::updateNeedsSave); | ||
55 | connect(m_model, &EffectsModel::loaded, this, &DesktopEffectsKCM::updateNeedsSave); | ||||
zzag: Do we actually need this connect? I assume that signal dataChanged is emitted when the model is… | |||||
meven: dataChanged signal is only emitted in EffectsModel::setData | |||||
Oh, you're right! You could also consider using one of QAbstractItemModel's signals instead, e.g. modelReset. Perhaps EffectsModel::loaded() should not exist in the first place. zzag: Oh, you're right! You could also consider using one of QAbstractItemModel's signals instead, e. | |||||
55 | } | 56 | } | ||
56 | 57 | | |||
57 | DesktopEffectsKCM::~DesktopEffectsKCM() | 58 | DesktopEffectsKCM::~DesktopEffectsKCM() | ||
58 | { | 59 | { | ||
59 | } | 60 | } | ||
60 | 61 | | |||
61 | QAbstractItemModel *DesktopEffectsKCM::effectsModel() const | 62 | QAbstractItemModel *DesktopEffectsKCM::effectsModel() const | ||
62 | { | 63 | { | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 105 | { | |||
110 | } | 111 | } | ||
111 | 112 | | |||
112 | m_model->requestConfigure(index, transientParent); | 113 | m_model->requestConfigure(index, transientParent); | ||
113 | } | 114 | } | ||
114 | 115 | | |||
115 | void DesktopEffectsKCM::updateNeedsSave() | 116 | void DesktopEffectsKCM::updateNeedsSave() | ||
116 | { | 117 | { | ||
117 | setNeedsSave(m_model->needsSave()); | 118 | setNeedsSave(m_model->needsSave()); | ||
119 | setRepresentsDefaults(m_model->isDefaults()); | ||||
118 | } | 120 | } | ||
119 | 121 | | |||
120 | } // namespace KWin | 122 | } // namespace KWin | ||
121 | 123 | | |||
122 | #include "kcm.moc" | 124 | #include "kcm.moc" |
Do we actually need this connect? I assume that signal dataChanged is emitted when the model is loaded.