| 101 | } |
| 102 | |
| 103 | void ConfigPage::setConfigSkeleton(KCoreConfigSkeleton* skel) |
| 104 | { |
| 105 | Q_D(ConfigPage); |
| 106 | |
| 107 | if (d->configSkeleton == skel) { |
| 108 | return; |
| 109 | } |
| 110 | d->configSkeleton = skel; |
| 111 | if (!skel) { |
| 112 | d->configManager.reset(); |
| 113 | return; |
| 114 | } |
| 115 | // create the config dialog manager if it didn't exist or recreate it. |
| 116 | // This is needed because the used config skeleton has changed |
| 117 | // and no setter for that exists in KConfigDialogManager |
| 118 | d->configManager.reset(new KConfigDialogManager(this, d->configSkeleton)); |
| 119 | connect(d->configManager.data(), &KConfigDialogManager::widgetModified, this, &ConfigPage::changed); |
| 120 | // d->configManager->addWidget(this) must be called from the config dialog, |
| 121 | // since the widget tree is probably not complete when calling this function |
| 122 | } |
| 123 | |
| 124 | |
| 125 | int ConfigPage::childPages() const |