Commit fc0ac3f1 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

fix memleak an remove QFrame usage

KTextEditor::ConfigPages for the editor don't have that either
parent babddfb1
...@@ -268,21 +268,13 @@ void KateConfigDialog::addEditorPages() ...@@ -268,21 +268,13 @@ void KateConfigDialog::addEditorPages()
void KateConfigDialog::addPluginPage(KTextEditor::Plugin *plugin) void KateConfigDialog::addPluginPage(KTextEditor::Plugin *plugin)
{ {
for (int i = 0; i < plugin->configPages(); i++) { for (int i = 0; i < plugin->configPages(); i++) {
QFrame *page = new QFrame(); KTextEditor::ConfigPage *cp = plugin->configPage(i, this);
QVBoxLayout *layout = new QVBoxLayout(page); KPageWidgetItem *item = addPage(cp, cp->name());
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
KTextEditor::ConfigPage *cp = plugin->configPage(i, page);
page->layout()->addWidget(cp);
KPageWidgetItem *item = addPage(page, cp->name());
item->setHeader(cp->fullName()); item->setHeader(cp->fullName());
item->setIcon(cp->icon()); item->setIcon(cp->icon());
PluginPageListItem *info = new PluginPageListItem; PluginPageListItem *info = new PluginPageListItem;
info->plugin = plugin; info->plugin = plugin;
info->pageParent = page;
info->pluginPage = cp; info->pluginPage = cp;
info->idInPlugin = i; info->idInPlugin = i;
info->pageWidgetItem = item; info->pageWidgetItem = item;
...@@ -309,7 +301,6 @@ void KateConfigDialog::removePluginPage(KTextEditor::Plugin *plugin) ...@@ -309,7 +301,6 @@ void KateConfigDialog::removePluginPage(KTextEditor::Plugin *plugin)
KPageWidgetItem *wItem = remove.takeLast(); KPageWidgetItem *wItem = remove.takeLast();
PluginPageListItem *pItem = m_pluginPages.take(wItem); PluginPageListItem *pItem = m_pluginPages.take(wItem);
delete pItem->pluginPage; delete pItem->pluginPage;
delete pItem->pageParent;
removePage(wItem); removePage(wItem);
delete pItem; delete pItem;
} }
......
...@@ -34,7 +34,6 @@ struct PluginPageListItem { ...@@ -34,7 +34,6 @@ struct PluginPageListItem {
KTextEditor::Plugin *plugin; KTextEditor::Plugin *plugin;
int idInPlugin; int idInPlugin;
KTextEditor::ConfigPage *pluginPage; KTextEditor::ConfigPage *pluginPage;
QWidget *pageParent;
KPageWidgetItem *pageWidgetItem; KPageWidgetItem *pageWidgetItem;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment