summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2012-06-27 19:07:05 +0000
committerSebastian Dransfeld <sd@tango.flipp.net>2012-06-27 19:07:05 +0000
commit851f2fc1362a3d4082a699ea41965c5732b79c35 (patch)
tree478d5bcdee0b5a787e5d3e54f5c46cdc5eabea64 /legacy
parentd48eb2a95408f34078363460df307116ef358372 (diff)
efreet: Fix missing cache info
If a desktop was in the regular cache because of direct access, and then added by a change in XDG_DATA_DIRS it wouldn't end in the utils cache unless something triggered a complete cache rebuild. SVN revision: 72962
Diffstat (limited to 'legacy')
-rw-r--r--legacy/efreet/src/bin/efreet_desktop_cache_create.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/legacy/efreet/src/bin/efreet_desktop_cache_create.c b/legacy/efreet/src/bin/efreet_desktop_cache_create.c
index 16a632201b..21f2922179 100644
--- a/legacy/efreet/src/bin/efreet_desktop_cache_create.c
+++ b/legacy/efreet/src/bin/efreet_desktop_cache_create.c
@@ -23,8 +23,9 @@ static Eet_File *util_ef = NULL;
23 23
24static Eina_Hash *desktops = NULL; 24static Eina_Hash *desktops = NULL;
25 25
26static Eina_Hash *file_ids = NULL; 26static Eina_Hash *file_ids = NULL;
27static Eina_Hash *paths = NULL; 27static Efreet_Cache_Hash *old_file_ids = NULL;
28static Eina_Hash *paths = NULL;
28 29
29static Eina_Hash *mime_types = NULL; 30static Eina_Hash *mime_types = NULL;
30static Eina_Hash *categories = NULL; 31static Eina_Hash *categories = NULL;
@@ -69,6 +70,11 @@ cache_add(const char *path, const char *file_id, int priority __UNUSED__, int *c
69 else INF(" NO UNCACHED"); 70 else INF(" NO UNCACHED");
70 } 71 }
71 if (!desk) return 1; 72 if (!desk) return 1;
73 if (file_id && old_file_ids && !eina_hash_find(old_file_ids->hash, file_id))
74 {
75 *changed = 1;
76 INF(" NOT IN UTILS");
77 }
72 if (!eina_hash_find(paths, desk->orig_path)) 78 if (!eina_hash_find(paths, desk->orig_path))
73 { 79 {
74 if (!eet_data_write(ef, edd, desk->orig_path, desk, 0)) 80 if (!eet_data_write(ef, edd, desk->orig_path, desk, 0))
@@ -281,6 +287,13 @@ main(int argc, char **argv)
281 eet_close(ef); 287 eet_close(ef);
282 } 288 }
283 289
290 ef = eet_open(efreet_desktop_util_cache_file(), EET_FILE_MODE_READ);
291 if (ef)
292 {
293 old_file_ids = eet_data_read(ef, efreet_hash_string_edd(), "file_id");
294 eet_close(ef);
295 }
296
284 /* create cache */ 297 /* create cache */
285 snprintf(file, sizeof(file), "%s.XXXXXX", efreet_desktop_cache_file()); 298 snprintf(file, sizeof(file), "%s.XXXXXX", efreet_desktop_cache_file());
286 tmpfd = mkstemp(file); 299 tmpfd = mkstemp(file);
@@ -367,10 +380,7 @@ main(int argc, char **argv)
367 } 380 }
368 381
369 if (user_dirs) 382 if (user_dirs)
370 { 383 efreet_cache_array_string_free(user_dirs);
371 IF_FREE(user_dirs->array);
372 free(user_dirs);
373 }
374 384
375 /* store user dirs */ 385 /* store user dirs */
376 if (store_dirs) 386 if (store_dirs)
@@ -428,6 +438,12 @@ main(int argc, char **argv)
428 eina_hash_free(comment); 438 eina_hash_free(comment);
429 eina_hash_free(exec); 439 eina_hash_free(exec);
430 440
441 if (old_file_ids)
442 {
443 eina_hash_free(old_file_ids->hash);
444 free(old_file_ids);
445 }
446
431 eina_hash_free(file_ids); 447 eina_hash_free(file_ids);
432 eina_hash_free(paths); 448 eina_hash_free(paths);
433 449
@@ -501,6 +517,11 @@ error:
501 IF_FREE(dir); 517 IF_FREE(dir);
502edd_error: 518edd_error:
503 if (user_dirs) efreet_cache_array_string_free(user_dirs); 519 if (user_dirs) efreet_cache_array_string_free(user_dirs);
520 if (old_file_ids)
521 {
522 eina_hash_free(old_file_ids->hash);
523 free(old_file_ids);
524 }
504 efreet_shutdown(); 525 efreet_shutdown();
505efreet_error: 526efreet_error:
506 ecore_shutdown(); 527 ecore_shutdown();