summaryrefslogtreecommitdiff
path: root/src/bin/efreet/efreetd_cache.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-04-13 09:38:35 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-04-13 09:45:29 +0900
commite05eb13f702c3addb4ac6261ff5a84f2cf4fd065 (patch)
treea54633d9660e5e095937e035caa668f1e4f79892 /src/bin/efreet/efreetd_cache.c
parent6b493430df51eb7b89910c86bec6497a2c6eea53 (diff)
efreetd - fix loading of extra_icons.dirs and icon.exts to not lose char
efreetd was losing the last char on every line of extra_icon.dirs and icon.exts thus resulting in gradual degredation of these files as more and more changes happen to have things like: .jpeg .jpe .jp .j . etc. for extension or dirs like /home/raster/.e/e/icons /home/raster/.e/e/icon /home/raster/.e/e/ico ... /home/ras /home/ra /home/r ... /ho /h / .. you get the idea. before long the list of extra icon dirs (and extensions) was massigve and caued all sorts of filesystem rummaging. this fixes that to no longer degrade these files. this also changes their names to force new files to be used instead of the broken old ones.
Diffstat (limited to 'src/bin/efreet/efreetd_cache.c')
-rw-r--r--src/bin/efreet/efreetd_cache.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/bin/efreet/efreetd_cache.c b/src/bin/efreet/efreetd_cache.c
index 21c21b69a8..76be7bff1a 100644
--- a/src/bin/efreet/efreetd_cache.c
+++ b/src/bin/efreet/efreetd_cache.c
@@ -677,8 +677,8 @@ fill_list(const char *file, Eina_List **l)
677 { 677 {
678 if (line->end > line->start) 678 if (line->end > line->start)
679 { 679 {
680 const char *end = line->end - 1; 680 const char *s = eina_stringshare_add_length(line->start, line->end - line->start);
681 *l = eina_list_append(*l, eina_stringshare_add_length(line->start, end - line->start)); 681 if (s) *l = eina_list_append(*l, s);
682 } 682 }
683 } 683 }
684 eina_iterator_free(it); 684 eina_iterator_free(it);
@@ -689,9 +689,9 @@ error:
689static void 689static void
690read_lists(void) 690read_lists(void)
691{ 691{
692 fill_list("extra_desktop.dirs", &desktop_extra_dirs); 692 fill_list("extra_desktops.dirs", &desktop_extra_dirs);
693 fill_list("extra_icon.dirs", &icon_extra_dirs); 693 fill_list("extra_icons.dirs", &icon_extra_dirs);
694 fill_list("icon.exts", &icon_exts); 694 fill_list("icons.exts", &icon_exts);
695} 695}
696 696
697static void 697static void
@@ -777,7 +777,7 @@ cache_desktop_dir_add(const char *dir)
777 { 777 {
778 /* Not a registered path */ 778 /* Not a registered path */
779 desktop_extra_dirs = eina_list_append(desktop_extra_dirs, eina_stringshare_add(san)); 779 desktop_extra_dirs = eina_list_append(desktop_extra_dirs, eina_stringshare_add(san));
780 save_list("extra_desktop.dirs", desktop_extra_dirs); 780 save_list("extra_desktops.dirs", desktop_extra_dirs);
781 cache_desktop_update(); 781 cache_desktop_update();
782 } 782 }
783 free(san); 783 free(san);
@@ -794,7 +794,7 @@ cache_icon_dir_add(const char *dir)
794 { 794 {
795 if (!strcmp(san, "/")) goto out; 795 if (!strcmp(san, "/")) goto out;
796 icon_extra_dirs = eina_list_append(icon_extra_dirs, eina_stringshare_add(san)); 796 icon_extra_dirs = eina_list_append(icon_extra_dirs, eina_stringshare_add(san));
797 save_list("extra_icon.dirs", icon_extra_dirs); 797 save_list("extra_icons.dirs", icon_extra_dirs);
798 cache_icon_update(EINA_TRUE); 798 cache_icon_update(EINA_TRUE);
799 } 799 }
800out: 800out:
@@ -807,7 +807,7 @@ cache_icon_ext_add(const char *ext)
807 if (!eina_list_search_unsorted_list(icon_exts, EINA_COMPARE_CB(strcmp), ext)) 807 if (!eina_list_search_unsorted_list(icon_exts, EINA_COMPARE_CB(strcmp), ext))
808 { 808 {
809 icon_exts = eina_list_append(icon_exts, eina_stringshare_add(ext)); 809 icon_exts = eina_list_append(icon_exts, eina_stringshare_add(ext));
810 save_list("icon.exts", icon_exts); 810 save_list("icons.exts", icon_exts);
811 cache_icon_update(EINA_TRUE); 811 cache_icon_update(EINA_TRUE);
812 } 812 }
813} 813}