[TSAM-5921] Resetting the ug launch flag if image deleted 21/79221/2
authorRahul Dadhich <r.dadhich@samsung.com>
Sat, 9 Jul 2016 04:24:46 +0000 (09:54 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Sat, 9 Jul 2016 04:29:51 +0000 (09:59 +0530)
Change-Id: Id01a7ad099a4bb7f220b4886f7841fd186901e1f
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
widget/src/gl_widget_create.c

index 5b3c975..d3e464c 100644 (file)
@@ -83,6 +83,17 @@ void gl_widget_app_get_resource(const char *edj_file_in, char *edj_path_out,
        }
 }
 
+int gl_widget_file_exists(const char *path)
+{
+       struct stat info = {0,};
+
+       if (stat(path, &info) == 0) {
+               return 1;
+       } else {
+               return 0;
+       }
+}
+
 void _gl_launch_iv(void *data, Evas_Object *obj, void *event_info)
 {
        if (!obj) {
@@ -117,22 +128,15 @@ void _gl_launch_iv(void *data, Evas_Object *obj, void *event_info)
                } else {
                        DbgPrint("ug already launched");
                }
+               if (!gl_widget_file_exists(file_name)) {
+                       DbgPrint("file deleted, resetting the flag");
+                       widget_data->is_ug_launched = false;
+               }
        } else {
                ErrPrint("image path could not be retrieved");
        }
 }
 
-int gl_widget_file_exists(const char *path)
-{
-       struct stat info = {0,};
-
-       if (stat(path, &info) == 0) {
-               return 1;
-       } else {
-               return 0;
-       }
-}
-
 static Eina_Bool gl_widget_animator_cb(void *data)
 {
        dlog_print(DLOG_ERROR, LOG_TAG, "ENTRY gl_widget_animator_cb");