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:
parent
49317da35c
commit
aa5aeaf23c
1 changed files with 4 additions and 11 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue