]> git.armaanb.net Git - chorizo.git/commitdiff
Minor improvement to changed_download_progress()
authorPeter Hofmann <scm@uninformativ.de>
Sat, 9 Aug 2014 16:25:30 +0000 (18:25 +0200)
committerPeter Hofmann <scm@uninformativ.de>
Sat, 9 Aug 2014 16:25:30 +0000 (18:25 +0200)
I checked WebKit's source code: webkit_download_get_destination_uri()
never returns NULL in lariza. It's because we set the destination URI in
the signal handler for the download request.

If g_filename_from_uri() really returned NULL for some reason, then it'd
be just plain wrong to announce the "suggested file name", because we
might be saving the download ... somewhere else. I doubt this function
ever returns NULL in lariza, though, but you never know.

So, now, the download manager will correctly show the URI if the
destination URI is "unknown".

browser.c

index 2f1676a29180c4d185bb385f21f1e08c4b6eb844..47ac63d7e080c43aca4e2c14ece170ec22cce85e 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -372,8 +372,7 @@ changed_download_progress(GObject *obj, GParamSpec *pspec, gpointer data)
                /* This really should not happen because WebKit uses that URI to
                 * write to a file... */
                fprintf(stderr, __NAME__": Could not construct file name from URI!\n");
-               t = g_strdup_printf("%s (%.0f%%)",
-                                   webkit_download_get_suggested_filename(download), p);
+               t = g_strdup_printf("%s (%.0f%%)", webkit_download_get_uri(download), p);
        }
        else
        {