From 1e3b896fdaa8b557b648397d10166a52a284c4c7 Mon Sep 17 00:00:00 2001 From: txtsd Date: Sat, 12 Feb 2022 09:16:22 +0530 Subject: Replace layouts with LAUNCH_PORTABLE --- launcher/Application.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'launcher') diff --git a/launcher/Application.cpp b/launcher/Application.cpp index e33df252..16fd612e 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -294,16 +294,11 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) } else { -#ifdef LAUNCHER_LINUX_DATADIR - QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME")); - if (xdgDataHome.isEmpty()) - xdgDataHome = QDir::homePath() + QLatin1String("/.local/share"); - dataPath = xdgDataHome + "/polymc"; - adjustedBy += "XDG standard " + dataPath; -#elif defined(Q_OS_MAC) + // qDebug() << LAUNCHER_PORTABLE; +#if !LAUNCHER_PORTABLE || defined(Q_OS_MAC) QDir foo(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "..")); dataPath = foo.absolutePath(); - adjustedBy += "Fallback to special Mac location " + dataPath; + adjustedBy += dataPath; #else dataPath = applicationDirPath(); adjustedBy += "Fallback to binary path " + dataPath; @@ -505,8 +500,10 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) #elif defined(Q_OS_WIN32) m_rootPath = binPath; #elif defined(Q_OS_MAC) - QDir foo(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "..")); + QDir foo(FS::PathCombine(binPath, "../..")); m_rootPath = foo.absolutePath(); + // on macOS, touch the root to force Finder to reload the .app metadata (and fix any icon change issues) + FS::updateTimestamp(m_rootPath); #endif #ifdef MULTIMC_JARS_LOCATION -- cgit