From be19da189abfff78acc85fb9551cbf9a573fad38 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 15 Dec 2015 14:56:29 +0100 Subject: [PATCH] fixed user settings not being saved when last document window is closed while user settings window is still open --- apps/opencs/view/prefs/dialogue.cpp | 6 ++++++ apps/opencs/view/prefs/dialogue.hpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/apps/opencs/view/prefs/dialogue.cpp b/apps/opencs/view/prefs/dialogue.cpp index 97a36306f..f04092653 100644 --- a/apps/opencs/view/prefs/dialogue.cpp +++ b/apps/opencs/view/prefs/dialogue.cpp @@ -71,6 +71,12 @@ CSVPrefs::Dialogue::Dialogue() buildContentArea (main); } +CSVPrefs::Dialogue::~Dialogue() +{ + if (isVisible()) + CSMPrefs::State::get().save(); +} + void CSVPrefs::Dialogue::closeEvent (QCloseEvent *event) { QMainWindow::closeEvent (event); diff --git a/apps/opencs/view/prefs/dialogue.hpp b/apps/opencs/view/prefs/dialogue.hpp index 3965800db..fc66892c8 100644 --- a/apps/opencs/view/prefs/dialogue.hpp +++ b/apps/opencs/view/prefs/dialogue.hpp @@ -31,6 +31,8 @@ namespace CSVPrefs Dialogue(); + virtual ~Dialogue(); + protected: void closeEvent (QCloseEvent *event);