Changeset View
Changeset View
Standalone View
Standalone View
src/kcmultidialog.cpp
Show First 20 Lines • Show All 374 Lines • ▼ Show 20 Line(s) | 369 | { | |||
---|---|---|---|---|---|
375 | return true; | 375 | return true; | ||
376 | } | 376 | } | ||
377 | 377 | | |||
378 | void KCMultiDialogPrivate::apply() | 378 | void KCMultiDialogPrivate::apply() | ||
379 | { | 379 | { | ||
380 | Q_Q(KCMultiDialog); | 380 | Q_Q(KCMultiDialog); | ||
381 | QStringList updatedComponents; | 381 | QStringList updatedComponents; | ||
382 | 382 | | |||
383 | foreach (const CreatedModule &module, modules) { | 383 | for (const CreatedModule &module : qAsConst(modules)) { | ||
384 | KCModuleProxy *proxy = module.kcm; | 384 | KCModuleProxy *proxy = module.kcm; | ||
385 | 385 | | |||
386 | if (proxy->changed()) { | 386 | if (proxy->changed()) { | ||
387 | proxy->save(); | 387 | proxy->save(); | ||
388 | /** | 388 | /** | ||
389 | * Add name of the components the kcm belongs to the list | 389 | * Add name of the components the kcm belongs to the list | ||
390 | * of updated components. | 390 | * of updated components. | ||
391 | */ | 391 | */ | ||
392 | const QStringList componentNames = module.componentNames; | 392 | const QStringList componentNames = module.componentNames; | ||
393 | foreach (const QString &componentName, module.componentNames) { | 393 | for (const QString &componentName : componentNames) { | ||
394 | if (!updatedComponents.contains(componentName)) { | 394 | if (!updatedComponents.contains(componentName)) { | ||
395 | updatedComponents.append(componentName); | 395 | updatedComponents.append(componentName); | ||
396 | } | 396 | } | ||
397 | } | 397 | } | ||
398 | } | 398 | } | ||
399 | } | 399 | } | ||
400 | 400 | | |||
401 | // Send the configCommitted signal for every updated component. | 401 | // Send the configCommitted signal for every updated component. | ||
402 | foreach (const QString &name, updatedComponents) { | 402 | for (const QString &name : qAsConst(updatedComponents)) { | ||
403 | emit q->configCommitted(name.toLatin1()); | 403 | emit q->configCommitted(name.toLatin1()); | ||
404 | } | 404 | } | ||
405 | 405 | | |||
406 | emit q->configCommitted(); | 406 | emit q->configCommitted(); | ||
407 | } | 407 | } | ||
408 | 408 | | |||
409 | void KCMultiDialog::slotApplyClicked() | 409 | void KCMultiDialog::slotApplyClicked() | ||
410 | { | 410 | { | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 452 | { | |||
453 | Q_D(KCMultiDialog); | 453 | Q_D(KCMultiDialog); | ||
454 | KPageDialog::closeEvent(event); | 454 | KPageDialog::closeEvent(event); | ||
455 | 455 | | |||
456 | /** | 456 | /** | ||
457 | * If we don't delete them, the DBUS registration stays, and trying to load the KCMs | 457 | * If we don't delete them, the DBUS registration stays, and trying to load the KCMs | ||
458 | * in other situations will lead to "module already loaded in Foo," while to the user | 458 | * in other situations will lead to "module already loaded in Foo," while to the user | ||
459 | * doesn't appear so(the dialog is hidden) | 459 | * doesn't appear so(the dialog is hidden) | ||
460 | */ | 460 | */ | ||
461 | Q_FOREACH(auto &proxy, d->modules) { | 461 | for(auto &proxy : qAsConst(d->modules)) { | ||
462 | proxy.kcm->deleteClient(); | 462 | proxy.kcm->deleteClient(); | ||
463 | } | 463 | } | ||
464 | } | 464 | } | ||
465 | 465 | | |||
466 | KPageWidgetItem *KCMultiDialog::addModule(const QString &path, const QStringList &args) | 466 | KPageWidgetItem *KCMultiDialog::addModule(const QString &path, const QStringList &args) | ||
467 | { | 467 | { | ||
468 | QString complete = path; | 468 | QString complete = path; | ||
469 | 469 | | |||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |