Don't confuse filename and input in midori_browser_save_uri

The file chooser expects UTF-8 as if typed by the user, not
a filename in the local encoding.
This commit is contained in:
Christian Dywan 2011-11-07 23:11:08 +01:00
parent 49317da35c
commit aa5aeaf23c

View file

@ -1046,17 +1046,10 @@ midori_browser_save_uri (MidoriBrowser* browser,
g_free (filename); g_free (filename);
} }
/* Try to provide a good default filename */ /* Try to provide a good default filename, UTF-8 encoded */
filename = g_filename_from_uri (uri, NULL, NULL); filename = soup_uri_decode (uri);
if (!filename && (last_slash = g_strrstr (uri, "/"))) last_slash = g_strrstr (filename, "/") + 1;
{ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), last_slash);
if (last_slash[0] == '/')
last_slash++;
filename = g_strdup (last_slash);
}
else
filename = g_strdup (uri);
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), filename);
g_free (filename); g_free (filename);
} }