[gnome-panel/gnome-3-2] panel: Fix loading launchers defined with relative paths



commit b1089124ca3d8c4a98e770e276ffad1b4c9f4e75
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Oct 11 18:18:03 2011 +0200

    panel: Fix loading launchers defined with relative paths

 gnome-panel/launcher.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gnome-panel/launcher.c b/gnome-panel/launcher.c
index 31e9ac7..1997809 100644
--- a/gnome-panel/launcher.c
+++ b/gnome-panel/launcher.c
@@ -406,6 +406,8 @@ static Launcher *
 create_launcher (const char *location)
 {
 	GKeyFile *key_file;
+	char     *scheme;
+	gboolean  is_uri;
 	gboolean  loaded;
 	Launcher *launcher;
 	GError   *error = NULL;
@@ -419,7 +421,11 @@ create_launcher (const char *location)
 	new_location = NULL;
 	key_file = g_key_file_new ();
 
-	if (!strchr (location, G_DIR_SEPARATOR)) {
+	scheme = g_uri_parse_scheme (location);
+	is_uri = scheme != NULL;
+	g_free (scheme);
+
+	if (!is_uri && !g_path_is_absolute (location)) {
 		/* try to first load a file in our config directory, and if it
 		 * doesn't exist there, try to find it in the xdg data dirs */
 		char *path;



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