[totem-pl-parser] disc: Add code to get the archive URI



commit 3c01d126ea6bde21149ec004b7c828a3144f32c5
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 5 16:42:06 2012 +0100

    disc: Add code to get the archive URI
    
    From its mounted root URI. So:
    archive://file%253A%252F%252F%252Ffoo.iso/
    to:
    file:///foo.iso

 plparse/totem-disc.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/plparse/totem-disc.c b/plparse/totem-disc.c
index a63e922..a7eee31 100644
--- a/plparse/totem-disc.c
+++ b/plparse/totem-disc.c
@@ -314,6 +314,29 @@ cd_cache_check_archive (CdCache *cache,
 #endif
 }
 
+static char *
+unescape_archive_name (const char *orig_uri)
+{
+  char *uri;
+  guint len;
+  char *escape1, *escape2;
+
+  uri = g_strdup (orig_uri);
+
+  /* Remove trailing slash */
+  len = strlen (uri);
+  if (uri[len - 1] == '/')
+    uri[len - 1] = '\0';
+
+  /* Unescape the path */
+  escape1 = g_uri_unescape_string (uri + strlen ("archive://"), NULL);
+  escape2 = g_uri_unescape_string (escape1, NULL);
+  g_free (escape1);
+  g_free (uri);
+
+  return escape2;
+}
+
 static CdCache *
 cd_cache_new (const char *dev,
 	      GError     **error)



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