From ca8b62291fe47554effaf625b5c52807802a58a9 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Feb 2022 20:20:11 +0100 Subject: [PATCH] fix: use legacy data path if it exists --- launcher/Application.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index fa5d267e..bf644ea6 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -298,6 +298,16 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) QDir foo(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "..")); dataPath = foo.absolutePath(); adjustedBy += dataPath; + +#ifdef Q_OS_LINUX + // TODO: this should be removed in a future version + // TODO: provide a migration path similar to macOS migration + QDir bar(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation), "polymc")); + if (bar.exists()) { + dataPath = bar.absolutePath(); + adjustedBy += "Legacy data path " + dataPath; + } +#endif #else dataPath = applicationDirPath(); adjustedBy += "Fallback to binary path " + dataPath;