From f2ec64b1f4e0a7c10c5d313f0d2a380e5d6da4a1 Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Fri, 10 Jul 2015 11:18:19 +0900 Subject: [PATCH] ui: modified qt5_destroy change the MRU file name(.skin.properties -> gui.property) add some clean up process comment out the top level window deleting line temporary (to avoid segmentation fault when exit) Change-Id: I848c5e762b4620b98071a963756ec690490e0ce9 Signed-off-by: GiWoong Kim --- tizen/src/display/qt5_supplement.cpp | 35 +++++++++++++++++++--------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp index 05cb1cb2b7..3db48b8dda 100644 --- a/tizen/src/display/qt5_supplement.cpp +++ b/tizen/src/display/qt5_supplement.cpp @@ -62,7 +62,7 @@ static void (*captureRequestHandler)(void *); static MainWindow *mainwindow; static UIInformation *uiInfo; -#define SKIN_PROPERTIES_FILE_NAME ".skin.properties" +#define GUI_PROPERTIES_FILE_NAME "gui.property" #define SKIN_PROPERTY_WINDOW_X "window.x" #define SKIN_PROPERTY_WINDOW_Y "window.y" #define SKIN_PROPERTY_WINDOW_SCALE "window.scale" @@ -121,9 +121,9 @@ void qt5_gui_init(void) } uiInfo->skinName = skinName; - /* read MRU information */ - QSettings mruInfo(uiInfo->vmDataPath + SKIN_PROPERTIES_FILE_NAME, - QSettings::IniFormat); + /* open most recently used data information file */ + const QSettings mruInfo( + uiInfo->vmDataPath + GUI_PROPERTIES_FILE_NAME, QSettings::IniFormat); /* XML layout */ QFile mainXMLFile(uiInfo->skinPath + FORM_FILE_NAME); @@ -250,9 +250,11 @@ void qt5_destroy() { qDebug("qt5 destroy"); - /* write MRU information */ - QSettings mruInfo(uiInfo->vmDataPath + SKIN_PROPERTIES_FILE_NAME, - QSettings::IniFormat); + /* write most recently used data information */ + QString path(uiInfo->vmDataPath + GUI_PROPERTIES_FILE_NAME); + qDebug() << "save MRU data:" << path; + + QSettings mruInfo(path, QSettings::IniFormat); mruInfo.setValue(SKIN_PROPERTY_WINDOW_X, mainwindow->pos().x()); mruInfo.setValue(SKIN_PROPERTY_WINDOW_Y, mainwindow->pos().y()); mruInfo.setValue(SKIN_PROPERTY_WINDOW_SCALE, uiInfo->uiState.mainFormScale); @@ -266,13 +268,24 @@ void qt5_destroy() mruInfo.setValue(SKIN_PROPERTY_CONTROLLER_DOCK, 0); } + mruInfo.sync(); + /* clean up */ - mainwindow->terminateDisplaySwapper(); + qt5App->flush(); + mainwindow->closeController(); + mainwindow->terminateDisplaySwapper(); + + qt5App->processEvents(QEventLoop::ExcludeUserInputEvents); + qt5App->quit(); - delete uiInfo; - delete mainwindow; - delete qt5App; + //TODO: fix me + //delete mainwindow; + + if (uiInfo) { + delete uiInfo; + uiInfo = NULL; + } } void qt5_early_prepare(bool isOnscreen) -- 2.34.1