Implement a bit more of the .desktop spec to hide unwanted apps.

SVN revision: 25447
This commit is contained in:
David Walter Seikel 2006-09-04 15:20:27 +00:00
parent 60a847ab41
commit 31f9a16b15
2 changed files with 28 additions and 13 deletions

View File

@ -55,9 +55,11 @@ struct _Ecore_Desktop
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. */
};

View File

@ -337,14 +337,22 @@ ecore_desktop_get(const char *file, const char *lang)
(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 @@ ecore_desktop_save(Ecore_Desktop * desktop)
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. */