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 | | ||||
112 | //END General kpart based Component selection | 117 | //END General kpart based Component selection | ||
113 | 118 | | |||
114 | 119 | | |||
115 | 120 | | |||
116 | 121 | | |||
117 | 122 | | |||
118 | 123 | | |||
119 | ComponentChooser::ComponentChooser(QWidget *parent): | 124 | ComponentChooser::ComponentChooser(QWidget *parent): | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 190 | void ComponentChooser::slotServiceSelected(QListWidgetItem* it) { | |||
192 | KConfig cfg(service, KConfig::SimpleConfig); | 197 | KConfig cfg(service, KConfig::SimpleConfig); | ||
193 | 198 | | |||
194 | ComponentDescription->setText(cfg.group(QByteArray()).readEntry("Comment",i18n("No description available"))); | 199 | ComponentDescription->setText(cfg.group(QByteArray()).readEntry("Comment",i18n("No description available"))); | ||
195 | ComponentDescription->setMinimumSize(ComponentDescription->sizeHint()); | 200 | ComponentDescription->setMinimumSize(ComponentDescription->sizeHint()); | ||
196 | 201 | | |||
197 | configWidget = configWidgetMap.value(service); | 202 | configWidget = configWidgetMap.value(service); | ||
198 | if (configWidget) { | 203 | if (configWidget) { | ||
199 | configContainer->setCurrentWidget(configWidget); | 204 | configContainer->setCurrentWidget(configWidget); | ||
200 | dynamic_cast<CfgPlugin*>(configWidget)->load(&cfg); | 205 | const auto plugin = dynamic_cast<CfgPlugin*>(configWidget); | ||
206 | plugin->load(&cfg); | ||||
207 | emit defaulted(plugin->isDefaults()); | ||||
201 | } | 208 | } | ||
202 | 209 | | |||
203 | emitChanged(false); | 210 | emitChanged(false); | ||
204 | latestEditedService = service; | 211 | latestEditedService = service; | ||
205 | } | 212 | } | ||
206 | 213 | | |||
207 | 214 | | |||
208 | void ComponentChooser::emitChanged(bool val) { | 215 | void ComponentChooser::emitChanged(bool val) { | ||
209 | somethingChanged=val; | 216 | somethingChanged=val; | ||
210 | emit changed(val); | 217 | emit changed(val); | ||
218 | | ||||
219 | CfgPlugin *plugin = dynamic_cast<CfgPlugin *>( configWidget ); | ||||
ervin: No spaces between the parenthesis, no space after * | |||||
220 | emit defaulted(plugin->isDefaults()); | ||||
211 | } | 221 | } | ||
212 | 222 | | |||
213 | 223 | | |||
214 | ComponentChooser::~ComponentChooser() | 224 | ComponentChooser::~ComponentChooser() | ||
215 | { | 225 | { | ||
216 | for (QWidget *configWidget : configWidgetMap) { | 226 | for (QWidget *configWidget : configWidgetMap) { | ||
217 | delete configWidget; | 227 | delete configWidget; | ||
218 | } | 228 | } | ||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
No spaces between the parenthesis, no space after *