Sving the selected file info 27/78827/1 submit/tizen_mobile/20160707.043958 submit/tizen_mobile/20160707.123450
authorRahul Dadhich <r.dadhich@samsung.com>
Thu, 7 Jul 2016 04:25:39 +0000 (09:55 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Thu, 7 Jul 2016 04:25:39 +0000 (09:55 +0530)
Change-Id: I5aa9e76f42a641e7463cc93efd3f1366c3b2809c
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
widget/src/gl_widget_create.c
widget/src/gl_widget_main.c

index 5dcea87..5b3c975 100644 (file)
@@ -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);
index b952b49..c80d3e8 100644 (file)
@@ -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;
 }