# HG changeset patch # User zas_ # Date 1233669140 0 # Node ID c5852c5437752e7dc40c0ecd56074216eb4096f7 # Parent 93df70312ccd247d60153945381663a0d8307b08 Add support for NoDisplay (entry is then hidden) and Type (only Application type is valid here) keys. diff -r 93df70312ccd -r c5852c543775 src/editors.c --- a/src/editors.c Tue Feb 03 13:50:10 2009 +0000 +++ b/src/editors.c Tue Feb 03 13:52:20 2009 +0000 @@ -81,11 +81,11 @@ g_free(editor->key); g_free(editor->name); + g_free(editor->icon); g_free(editor->exec); g_free(editor->menu_path); g_free(editor->hotkey); string_list_free(editor->ext_list); - g_free(editor->icon); g_free(editor->file); g_free(editor); } @@ -149,6 +149,7 @@ GKeyFile *key_file; EditorDescription *editor; gchar *extensions; + gchar *type; const gchar *key = filename_from_path(path); gchar **categories, **only_show_in, **not_show_in; gchar *try_exec; @@ -161,6 +162,13 @@ g_key_file_free(key_file); return FALSE; } + + type = g_key_file_get_string(key_file, DESKTOP_GROUP, "Type", NULL); + if (!type || strcmp(type, "Application") != 0) + { + /* We only consider desktop entries of Application type */ + return FALSE; + } editor = g_new0(EditorDescription, 1); @@ -169,7 +177,11 @@ g_hash_table_insert(editors, editor->key, editor); - if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "Hidden", NULL)) editor->hidden = TRUE; + if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "Hidden", NULL) + || g_key_file_get_boolean(key_file, DESKTOP_GROUP, "NoDisplay", NULL)) + { + editor->hidden = TRUE; + } categories = g_key_file_get_string_list(key_file, DESKTOP_GROUP, "Categories", NULL, NULL); if (categories)