From fcb2182266bbc3bd1010185472a0fe9b9b02634e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 8 Jan 2023 14:09:41 +0100 Subject: [PATCH] GUI: Move the icon-related code from the DownloadPacksDialog to the options --- gui/downloadpacksdialog.cpp | 4 ---- gui/options.cpp | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gui/downloadpacksdialog.cpp b/gui/downloadpacksdialog.cpp index fd4e57c80e1..f39bed3e835 100644 --- a/gui/downloadpacksdialog.cpp +++ b/gui/downloadpacksdialog.cpp @@ -141,7 +141,6 @@ void DialogState::downloadFileCallback(Networking::DataResponse r) { if (response->eos) { if (!takeOneFile()) { state = kDownloadComplete; - g_gui.initIconsSet(); if (dialog) dialog->sendCommand(kDownloadEndedCmd, 0); return; @@ -473,9 +472,6 @@ void DownloadPacksDialog::clearCache() { } g_state->fileHash.clear(); - // Reload (now empty) icons set - g_gui.initIconsSet(); - // Fetch current packs list file and re-trigger downloads g_state->downloadList(); calculateList(); diff --git a/gui/options.cpp b/gui/options.cpp index c8f5942b296..3105eb0147a 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -3112,6 +3112,9 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 case kUpdateIconsCmd: { DownloadPacksDialog dia(_("icon packs"), "LIST", "gui-icons*.dat"); dia.runModal(); + + // Refresh the icons + g_gui.initIconsSet(); break; } #endif