Updating branch refs/heads/master
         to 6cddd1ff0efe9286d64e42b65359d8b3e30d2dde (commit)
       from 81ab79c12969f927bebaad756b88d3a3451f59ef (commit)

commit 6cddd1ff0efe9286d64e42b65359d8b3e30d2dde
Author: Christian Dywan <christ...@twotoasts.de>
Date:   Fri Oct 5 01:03:46 2012 +0200

    Return a filename, not a URI in midori_view_save_source
    
    Fixes: https://bugs.launchpad.net/midori/+bug/1060270

 midori/midori-view.c |    2 +-
 tests/browser.c      |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index e06b302..150e1ec 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -5184,7 +5184,7 @@ midori_view_save_source (MidoriView* view,
         uri = midori_view_get_display_uri (view);
 
     if (g_str_has_prefix (uri, "file:///"))
-        return g_strdup (uri);
+        return g_filename_from_uri (uri, NULL, NULL);
 
     if (!outfile)
     {
diff --git a/tests/browser.c b/tests/browser.c
index 73c36b3..0c24ba6 100644
--- a/tests/browser.c
+++ b/tests/browser.c
@@ -35,6 +35,8 @@ browser_create (void)
     GtkWidget* view;
     GFile* file;
     gchar* uri;
+    gchar* filename;
+    gchar* filename2;
 
     g_test_log_set_fatal_handler (skip_gtk_bugs, NULL);
 
@@ -56,6 +58,12 @@ browser_create (void)
     midori_settings_set_download_folder (MIDORI_SETTINGS (settings), 
temporary_downloads);
     midori_browser_save_uri (browser, MIDORI_VIEW (view), NULL);
 
+    filename = midori_view_save_source (MIDORI_VIEW (view), NULL, NULL);
+    filename2 = g_filename_from_uri (uri, NULL, NULL);
+    g_assert_cmpstr (filename, ==, filename2);
+    g_free (filename);
+    g_free (filename2);
+
     /* View source for local file: should NOT use temporary file */
     n = midori_browser_add_uri (browser, uri);
     midori_browser_set_current_page (browser, n);
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to