Check OnlyShowIn and NotShowIn values if they are given

This commit is contained in:
Sanel Zukan 2009-10-06 12:04:44 +00:00
parent 419a80a732
commit 44d18dc433

View File

@ -73,11 +73,22 @@ bool DesktopEntry::load(void) {
if(df.hidden() || df.no_display())
return false;
char buf[128];
/* should it be shown in EDE */
if(df.only_show_in(buf, sizeof(buf))) {
if(strstr(buf, "EDE") == NULL)
return false;
}
if(df.not_show_in(buf, sizeof(buf))) {
if(strstr(buf, "EDE") != NULL)
return false;
}
/* it must be application type */
E_RETURN_VAL_IF_FAIL(df.type() == DESK_FILE_TYPE_APPLICATION, false);
char buf[128];
/* name must be present too */
E_RETURN_VAL_IF_FAIL(df.name(buf, sizeof(buf)) == true, false);
name = new String(buf);