From 21c3a88382bb4a1e911456c633aa4730bbb7cdff Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 16 Feb 2010 09:39:59 -0600 Subject: Checking for our shortcuts key, we don't really want a desktop file without it. --- libindicator/indicator-desktop-shortcuts.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index a87316f..eeb97be 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -29,6 +29,7 @@ License along with this library. If not, see #include "indicator-desktop-shortcuts.h" #define GROUP_SUFFIX "Shortcut Group" +#define SHORTCUTS_KEY "X-Ayatana-Desktop-Shortcuts" #define PROP_DESKTOP_FILE_S "desktop-file" #define PROP_IDENTITY_S "identity" @@ -160,6 +161,13 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec g_warning("Unable to load keyfile from file '%s': %s", g_value_get_string(value), error->message); g_error_free(error); g_key_file_free(keyfile); + break; + } + + if (!g_key_file_has_key(keyfile, G_KEY_FILE_DESKTOP_GROUP, SHORTCUTS_KEY, NULL)) { + g_warning("Keyfile from file '%s' does not have '" SHORTCUTS_KEY "' key", g_value_get_string(value)); + g_key_file_free(keyfile); + break; } priv->keyfile = keyfile; -- cgit v1.2.3