From e286369ad776a18466c06cefec5d206efd2f1aaf Mon Sep 17 00:00:00 2001 From: englebass Date: Thu, 27 Jan 2011 20:21:16 +0000 Subject: [PATCH] Write version before entries check Otherwise we will always get changed == 1 git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@56329 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/efreet_desktop_cache_create.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/bin/efreet_desktop_cache_create.c b/src/bin/efreet_desktop_cache_create.c index 9e9e4d1..8a87ee0 100644 --- a/src/bin/efreet_desktop_cache_create.c +++ b/src/bin/efreet_desktop_cache_create.c @@ -364,6 +364,14 @@ main(int argc, char **argv) eina_hash_free(file_ids); eina_hash_free(paths); + /* write cache version */ + version.major = EFREET_DESKTOP_UTILS_CACHE_MAJOR; + version.minor = EFREET_DESKTOP_UTILS_CACHE_MINOR; + eet_data_write(util_ef, efreet_version_edd(), EFREET_CACHE_VERSION, &version, 1); + version.major = EFREET_DESKTOP_CACHE_MAJOR; + version.minor = EFREET_DESKTOP_CACHE_MINOR; + eet_data_write(ef, efreet_version_edd(), EFREET_CACHE_VERSION, &version, 1); + /* check if old and new caches contain the same number of entries */ if (!changed) { @@ -379,12 +387,6 @@ main(int argc, char **argv) } /* cleanup */ - version.major = EFREET_DESKTOP_UTILS_CACHE_MAJOR; - version.minor = EFREET_DESKTOP_UTILS_CACHE_MINOR; - eet_data_write(util_ef, efreet_version_edd(), EFREET_CACHE_VERSION, &version, 1); - version.major = EFREET_DESKTOP_CACHE_MAJOR; - version.minor = EFREET_DESKTOP_CACHE_MINOR; - eet_data_write(ef, efreet_version_edd(), EFREET_CACHE_VERSION, &version, 1); eet_close(util_ef); eet_close(ef); @@ -410,6 +412,7 @@ main(int argc, char **argv) } /* touch update file */ + /* TODO: We need to signal whether the cache was updated or not */ snprintf(file, sizeof(file), "%s/efreet/desktop_data.update", efreet_cache_home_get()); tmpfd = open(file, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); if (tmpfd >= 0) -- 2.7.4