fix: use legacy data path if it exists

This commit is contained in:
Sefa Eyeoglu 2022-02-14 20:20:11 +01:00 committed by txtsd
parent 69d01204e0
commit ca8b62291f
No known key found for this signature in database
GPG Key ID: 000F85679D4B6B53

View File

@ -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;