Changeset View
Changeset View
Standalone View
Standalone View
kcms/componentchooser/componentchooser.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 72 | void CfgComponent::load(KConfig *cfg) { | |||
---|---|---|---|---|---|
104 | emit changed(false); | 104 | emit changed(false); | ||
105 | } | 105 | } | ||
106 | 106 | | |||
107 | void CfgComponent::defaults() | 107 | void CfgComponent::defaults() | ||
108 | { | 108 | { | ||
109 | //todo | 109 | //todo | ||
110 | } | 110 | } | ||
111 | 111 | | |||
112 | bool CfgComponent::isDefaults() const | ||||
113 | { | ||||
114 | return false; | ||||
115 | } | ||||
116 | | ||||
117 | | ||||
112 | //END General kpart based Component selection | 118 | //END General kpart based Component selection | ||
113 | 119 | | |||
114 | 120 | | |||
115 | 121 | | |||
116 | 122 | | |||
117 | 123 | | |||
118 | 124 | | |||
119 | ComponentChooser::ComponentChooser(QWidget *parent): | 125 | ComponentChooser::ComponentChooser(QWidget *parent): | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 184 | void ComponentChooser::slotServiceSelected(QListWidgetItem* it) { | |||
185 | KConfig cfg(service, KConfig::SimpleConfig); | 191 | KConfig cfg(service, KConfig::SimpleConfig); | ||
186 | 192 | | |||
187 | ComponentDescription->setText(cfg.group(QByteArray()).readEntry("Comment",i18n("No description available"))); | 193 | ComponentDescription->setText(cfg.group(QByteArray()).readEntry("Comment",i18n("No description available"))); | ||
188 | ComponentDescription->setMinimumSize(ComponentDescription->sizeHint()); | 194 | ComponentDescription->setMinimumSize(ComponentDescription->sizeHint()); | ||
189 | 195 | | |||
190 | configWidget = configWidgetMap.value(service); | 196 | configWidget = configWidgetMap.value(service); | ||
191 | if (configWidget) { | 197 | if (configWidget) { | ||
192 | configContainer->setCurrentWidget(configWidget); | 198 | configContainer->setCurrentWidget(configWidget); | ||
193 | dynamic_cast<CfgPlugin*>(configWidget)->load(&cfg); | 199 | const auto plugin = dynamic_cast<CfgPlugin*>(configWidget); | ||
200 | plugin->load(&cfg); | ||||
201 | emit defaulted(plugin->isDefaults()); | ||||
194 | } | 202 | } | ||
195 | 203 | | |||
196 | emitChanged(false); | 204 | emitChanged(false); | ||
197 | latestEditedService = service; | 205 | latestEditedService = service; | ||
198 | } | 206 | } | ||
199 | 207 | | |||
200 | 208 | | |||
201 | void ComponentChooser::emitChanged(bool val) { | 209 | void ComponentChooser::emitChanged(bool val) { | ||
202 | somethingChanged=val; | 210 | somethingChanged=val; | ||
203 | emit changed(val); | 211 | emit changed(val); | ||
212 | | ||||
213 | CfgPlugin *plugin = dynamic_cast<CfgPlugin *>( configWidget ); | ||||
ervin: No spaces between the parenthesis, no space after * | |||||
214 | emit defaulted(plugin->isDefaults()); | ||||
204 | } | 215 | } | ||
205 | 216 | | |||
206 | 217 | | |||
207 | ComponentChooser::~ComponentChooser() | 218 | ComponentChooser::~ComponentChooser() | ||
208 | { | 219 | { | ||
209 | for (QWidget *configWidget : configWidgetMap) { | 220 | for (QWidget *configWidget : configWidgetMap) { | ||
210 | delete configWidget; | 221 | delete configWidget; | ||
211 | } | 222 | } | ||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
No spaces between the parenthesis, no space after *