[gnome-builder] libide: special case ide_uri_to_string() for file://



commit ee8e7b54e2d127c0fe9c298ad79f6f8c88bd2dff
Author: Christian Hergert <chergert redhat com>
Date:   Sun Nov 15 22:56:20 2015 -0800

    libide: special case ide_uri_to_string() for file://

 libide/ide-uri.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-uri.c b/libide/ide-uri.c
index b3add6a..fe8f98a 100644
--- a/libide/ide-uri.c
+++ b/libide/ide-uri.c
@@ -744,6 +744,14 @@ ide_uri_to_string (IdeUri              *uri,
 
   g_return_val_if_fail (uri != NULL, NULL);
 
+  if (g_strcmp0 (uri->scheme, "file") == 0)
+    {
+      if (uri->fragment)
+        return g_strdup_printf ("file://%s#%s", uri->path, uri->fragment);
+      else
+        return g_strdup_printf ("file://%s", uri->path);
+    }
+
   str = g_string_new (uri->scheme);
   g_string_append_c (str, ':');
 


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