summaryrefslogtreecommitdiff
path: root/legacy/efreet
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2012-08-08 19:39:55 +0000
committerSebastian Dransfeld <sd@tango.flipp.net>2012-08-08 19:39:55 +0000
commit7fa09b763bee3d4b76b98d9796e1cde12b448aca (patch)
tree77d6cf52e58e46944fcca84754b954368f510662 /legacy/efreet
parent3bcdd78bca37a770d388b6c4777b147331ac003a (diff)
efreet: Fix language change
Need to release generated file name, else we will use same filename again when opening cache. Also need to close cache, as a cache rebuild might not trigger cache close if the cache in another language already exists. SVN revision: 75020
Diffstat (limited to 'legacy/efreet')
-rw-r--r--legacy/efreet/src/lib/efreet.c1
-rw-r--r--legacy/efreet/src/lib/efreet_cache.c63
-rw-r--r--legacy/efreet/src/lib/efreet_private.h1
3 files changed, 39 insertions, 26 deletions
diff --git a/legacy/efreet/src/lib/efreet.c b/legacy/efreet/src/lib/efreet.c
index 906d8794ee..c48223f37a 100644
--- a/legacy/efreet/src/lib/efreet.c
+++ b/legacy/efreet/src/lib/efreet.c
@@ -186,6 +186,7 @@ efreet_lang_reset(void)
186 efreet_parsed_locale = 0; /* reset this in case they init efreet again */ 186 efreet_parsed_locale = 0; /* reset this in case they init efreet again */
187 187
188 efreet_dirs_reset(); 188 efreet_dirs_reset();
189 efreet_cache_desktop_close();
189 efreet_cache_desktop_update(); 190 efreet_cache_desktop_update();
190} 191}
191 192
diff --git a/legacy/efreet/src/lib/efreet_cache.c b/legacy/efreet/src/lib/efreet_cache.c
index 9e84fbc32c..a53c8e1bab 100644
--- a/legacy/efreet/src/lib/efreet_cache.c
+++ b/legacy/efreet/src/lib/efreet_cache.c
@@ -953,6 +953,42 @@ efreet_cache_desktop_update(void)
953} 953}
954 954
955void 955void
956efreet_cache_desktop_close(void)
957{
958 IF_RELEASE(util_cache_names_key);
959 IF_RELEASE(util_cache_hash_key);
960
961 if ((desktop_cache) && (desktop_cache != NON_EXISTING))
962 {
963 Efreet_Old_Cache *d = NEW(Efreet_Old_Cache, 1);
964 if (d)
965 {
966 d->hash = desktops;
967 d->ef = desktop_cache;
968 old_desktop_caches = eina_list_append(old_desktop_caches, d);
969 }
970
971 desktops = eina_hash_string_superfast_new(NULL);
972 }
973 desktop_cache = NULL;
974
975 efreet_cache_array_string_free(util_cache_names);
976 util_cache_names = NULL;
977
978 if (util_cache_hash)
979 {
980 eina_hash_free(util_cache_hash->hash);
981 free(util_cache_hash);
982 util_cache_hash = NULL;
983 }
984
985 util_cache = efreet_cache_close(util_cache);
986
987 IF_RELEASE(desktop_cache_file);
988 IF_RELEASE(util_cache_file);
989}
990
991void
956efreet_cache_icon_update(void) 992efreet_cache_icon_update(void)
957{ 993{
958 if (!efreet_cache_update) return; 994 if (!efreet_cache_update) return;
@@ -1118,32 +1154,7 @@ cache_update_cb(void *data __UNUSED__, Ecore_File_Monitor *em __UNUSED__,
1118 ev = NEW(Efreet_Event_Cache_Update, 1); 1154 ev = NEW(Efreet_Event_Cache_Update, 1);
1119 if (!ev) goto error; 1155 if (!ev) goto error;
1120 1156
1121 IF_RELEASE(util_cache_names_key); 1157 efreet_cache_desktop_close();
1122 IF_RELEASE(util_cache_hash_key);
1123
1124 if ((desktop_cache) && (desktop_cache != NON_EXISTING))
1125 {
1126 d = NEW(Efreet_Old_Cache, 1);
1127 if (!d) goto error;
1128 d->hash = desktops;
1129 d->ef = desktop_cache;
1130 old_desktop_caches = eina_list_append(old_desktop_caches, d);
1131
1132 desktops = eina_hash_string_superfast_new(NULL);
1133 }
1134 desktop_cache = NULL;
1135
1136 efreet_cache_array_string_free(util_cache_names);
1137 util_cache_names = NULL;
1138
1139 if (util_cache_hash)
1140 {
1141 eina_hash_free(util_cache_hash->hash);
1142 free(util_cache_hash);
1143 util_cache_hash = NULL;
1144 }
1145
1146 util_cache = efreet_cache_close(util_cache);
1147 1158
1148 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, ev, desktop_cache_update_free, d); 1159 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, ev, desktop_cache_update_free, d);
1149 } 1160 }
diff --git a/legacy/efreet/src/lib/efreet_private.h b/legacy/efreet/src/lib/efreet_private.h
index 131785b176..ac43c4a3a5 100644
--- a/legacy/efreet/src/lib/efreet_private.h
+++ b/legacy/efreet/src/lib/efreet_private.h
@@ -195,6 +195,7 @@ const char *efreet_lang_modifier_get(void);
195size_t efreet_array_cat(char *buffer, size_t size, const char *strs[]); 195size_t efreet_array_cat(char *buffer, size_t size, const char *strs[]);
196 196
197void efreet_cache_desktop_update(void); 197void efreet_cache_desktop_update(void);
198void efreet_cache_desktop_close(void);
198void efreet_cache_icon_update(void); 199void efreet_cache_icon_update(void);
199 200
200Efreet_Desktop *efreet_cache_desktop_find(const char *file); 201Efreet_Desktop *efreet_cache_desktop_find(const char *file);