diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2018-10-17 10:12:42 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2018-10-17 09:20:03 +0000 |
commit | 39670e3dde7c72b00d84d89fc6af48f8b091270b (patch) | |
tree | b6568dee8a970b4e135780b4213260e6c743e348 /src/Authoring/Studio/MainFrm.cpp | |
parent | 54959f67c61993cc60275b7208466c715e959a31 (diff) |
Fix crash on exit
Saving preferences failed on macOS, causing the crash.
Now preferences are saved each time preference dialog
is closed, or a recent item is added or changes.
Also changed the preference folder into a more
describing one instead of the old Qt3DSComposer, which
is not used anywhere else in code or docs.
Task-number: QT3DS-2499
Change-Id: I1f725e246c3fd491aa9600ddf0503e96af6ed1de
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Diffstat (limited to 'src/Authoring/Studio/MainFrm.cpp')
-rw-r--r-- | src/Authoring/Studio/MainFrm.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Authoring/Studio/MainFrm.cpp b/src/Authoring/Studio/MainFrm.cpp index 280cca70..8b7b5644 100644 --- a/src/Authoring/Studio/MainFrm.cpp +++ b/src/Authoring/Studio/MainFrm.cpp @@ -917,10 +917,16 @@ void CMainFrame::EditPreferences(short inPageIndex) (float)CStudioPreferences::DEFAULT_SELECTOR_LENGTH); RecheckSizingMode(); + + // Save preferences, to make sure we do not lose them on a possible crash + QTimer::singleShot(0, [](){ CStudioPreferences::savePreferences(); }); } else if (thePrefsReturn == PREFS_RESET_LAYOUT) { onViewResetLayout(); } else if (thePrefsReturn == PREFS_SETTINGS_RESTART) { QTimer::singleShot(0, this, &CMainFrame::handleRestart); + } else if (thePrefsReturn != 0) { + // Save preferences, to make sure we do not lose them on a possible crash + QTimer::singleShot(0, [](){ CStudioPreferences::savePreferences(); }); } } |