Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : apps/e_utils

Dir     : e17/apps/e_utils/src/bin/e17genmenu/src/bin


Modified Files:
        icons.c 


Log Message:
The final fallback icon search strategy.  Still gotta write the intermediate
fallback strategies.

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/icons.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- icons.c     3 Feb 2006 06:55:27 -0000       1.8
+++ icons.c     3 Feb 2006 07:14:21 -0000       1.9
@@ -147,6 +147,7 @@
 {
    char icn[MAX_PATH], path[MAX_PATH];
    char *dir, *icon_size, *icon_theme, *theme_path;
+   char *found;
 
    if (icon == NULL)
       return DEFAULTICON;
@@ -279,7 +280,6 @@
                                                   /* If there is a match in 
sizes, hunt that little icon down. */
                                                   if (match)
                                                      {
-                                                        char *found;
 
                                                          /* First try a .png 
file. */
                                                          snprintf(path, 
MAX_PATH, "%s/%s/%s.png", icon_theme, directory_paths->list[i], icon);
@@ -325,7 +325,47 @@
                                    }   /* for (i = 0; i < 
directory_paths->size; i++) */
 
                                  /* Fall back strategy #1, look for closest 
size in this theme. */
+
+
                                  /* Fall back strategy #2, Just search in the 
base of the icon directories. */
+                                 /* First try a .png file. */
+                                 snprintf(path, MAX_PATH, "%s.png", icon);
+//#ifdef DEBUG
+                                 printf("FDO icon = %s\n", path);
+//#endif
+                                 found = 
fdo_paths_search_for_file(FDO_PATHS_TYPE_ICON, path, 0, NULL, NULL);
+                                if (found)
+                                   return found;
+                                else
+                                   {  /* Then a .svg file. */
+                                       snprintf(path, MAX_PATH, "%s.svg", 
icon);
+//#ifdef DEBUG
+                                       printf("FDO icon = %s\n", path);
+//#endif
+                                       found = 
fdo_paths_search_for_file(FDO_PATHS_TYPE_ICON, path, 0, NULL, NULL);
+                                      if (found)
+                                         return found;
+                                      else
+                                         {  /* Then a .xpm file. */
+                                             snprintf(path, MAX_PATH, 
"%s.xpm", icon);
+//#ifdef DEBUG
+                                             printf("FDO icon = %s\n", path);
+//#endif
+                                             found = 
fdo_paths_search_for_file(FDO_PATHS_TYPE_ICON, path, 0, NULL, NULL);
+                                            if (found)
+                                               return found;
+                                            else
+                                               {   /* Finally, try without an 
extension, in case one was given. */
+                                                   snprintf(path, MAX_PATH, 
"%s", icon);
+//#ifdef DEBUG
+                                                   printf("FDO icon = %s\n", 
path);
+//#endif
+                                                   found = 
fdo_paths_search_for_file(FDO_PATHS_TYPE_ICON, path, 0, NULL, NULL);
+                                                  if (found)
+                                                     return found;
+                                               }
+                                         }
+                                   }
 
                              }
                        }




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to