Enlightenment CVS committal Author : onefang Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_desktop Modified Files: Ecore_Desktop.h ecore_desktop.c Log Message: Implement a bit more of the .desktop spec to hide unwanted apps. =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/Ecore_Desktop.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- Ecore_Desktop.h 4 Sep 2006 10:57:42 -0000 1.18 +++ Ecore_Desktop.h 4 Sep 2006 15:20:27 -0000 1.19 @@ -55,9 +55,11 @@ char *URL; char *file; char *deletiondate; - char *startup; char *window_class; - int allocated; /* FIXME: NoDisplay, Hidden */ + unsigned char startup : 1; + unsigned char hidden : 1; + unsigned char no_display : 1; + unsigned char allocated : 1; /* Actually calling this st_mtime causes compile issues, must be some strange macros at work. */ time_t mtime; /* For checking if the cache is valid. */ }; =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/ecore_desktop.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- ecore_desktop.c 4 Sep 2006 10:57:42 -0000 1.25 +++ ecore_desktop.c 4 Sep 2006 15:20:27 -0000 1.26 @@ -337,14 +337,22 @@ (char *)ecore_hash_get(result->group, "X-KDE-StartupNotify"); if (value) - result->startup = - (!strcmp(value, "true")) ? "1" : "0"; + result->startup = (strcmp(value, "true") == 0); value = (char *)ecore_hash_get(result->group, "StartupNotify"); if (value) - result->startup = - (!strcmp(value, "true")) ? "1" : "0"; + result->startup = (strcmp(value, "true") == 0); + value = + (char *)ecore_hash_get(result->group, + "NoDisplay"); + if (value) + result->no_display = (strcmp(value, "true") == 0); + value = + (char *)ecore_hash_get(result->group, + "Hidden"); + if (value) + result->hidden = (strcmp(value, "true") == 0); /* * icon/class is a list of standard icons from the theme that can override the icon created above. @@ -500,13 +508,18 @@ if (desktop->window_class) ecore_hash_set(desktop->group, strdup("StartupWMClass"), strdup(desktop->window_class)); if (desktop->categories) ecore_hash_set(desktop->group, strdup("Categories"), strdup(desktop->categories)); ecore_hash_remove(desktop->group, "X-KDE-StartupNotify"); - if (desktop->startup) - { - if (desktop->startup[0] == '1') - ecore_hash_set(desktop->group, strdup("StartupNotify"), strdup("true")); - else - ecore_hash_set(desktop->group, strdup("StartupNotify"), strdup("false")); - } + if (desktop->startup) + ecore_hash_set(desktop->group, strdup("StartupNotify"), strdup("true")); + else + ecore_hash_remove(desktop->group, "StartupNotify"); + if (desktop->no_display) + ecore_hash_set(desktop->group, strdup("NoDisplay"), strdup("true")); + else + ecore_hash_remove(desktop->group, "NoDisplay"); + if (desktop->hidden) + ecore_hash_set(desktop->group, strdup("Hidden"), strdup("true")); + else + ecore_hash_remove(desktop->group, "Hidden"); /* FIXME: deal with the ShowIn's. */ ------------------------------------------------------------------------- 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