Enlightenment CVS committal Author : onefang Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_desktop Modified Files: ecore_desktop.c Log Message: Don't calculate icon class if there already is one. =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/ecore_desktop.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- ecore_desktop.c 3 Sep 2006 10:47:26 -0000 1.23 +++ ecore_desktop.c 3 Sep 2006 17:22:46 -0000 1.24 @@ -334,76 +334,79 @@ /* If the icon in the file is not a full path, just put it first in the class, greatly simplifies things. * Otherwise, put that full path into the icon_path member. */ - size = 0; - if ((result->icon) && (result->icon[0] != '/')) - size += strlen(result->icon) + 1; - if (eap_name) size += strlen(eap_name) + 1; - if (exe) size += strlen(exe) + 1; - if (categories) size += strlen(categories) + 1; - result->icon_class = malloc(size + 1); - if (result->icon_class) + if (!result->icon_class) { - char *p; - int done = 0; - - result->icon_class[0] = '\0'; - if ((result->icon) && (result->icon[0] != '/') && (result->icon[0] != '\0')) - { - strcat(result->icon_class, result->icon); - done = 1; - result->icon = NULL; - } - /* We do this here coz we don't want to lower case the result->icon part later. */ - p = result->icon_class; - p += strlen(result->icon_class); - if ((eap_name) && (eap_name[0] != '\0')) - { - if (done) - strcat(result->icon_class, ","); - strcat(result->icon_class, eap_name); - done = 1; - } - if ((exe) && (exe[0] != '\0')) + size = 0; + if ((result->icon) && (result->icon[0] != '/')) + size += strlen(result->icon) + 1; + if (eap_name) size += strlen(eap_name) + 1; + if (exe) size += strlen(exe) + 1; + if (categories) size += strlen(categories) + 1; + result->icon_class = malloc(size + 1); + if (result->icon_class) { - char *tmp; + char *p; + int done = 0; - tmp = strdup(ecore_file_get_file(exe)); - if (tmp) - { - char *p2; - - p2 = tmp; - while (*p2 != '\0') - { - if (*p2 == ' ') - { - *p2 = '\0'; - break; - } - p2++; - } + result->icon_class[0] = '\0'; + if ((result->icon) && (result->icon[0] != '/') && (result->icon[0] != '\0')) + { + strcat(result->icon_class, result->icon); + done = 1; + result->icon = NULL; + } + /* We do this here coz we don't want to lower case the result->icon part later. */ + p = result->icon_class; + p += strlen(result->icon_class); + if ((eap_name) && (eap_name[0] != '\0')) + { if (done) strcat(result->icon_class, ","); - strcat(result->icon_class, tmp); + strcat(result->icon_class, eap_name); done = 1; - free(tmp); - } - } - if ((categories) && (categories[0] != '\0')) - { - if (done) - strcat(result->icon_class, ","); - strcat(result->icon_class, categories); - done = 1; + } + if ((exe) && (exe[0] != '\0')) + { + char *tmp; + + tmp = strdup(ecore_file_get_file(exe)); + if (tmp) + { + char *p2; + + p2 = tmp; + while (*p2 != '\0') + { + if (*p2 == ' ') + { + *p2 = '\0'; + break; + } + p2++; + } + if (done) + strcat(result->icon_class, ","); + strcat(result->icon_class, tmp); + done = 1; + free(tmp); + } + } + if ((categories) && (categories[0] != '\0')) + { + if (done) + strcat(result->icon_class, ","); + strcat(result->icon_class, categories); + done = 1; + } + while (*p != '\0') + { + if (*p == ';') + *p = ','; + else + *p = tolower(*p); + p++; + } } - while (*p != '\0') - { - if (*p == ';') - *p = ','; - else - *p = tolower(*p); - p++; - } } } else ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs