From 0f581efda505d11f942e6fe2bb9864d387f90c81 Mon Sep 17 00:00:00 2001 From: fn2006 Date: Sat, 29 Oct 2022 14:03:44 +0100 Subject: [PATCH] fix hardcoded svg path --- buildconfig/BuildConfig.cpp.in | 1 + buildconfig/BuildConfig.h | 1 + launcher/Application.cpp | 3 +-- program_info/CMakeLists.txt | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 50e5e8a4..2cf65f1f 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -48,6 +48,7 @@ Config::Config() LAUNCHER_CONFIGFILE = "@Launcher_ConfigFile@"; LAUNCHER_GIT = "@Launcher_Git@"; LAUNCHER_DESKTOPFILENAME = "@Launcher_DesktopFileName@"; + LAUNCHER_SVGFILENAME = "@Launcher_SVGFileName@"; USER_AGENT = "@Launcher_UserAgent@"; USER_AGENT_UNCACHED = USER_AGENT + " (Uncached)"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index ef384ed2..4e52c1de 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -50,6 +50,7 @@ class Config { QString LAUNCHER_CONFIGFILE; QString LAUNCHER_GIT; QString LAUNCHER_DESKTOPFILENAME; + QString LAUNCHER_SVGFILENAME; /// The major version number. int VERSION_MAJOR; diff --git a/launcher/Application.cpp b/launcher/Application.cpp index fe14de93..50261b3b 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -1168,8 +1168,7 @@ void Application::setIconTheme(const QString& name) QIcon Application::getThemedIcon(const QString& name) { if(name == "logo") { - // why is this hardcoded lol - return QIcon(":/org.fn2006.PollyMC.svg"); + return QIcon(":/" + BuildConfig.LAUNCHER_SVGFILENAME); } return QIcon::fromTheme(name); } diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 686a4918..da2f5da2 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -21,6 +21,7 @@ set(Launcher_UserAgent "PrismLauncher/${Launcher_RELEASE_VERSION_NAME}" PARENT_S set(Launcher_ConfigFile "pollymc.cfg" PARENT_SCOPE) set(Launcher_Git "https://github.com/fn2006/PollyMC" PARENT_SCOPE) set(Launcher_DesktopFileName "org.fn2006.PollyMC.desktop" PARENT_SCOPE) +set(Launcher_SVGFileName "org.fn2006.PollyMC.svg" PARENT_SCOPE) set(Launcher_Desktop "program_info/org.fn2006.PollyMC.desktop" PARENT_SCOPE) set(Launcher_MetaInfo "program_info/org.fn2006.PollyMC.metainfo.xml" PARENT_SCOPE)