diff options
Diffstat (limited to 'src/callbacks.c')
-rw-r--r-- | src/callbacks.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/callbacks.c b/src/callbacks.c index deda426..703107b 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -292,8 +292,11 @@ cmd_caret_browsing() { void set_current_encoding() { - webkit_web_view_set_custom_encoding(uzbl.gui.web_view, - uzbl.behave.current_encoding); + gchar *encoding = uzbl.behave.current_encoding; + if(strlen(encoding) == 0) + encoding = NULL; + + webkit_web_view_set_custom_encoding(uzbl.gui.web_view, encoding); } @@ -834,6 +837,11 @@ download_cb(WebKitWebView *web_view, WebKitDownload *download, gpointer user_dat /* get the URI being downloaded */ const gchar *uri = webkit_download_get_uri(download); + /* get the destination path, if specified. + * this is only intended to be set when this function is trigger by an + * explicit download using uzbl's 'download' action. */ + const gchar *destination = user_data; + if (uzbl.state.verbose) printf("Download requested -> %s\n", uri); @@ -880,6 +888,9 @@ download_cb(WebKitWebView *web_view, WebKitDownload *download, gpointer user_dat gchar *total_size_s = g_strdup_printf("%d", total_size); g_array_append_val(a, total_size_s); + if(destination) + g_array_append_val(a, destination); + GString *result = g_string_new (""); run_parsed_command(c, a, result); |