Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release-src > by-pkgid > d426b5b75d4a14e66ef2470f535b06d5 > files > 6

gnome-paint-0.4.0-4.mga5.src.rpm

Description: Handle URLs when given as command line parameters.
 Applications use %U in .desktop file should be able to open multiple
 files either in the form of paths or URLs.
Author: Juan Balderas <juan.balderas.0@gmail.com>
Bug-Debian: 612470
Last-Update: 2011-02-10
--- a/src/file.c
+++ b/src/file.c
@@ -133,11 +133,30 @@
 
 
 gboolean	
-file_open ( const gchar * filename )
+file_open ( const gchar * fname )
 {
 	gboolean	ok		=	FALSE;
 	GError 		*error	= NULL;
 	GdkPixbuf 	*pixbuf	= NULL;
+	gchar 		*filename = NULL;
+	GFile		*file	= NULL;
+
+	filename = g_strdup (fname);
+
+	file = g_file_new_for_uri (filename);
+	if( G_IS_FILE (file) )
+	{
+		gchar *p = NULL;
+
+		p = g_file_get_path ( file);
+		if(p)
+		{
+			g_free (filename);
+			filename = p;
+		}
+		g_object_unref(file);
+	}
+
 	pixbuf = gdk_pixbuf_new_from_file (filename, &error);
 	if (pixbuf != NULL)
 	{
@@ -178,6 +197,12 @@
 		g_free (basename);
 		g_free (message);
 	}
+
+	if(filename)
+	{
+		g_free (filename);
+	}
+
 	g_object_unref (pixbuf);
 	return ok;
 }
--- /dev/null
+++ b/po/POTFILES.skip
@@ -0,0 +1 @@
+.pc/debian-612470-handle-urls.patch/src/file.c