summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-11-16 12:58:34 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-11-16 13:02:10 +0000
commit7096634a3969fdef8e8b3d13a70d034cc0ea41e8 (patch)
treeaaf0d50bbee02d2e4548583db14d1f36bfff726a
parentf8cf378868cd12f870f2eee2100b96b72c5bb08c (diff)
efreet - consider ctime changes as changes too
some distros do odd things with source desktop files and set their mtime timestamps to 0... thus we can't tell that there is a change. thier ctimes do change, so consider the newer of either of these as the modification time to not miss updates @fix
-rw-r--r--src/bin/efreet/efreet_desktop_cache_create.c21
-rw-r--r--src/lib/efreet/efreet_desktop.c12
2 files changed, 26 insertions, 7 deletions
diff --git a/src/bin/efreet/efreet_desktop_cache_create.c b/src/bin/efreet/efreet_desktop_cache_create.c
index ec7553dcc8..8988168e94 100644
--- a/src/bin/efreet/efreet_desktop_cache_create.c
+++ b/src/bin/efreet/efreet_desktop_cache_create.c
@@ -70,13 +70,22 @@ cache_add(Eet_File *ef, const char *path, const char *file_id, int priority EINA
70 *changed = 1; 70 *changed = 1;
71 INF(" NEW"); 71 INF(" NEW");
72 } 72 }
73 else if (ecore_file_mod_time(desk->orig_path) != desk->load_time) 73 else
74 { 74 {
75 efreet_desktop_free(desk); 75 struct stat st;
76 *changed = 1; 76 if (!stat(desk->orig_path, &st))
77 desk = efreet_desktop_uncached_new(path); 77 {
78 if (desk) INF(" CHANGED"); 78 time_t modtime = st.st_mtime;
79 else INF(" NO UNCACHED"); 79 if (modtime < st.st_ctime) modtime = st.st_ctime;
80 if (modtime != desk->load_time)
81 {
82 efreet_desktop_free(desk);
83 *changed = 1;
84 desk = efreet_desktop_uncached_new(path);
85 if (desk) INF(" CHANGED");
86 else INF(" NO UNCACHED");
87 }
88 }
80 } 89 }
81 if (!desk) return 1; 90 if (!desk) return 1;
82 if (file_id && old_file_ids && !eina_hash_find(old_file_ids->hash, file_id)) 91 if (file_id && old_file_ids && !eina_hash_find(old_file_ids->hash, file_id))
diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c
index e56d06c908..f0c46d4c33 100644
--- a/src/lib/efreet/efreet_desktop.c
+++ b/src/lib/efreet/efreet_desktop.c
@@ -218,7 +218,17 @@ efreet_desktop_empty_new(const char *file)
218 if (!desktop) return NULL; 218 if (!desktop) return NULL;
219 219
220 desktop->orig_path = strdup(file); 220 desktop->orig_path = strdup(file);
221 desktop->load_time = ecore_file_mod_time(file); 221 do
222 {
223 struct stat st;
224
225 if (!stat(desktop->orig_path, &st))
226 {
227 time_t modtime = st.st_mtime;
228 if (modtime < st.st_ctime) modtime = st.st_ctime;
229 desktop->load_time = modtime;
230 }
231 } while (0);
222 232
223 desktop->ref = 1; 233 desktop->ref = 1;
224 234