From c2a354d2734a6febbf95f64dc4ee00c6152fd6d4 Mon Sep 17 00:00:00 2001 From: Daniella Kicsak Date: Fri, 14 Mar 2025 22:42:38 +1100 Subject: [PATCH] main: Fix "qt.svg: Cannot open file" mesage Signed-off-by: Daniella Kicsak --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 250f591..f8f47cd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include static void initLocale(QTranslator *qtTranslator, QTranslator *translator) { @@ -52,9 +53,8 @@ int main(int argc, char *argv[]) QString icoLocalPath = QCoreApplication::applicationDirPath() + iconSuffix; QString icoSysPath = QStringLiteral(PROJECT_ICON_SYSTEM_PATH) + iconSuffix; - QIcon appIcon = QIcon(icoLocalPath); - if (appIcon.isNull()) - appIcon = QIcon(icoSysPath); + // If icoLocalPath exists, set to icolocalPath; else set to icoSysPath + QIcon appIcon = (QFileInfo(icoLocalPath).exists()) ? QIcon(icoLocalPath) : QIcon(icoSysPath); w.setWindowIcon(appIcon);