tags 612470 + patch
thanks
Thanks Juan for making this patch.
---------- Forwarded message ----------
From: Juan Balderas <[email protected]>
Date: Wed, Feb 9, 2011 at 10:09
Subject: Bug#612470: Can't open image with gnome-paint from Thunar
To: Aron Xu <[email protected]>
Hello Aron,
While doing a google search, I came accross
this bug alert.
http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/3cd68df4f907cef3
The enclosed patch should let
gp open uri's. Would you please test it?
Thanks
Juan
--
Regards,
Aron Xu
diff -uNr gnome-paint-0.4.0/src/file.c gnome-paint-0.4.0p/src/file.c
--- gnome-paint-0.4.0/src/file.c 2011-02-08 19:16:36.000000000 -0600
+++ gnome-paint-0.4.0p/src/file.c 2011-02-08 19:58:42.873060000 -0600
@@ -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;
}