this ain't static, falco
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
This commit is contained in:
parent
6043444e4e
commit
9be48f1dc4
@ -2113,7 +2113,7 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered()
|
|||||||
|
|
||||||
// part of fix for weird bug involving the window icon being replaced
|
// 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
|
// 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);
|
QFile iconFile(iconPath);
|
||||||
if (!iconFile.open(QFile::WriteOnly))
|
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!"));
|
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create instance shortcut!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
bool success = icon->icon().pixmap(64, 64).save(&iconFile, "ICO");
|
||||||
|
iconFile.close();
|
||||||
|
|
||||||
if (!icon->icon().pixmap(64, 64).save(&iconFile, "ICO"))
|
// restore original window icon
|
||||||
|
QGuiApplication::setWindowIcon(appIcon);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
iconGenerated = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
iconFile.close();
|
|
||||||
iconFile.remove();
|
iconFile.remove();
|
||||||
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create instance shortcut!"));
|
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create instance shortcut!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
iconFile.close();
|
|
||||||
iconGenerated = true;
|
|
||||||
|
|
||||||
// restore original window icon
|
|
||||||
QGuiApplication::setWindowIcon(appIcon);
|
|
||||||
#else
|
#else
|
||||||
iconPath = icon->getFilePath();
|
iconPath = icon->getFilePath();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user