From 40cb1bad00a8d450fa15b211d24d0ed57dbd9574 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Wed, 17 May 2023 21:40:33 -0500 Subject: Don't use a temp filename for downloaded web app icon Using a random filename is overkill here. Without the filename intact, GTK impressively fails to detect the content type of PNG images (no, really, it's really relying on only the filename) and we wind up falling back to just the favicon. Related: #1989 --- src/window-commands.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/window-commands.c b/src/window-commands.c index 7e8b38bb2..6e2b5df75 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -1687,7 +1687,6 @@ static void download_icon_and_set_image (EphyApplicationDialogData *data) { g_autofree char *destination = NULL; - g_autofree char *tmp_filename = NULL; EphyEmbedShell *shell = ephy_embed_shell_get_default (); data->download = webkit_network_session_download_uri (ephy_embed_shell_get_network_session (shell), @@ -1700,8 +1699,7 @@ download_icon_and_set_image (EphyApplicationDialogData *data) * instead of using this workaround. */ g_object_set_data (G_OBJECT (data->download), "ephy-download-set", GINT_TO_POINTER (TRUE)); - tmp_filename = ephy_file_tmp_filename (".ephy-download-XXXXXX", NULL); - destination = g_build_filename (ephy_file_tmp_dir (), tmp_filename, NULL); + destination = g_build_filename (ephy_file_tmp_dir (), data->icon_href, NULL); webkit_download_set_destination (data->download, destination); g_signal_connect (data->download, "finished", -- cgit v1.2.1