Commit 164ec20b authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Fixed crash on applying or changing settings

The m_page member used to access the widgets was deleted too early.
Deletion moved to finish() method.
parent 66e9410f
...@@ -116,8 +116,6 @@ QWidget *ShortcutSettings::createPage(QWidget *parent) ...@@ -116,8 +116,6 @@ QWidget *ShortcutSettings::createPage(QWidget *parent)
commandChanged(0); commandChanged(0);
delete m_page;
return w; return w;
} }
...@@ -131,6 +129,8 @@ void ShortcutSettings::finish() ...@@ -131,6 +129,8 @@ void ShortcutSettings::finish()
{ {
qDeleteAll(m_scitems); qDeleteAll(m_scitems);
m_scitems.clear(); m_scitems.clear();
delete m_page;
} }
bool ShortcutSettings::eventFilter(QObject *o, QEvent *e) bool ShortcutSettings::eventFilter(QObject *o, QEvent *e)
......
...@@ -77,7 +77,7 @@ QWidget *GeneralSettings::createPage(QWidget *parent) ...@@ -77,7 +77,7 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
this, SLOT(resetExternalEditor())); this, SLOT(resetExternalEditor()));
connect(m_page->helpExternalEditorButton, SIGNAL(clicked()), connect(m_page->helpExternalEditorButton, SIGNAL(clicked()),
this, SLOT(showHelpForExternalEditor())); this, SLOT(showHelpForExternalEditor()));
delete m_page;
return w; return w;
} }
...@@ -88,6 +88,11 @@ void GeneralSettings::apply() ...@@ -88,6 +88,11 @@ void GeneralSettings::apply()
EditorManager::instance()->setExternalEditor(m_page->externalEditorEdit->text()); EditorManager::instance()->setExternalEditor(m_page->externalEditorEdit->text());
} }
void GeneralSettings::finish()
{
delete m_page;
}
void GeneralSettings::resetInterfaceColor() void GeneralSettings::resetInterfaceColor()
{ {
m_page->colorButton->setColor(0x666666); m_page->colorButton->setColor(0x666666);
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
QString trCategory() const; QString trCategory() const;
QWidget* createPage(QWidget *parent); QWidget* createPage(QWidget *parent);
void apply(); void apply();
void finish() { } void finish();
private slots: private slots:
void resetInterfaceColor(); void resetInterfaceColor();
......
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