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