edje: check that the file on disk didn't change when we try to reopen it.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 9 May 2012 07:30:59 +0000 (07:30 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 9 May 2012 07:30:59 +0000 (07:30 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@70883 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
NEWS
src/lib/edje_load.c

index aa22a7d..2fa15b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2012-05-09  Cedric Bail
 
        * Fix bug in case of nesting edje_object_signal_emit and edje_object_signal_callback_{add,del}
+       * Check that the file changed on disk when trying to reopen it.
+
diff --git a/NEWS b/NEWS
index c9bc3e9..2ca5c75 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Improvements:
 Fixes:
     * Add missing files in the tarballs.
     * Prevent crash when running nested edje_object_signal_emit with edje_object_signal_callback_{add,del}.
+    * Do actually verify that the file on disk is different from the file we have loaded.
 
 Edje 1.2.0
 
index fc2aea3..8cb823c 100644 (file)
@@ -290,8 +290,16 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
    if (!file) file = "";
    if (!group) group = "";
    if (((ed->path) && (!strcmp(file, ed->path))) &&
-       (ed->group) && (!strcmp(group, ed->group)))
-     return 1;
+       (ed->group) && (!strcmp(group, ed->group)) &&
+       ed->file)
+     {
+        struct stat st;
+
+        if (stat(file, &st) != 0)
+          return 1;
+        if (st.st_mtime == ed->file->mtime)
+          return 1;
+     }
 
    tev = evas_object_evas_get(obj);
    evas_event_freeze(tev);
@@ -299,6 +307,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
 
    if (_edje_script_only(ed)) _edje_script_only_shutdown(ed);
    if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed);
+
    _edje_file_del(ed);
 
    eina_stringshare_replace(&ed->path, file);