# HG changeset patch # User nadvornik # Date 1233527740 0 # Node ID 8fcdfacce91d52c351756c89dd0a5866132ff3f6 # Parent 1ac2baeb8dc90936ffa363982fa315022ca4cefe test TryExec, xdg_data_home added to the list of directories diff -r 1ac2baeb8dc9 -r 8fcdfacce91d src/editors.c --- a/src/editors.c Sun Feb 01 18:27:42 2009 +0000 +++ b/src/editors.c Sun Feb 01 22:35:40 2009 +0000 @@ -151,6 +151,7 @@ gchar *extensions; const gchar *key = filename_from_path(path); gchar **categories, **only_show_in, **not_show_in; + gchar *try_exec; if (g_hash_table_lookup(editors, key)) return FALSE; /* the file found earlier wins */ @@ -221,6 +222,16 @@ g_strfreev(not_show_in); } + + try_exec = g_key_file_get_string(key_file, DESKTOP_GROUP, "TryExec", NULL); + if (try_exec && !editor->hidden) + { + gchar *try_exec_res = g_find_program_in_path(try_exec); + if (!try_exec_res) editor->hidden = TRUE; + g_free(try_exec_res); + g_free(try_exec); + } + if (editor->hidden) { /* hidden editors will be deleted, no need to parse the rest */ @@ -326,7 +337,7 @@ else xdg_data_dirs = g_strdup("/usr/share"); - all_dirs = g_strconcat(get_rc_dir(), ":", GQ_APP_DIR, ":", xdg_data_dirs, NULL); + all_dirs = g_strconcat(get_rc_dir(), ":", GQ_APP_DIR, ":", xdg_data_home_get(), ":", xdg_data_dirs, NULL); g_free(xdg_data_dirs);