diff options
author | ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com> | 2022-11-09 21:55:13 +0200 |
---|---|---|
committer | ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com> | 2022-11-12 20:19:31 +0200 |
commit | 9be48f1dc44dc764d2131c559780624908ff636d (patch) | |
tree | faf6d2756c35ffc67d4457e1fca9229bb72a3c76 | |
parent | 6043444e4e11801e45ad888182c99d6f4e4e5ddc (diff) | |
download | PrismLauncher-9be48f1dc44dc764d2131c559780624908ff636d.tar.gz PrismLauncher-9be48f1dc44dc764d2131c559780624908ff636d.tar.bz2 PrismLauncher-9be48f1dc44dc764d2131c559780624908ff636d.zip |
this ain't static, falco
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
-rw-r--r-- | launcher/ui/MainWindow.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index cd3c1b5b..ff1982ce 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -2113,7 +2113,7 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered() // part of fix for weird bug involving the window icon being replaced // dunno why it happens, but this 2-line fix seems to be enough, so w/e - auto appIcon = Application::getThemedIcon("logo"); + auto appIcon = APPLICATION->getThemedIcon("logo"); QFile iconFile(iconPath); if (!iconFile.open(QFile::WriteOnly)) @@ -2121,20 +2121,22 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered() QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create instance shortcut!")); return; } + bool success = icon->icon().pixmap(64, 64).save(&iconFile, "ICO"); + iconFile.close(); + + // restore original window icon + QGuiApplication::setWindowIcon(appIcon); - if (!icon->icon().pixmap(64, 64).save(&iconFile, "ICO")) + if (success) + { + iconGenerated = true; + } + else { - iconFile.close(); iconFile.remove(); QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create instance shortcut!")); return; } - - iconFile.close(); - iconGenerated = true; - - // restore original window icon - QGuiApplication::setWindowIcon(appIcon); #else iconPath = icon->getFilePath(); #endif |