[gnome-menus] libmenu: Ignore invalid desktop entries



commit fbabc41cb6f2c6520f9f117137fa296a7f8340f3
Author: Florian MÃllner <fmuellner gnome org>
Date:   Fri Oct 21 19:57:55 2011 +0200

    libmenu: Ignore invalid desktop entries
    
    Both "Name" and "Exec" are mandatory keys according to the desktop
    entry spec; some .desktop files missing one or the other have been
    spotted in the while, so ignore them explicitly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662409

 libmenu/desktop-entries.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libmenu/desktop-entries.c b/libmenu/desktop-entries.c
index bb6076d..a8c13d9 100644
--- a/libmenu/desktop-entries.c
+++ b/libmenu/desktop-entries.c
@@ -256,7 +256,9 @@ desktop_entry_load (DesktopEntry *entry)
       const char *categories_str;
 
       entry_desktop->appinfo = g_desktop_app_info_new_from_filename (entry->path);
-      if (!entry_desktop->appinfo)
+      if (!entry_desktop->appinfo ||
+          !g_app_info_get_name (G_APP_INFO (entry_desktop->appinfo)) ||
+          !g_app_info_get_executable (G_APP_INFO (entry_desktop->appinfo)))
         {
           menu_verbose ("Failed to load \"%s\"\n", entry->path);
           return FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]