Enlightenment CVS committal Author : raster Project : e17 Module : libs/efreet
Dir : e17/libs/efreet/src/lib Modified Files: efreet_icon.c efreet_icon.h Log Message: add the ability to have more dirs to search for icons between ~/.icons and the system icon paths =================================================================== RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_icon.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- efreet_icon.c 27 Mar 2007 16:54:54 -0000 1.6 +++ efreet_icon.c 31 Mar 2007 01:16:15 -0000 1.7 @@ -8,6 +8,7 @@ static Ecore_Hash *efreet_icon_dirs_cached = NULL; static Ecore_Hash *efreet_icon_themes = NULL; Ecore_List *efreet_icon_extensions = NULL; +static Ecore_List *efreet_extra_icon_dirs = NULL; static Efreet_Icon *efreet_icon_find_helper(Efreet_Icon_Theme *theme, const char *cache_key, @@ -88,6 +89,7 @@ efreet_icon_themes = ecore_hash_new(NULL, NULL); ecore_hash_set_free_value(efreet_icon_themes, ECORE_FREE_CB(efreet_icon_theme_free)); + efreet_extra_icon_dirs = ecore_list_new(); } return 1; @@ -106,6 +108,7 @@ IF_FREE_LIST(efreet_icon_extensions); IF_FREE_HASH(efreet_icon_themes); IF_FREE_HASH(efreet_icon_dirs_cached); + IF_FREE_LIST(efreet_extra_icon_dirs); ecore_shutdown(); } @@ -142,6 +145,20 @@ } /** + * @return Returns a list of strings that are paths to other icon directories + * @brief Gets the list of all extra directories to look for icons. These + * directories are used to look for icons after looking in the user icon dir + * and before looking in standard system directories. The order of search is + * from first to last directory in this list. the strings in the list should + * be created with ecore_string_instance(). + */ +Ecore_List * +efreet_icon_extra_list_get(void) +{ + return efreet_extra_icon_dirs; +} + +/** * @return Returns a list of Efreet_Icon structs for all the non-hidden icon * themes * @brief Retrieves all of the non-hidden icon themes available on the system. @@ -507,6 +524,12 @@ const char *dir; char path[PATH_MAX]; + ecore_list_goto_first(efreet_extra_icon_dirs); + while ((dir = ecore_list_next(efreet_extra_icon_dirs))) + { + icon = efreet_icon_fallback_dir_scan(dir, icon_name); + if (icon) return icon; + } xdg_dirs = efreet_data_dirs_get(); ecore_list_goto_first(xdg_dirs); while ((dir = ecore_list_next(xdg_dirs))) =================================================================== RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_icon.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- efreet_icon.h 3 Feb 2007 13:05:30 -0000 1.1 +++ efreet_icon.h 31 Mar 2007 01:16:15 -0000 1.2 @@ -162,6 +162,7 @@ const char *efreet_icon_dir_get(void); void efreet_icon_extension_add(const char *ext); +Ecore_List *efreet_icon_extra_list_get(void); Ecore_List *efreet_icon_theme_list_get(void); Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name); Efreet_Icon *efreet_icon_find(const char *theme_name, const char *icon, ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs