From: Rahul Dadhich Date: Thu, 7 Jul 2016 04:25:39 +0000 (+0530) Subject: Sving the selected file info X-Git-Tag: submit/tizen_mobile/20160707.043958^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f7b542aa2c1b0c201e3b6a859d0916f1d47780b;p=profile%2Fmobile%2Fapps%2Fnative%2Fgallery.git Sving the selected file info Change-Id: I5aa9e76f42a641e7463cc93efd3f1366c3b2809c Signed-off-by: Rahul Dadhich --- diff --git a/widget/src/gl_widget_create.c b/widget/src/gl_widget_create.c index 5dcea87..5b3c975 100644 --- a/widget/src/gl_widget_create.c +++ b/widget/src/gl_widget_create.c @@ -564,7 +564,12 @@ static void gl_widget_result_cb(app_control_h request, app_control_h reply, int j = 0; char buffer[100] = {0,}; - char *dbPath = "/opt/usr/media/selectedimages.eet"; + char *data_path = app_get_data_path(); + char dbPath[1024] = { 0, }; + if (data_path) { + snprintf(dbPath, 1024, "%s%s", data_path, "selectedimages.eet"); + free(data_path); + } Eet_File *fp = NULL; app_control_get_extra_data_array(reply, APP_CONTROL_DATA_PATH, @@ -786,7 +791,12 @@ Eina_Bool gl_widget_load_preselected_images(_widget_data *widget_data) return -1; } - char *dbPath = "/opt/usr/media/selectedimages.eet"; + char *data_path = app_get_data_path(); + char dbPath[1024] = { 0, }; + if (data_path) { + snprintf(dbPath, 1024, "%s%s", data_path, "selectedimages.eet"); + free(data_path); + } Eet_File *fp = NULL; fp = eet_open(dbPath, EET_FILE_MODE_READ); diff --git a/widget/src/gl_widget_main.c b/widget/src/gl_widget_main.c index b952b49..c80d3e8 100644 --- a/widget/src/gl_widget_main.c +++ b/widget/src/gl_widget_main.c @@ -111,7 +111,14 @@ int widget_Destroy(widget_context_h context, widget_app_destroy_type_e reason, b } free(widget_data); - remove("/opt/usr/media/selectedimages.eet"); + char *data_path = app_get_data_path(); + if (data_path) { + char dbPath[1024] = { 0, }; + + snprintf(dbPath, 1024, "%s%s", data_path, "selectedimages.eet"); + remove(dbPath); + free(data_path); + } return WIDGET_ERROR_NONE; }