From 6043444e4e11801e45ad888182c99d6f4e4e5ddc Mon Sep 17 00:00:00 2001 From: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:02:40 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Sefa Eyeoglu Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com> --- launcher/FileSystem.cpp | 2 +- launcher/ui/MainWindow.cpp | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index 587753a0e..5a5390935 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -342,7 +342,7 @@ QString getDesktopDir() // Cross-platform Shortcut creation bool createShortcut(QString destination, QString target, QStringList args, QString name, QString icon) { -#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) +#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) destination = PathCombine(destination, name + ".desktop"); QFile f(destination); diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 15fdd6f2c..cd3c1b5b0 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -2099,23 +2099,21 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered() return; } -#if defined(Q_OS_MACOS) - // macOSX - // TODO actually write this path - QMessageBox::critical(this, tr("Create instance shortcut"), tr("Not supported on macOSX yet!")); - return; +#ifdef Q_OS_MACOS + QMessageBox::critical(this, tr("Create instance shortcut"), tr("Not supported on macOS yet!")); + return; #endif auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey()); QString iconPath; bool iconGenerated = false; -#if defined(Q_OS_WIN) +#ifdef Q_OS_WIN iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.ico"); // 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 = QGuiApplication::windowIcon(); + auto appIcon = Application::getThemedIcon("logo"); QFile iconFile(iconPath); if (!iconFile.open(QFile::WriteOnly))