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
This commit is contained in:
Carsten Haitzler 2019-11-16 12:58:34 +00:00
parent f8cf378868
commit 7096634a39
2 changed files with 26 additions and 7 deletions

View File

@ -70,13 +70,22 @@ cache_add(Eet_File *ef, const char *path, const char *file_id, int priority EINA
*changed = 1;
INF(" NEW");
}
else if (ecore_file_mod_time(desk->orig_path) != desk->load_time)
else
{
efreet_desktop_free(desk);
*changed = 1;
desk = efreet_desktop_uncached_new(path);
if (desk) INF(" CHANGED");
else INF(" NO UNCACHED");
struct stat st;
if (!stat(desk->orig_path, &st))
{
time_t modtime = st.st_mtime;
if (modtime < st.st_ctime) modtime = st.st_ctime;
if (modtime != desk->load_time)
{
efreet_desktop_free(desk);
*changed = 1;
desk = efreet_desktop_uncached_new(path);
if (desk) INF(" CHANGED");
else INF(" NO UNCACHED");
}
}
}
if (!desk) return 1;
if (file_id && old_file_ids && !eina_hash_find(old_file_ids->hash, file_id))

View File

@ -218,7 +218,17 @@ efreet_desktop_empty_new(const char *file)
if (!desktop) return NULL;
desktop->orig_path = strdup(file);
desktop->load_time = ecore_file_mod_time(file);
do
{
struct stat st;
if (!stat(desktop->orig_path, &st))
{
time_t modtime = st.st_mtime;
if (modtime < st.st_ctime) modtime = st.st_ctime;
desktop->load_time = modtime;
}
} while (0);
desktop->ref = 1;