blob: ec4144da9e29101d1214c4e83acbd5eeb0bf7e9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
From a09c25177a5643f8596dc81d97b87ebce74c75f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Fri, 21 Oct 2011 19:57:55 +0200
Subject: [PATCH] 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;
--
1.7.8.3
|