| 120 | } |
| 121 | |
| 122 | void ConfigDialog::removePagesForPlugin(IPlugin* plugin) |
| 123 | { |
| 124 | Q_ASSERT(plugin); |
| 125 | const auto oldPages = m_pages; |
| 126 | for (auto&& item : oldPages) { |
| 127 | if (!item) { |
| 128 | continue; |
| 129 | } |
| 130 | auto page = qobject_cast<ConfigPage*>(item->widget()); |
| 131 | if (page && page->plugin() == plugin) { |
| 132 | removePage(item); // this also deletes the config page -> QPointer is set to null |
| 133 | } |
| 134 | }; |
| 135 | // also remove all items that were deleted because a parent KPageWidgetItem was removed |
| 136 | m_pages.removeAll(QPointer<KPageWidgetItem>()); |
| 137 | } |
| 138 | |
| 139 | void ConfigDialog::appendConfigPage(ConfigPage* page) |
| 140 | { |