[goffice] Support fd:// URIs on win32. [#608422]



commit 854f8b1365788855905c264244624dcc814cf17a
Author: Jean Brefort <jean brefort normalesup org>
Date:   Tue Mar 9 21:59:30 2010 +0100

    Support fd:// URIs on win32. [#608422]

 ChangeLog               |    5 +++++
 NEWS                    |    3 +++
 goffice/utils/go-file.c |   15 +++++++++++----
 3 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2922104..d2d67ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-03-09  Jean Brefort  <jean brefort normalesup org>
 
+	* goffice/utils/go-file.c (go_shell_arg_to_uri): check for fd:// type
+	URIs on win32. [#608422]
+
+2010-03-09  Jean Brefort  <jean brefort normalesup org>
+
 	* goffice/canvas/goc-item.c (goc_item_new): invalidate the new item.
 	* goffice/canvas/goc-styled-item.c (goc_styled_item_set_property),
 	(goc_styled_item_get_property), (goc_styled_item_class_init): really
diff --git a/NEWS b/NEWS
index e767427..126dcde 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.8.2:
 
+Jean:
+	* Support fd:// URIs on win32. [#608422]
+
 --------------------------------------------------------------------------
 goffice 0.8.1:
 
diff --git a/goffice/utils/go-file.c b/goffice/utils/go-file.c
index db5144a..fb598aa 100644
--- a/goffice/utils/go-file.c
+++ b/goffice/utils/go-file.c
@@ -451,10 +451,17 @@ is_fd_uri (char const *uri, int *fd)
 char *
 go_shell_arg_to_uri (char const *arg)
 {
-	GFile *file = g_file_new_for_commandline_arg (arg);
-	gchar *tmp = g_file_get_uri (file);
-	g_object_unref (file);
-	return tmp;
+#ifdef G_OS_WIN32
+	int fd;
+	if (is_fd_uri (arg, &fd))
+		return g_strdup (arg);
+#endif
+	{
+		GFile *file = g_file_new_for_commandline_arg (arg);
+		gchar *tmp = g_file_get_uri (file);
+		g_object_unref (file);
+		return tmp;
+	}
 }
 
 /**



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