[eog-plugins] [postr] Use GIO to determine image file path



commit c0643470262e53643a15741feb3a3252a0bc484a
Author: Felix Riemann <friemann gnome org>
Date:   Tue Aug 25 20:46:30 2009 +0200

    [postr] Use GIO to determine image file path
    
    Postr currently only accepts local files. Using GIO to get the local
    file path of the images has the advantage that GIO FUSE mounts can be
    used. Also quotes were added to work with files having spaces in their
    path. Fixes bgo#592984.

 ChangeLog                        |    6 ++++++
 plugins/postr/eog-postr-plugin.c |   11 ++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0145325..e97f491 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-08-25  Felix Riemann  <friemann gnome org>
 
+	* plugins/postr/eog-postr-plugin.c:
+	Use GIO to determine the images' file path. This makes it possible to
+	use files from GIO FUSE mounts. Fixes bug #592984.
+
+2009-08-25  Felix Riemann  <friemann gnome org>
+
 	* plugins/exif-display/eog-exif-display-plugin.c:
 	Only draw to the GtkDrawingArea when it is realized. Fixes crashes
 	when multiple plugins use the sidebar. Fixes bug #593003.
diff --git a/plugins/postr/eog-postr-plugin.c b/plugins/postr/eog-postr-plugin.c
index cc02582..5f5f23c 100644
--- a/plugins/postr/eog-postr-plugin.c
+++ b/plugins/postr/eog-postr-plugin.c
@@ -34,8 +34,17 @@ postr_cb (GtkAction	*action,
 
 	for (i = g_list_first (images); i; i = i->next) {
 		EogImage *image = (EogImage *) i->data;
+		GFile *imgfile;
+		gchar *imgpath;
 
-		cmd = g_strconcat (cmd, eog_image_get_uri_for_display (image), " ", NULL);
+		imgfile = eog_image_get_file (image);
+		imgpath = g_file_get_path (imgfile);
+
+		if (G_LIKELY (imgpath != NULL))
+			cmd = g_strconcat (cmd, "\"", imgpath, "\"", " ", NULL);
+
+		g_free (imgpath);
+		g_object_unref (imgfile);
 	}
 
 	g_spawn_command_line_async (cmd, NULL);



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