fix: use legacy data path if it exists
This commit is contained in:
parent
69d01204e0
commit
ca8b62291f
@ -298,6 +298,16 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
QDir foo(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), ".."));
|
QDir foo(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), ".."));
|
||||||
dataPath = foo.absolutePath();
|
dataPath = foo.absolutePath();
|
||||||
adjustedBy += dataPath;
|
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
|
#else
|
||||||
dataPath = applicationDirPath();
|
dataPath = applicationDirPath();
|
||||||
adjustedBy += "Fallback to binary path " + dataPath;
|
adjustedBy += "Fallback to binary path " + dataPath;
|
||||||
|
Loading…
Reference in New Issue
Block a user