Commit d432db35 authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 366137 - contactthemeeditor crash when closing

BUG: 366137
FIXED-IN: 5.3.0
parent 8f55e2f7
......@@ -50,6 +50,10 @@ ContactEditorMainWindow::ContactEditorMainWindow()
}
ContactEditorMainWindow::~ContactEditorMainWindow()
{
}
void ContactEditorMainWindow::writeConfig()
{
KSharedConfig::Ptr config = KSharedConfig::openConfig();
......@@ -287,6 +291,7 @@ void ContactEditorMainWindow::closeEvent(QCloseEvent *e)
if (!saveCurrentProject(SaveAndCloseTheme)) {
e->ignore();
} else {
writeConfig();
e->accept();
}
}
......@@ -294,6 +299,7 @@ void ContactEditorMainWindow::closeEvent(QCloseEvent *e)
void ContactEditorMainWindow::slotQuitApp()
{
if (saveCurrentProject(SaveAndCloseTheme)) {
writeConfig();
qApp->quit();
}
}
......
......@@ -60,6 +60,7 @@ private:
SaveAndCreateNewTheme
};
void writeConfig();
bool loadTheme(const QString &directory);
void readConfig();
void updateActions();
......
......@@ -66,6 +66,5 @@ int main(int argc, char **argv)
ContactEditorMainWindow *mw = new ContactEditorMainWindow();
mw->show();
const int ret = app.exec();
delete mw;
return ret;
}
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