diff options
author | ashuntu <101582426+ashuntu@users.noreply.github.com> | 2023-07-07 13:20:15 -0500 |
---|---|---|
committer | ashuntu <101582426+ashuntu@users.noreply.github.com> | 2023-07-07 13:20:15 -0500 |
commit | 10678096e57eb5b344f0dd39ad178403640b722a (patch) | |
tree | 3c9276530c4001892182dc9be7a5e39d36733e1b /launcher/Application.cpp | |
parent | b6e9a5495162c0ffedf99b0d96d1c4daf08c51e9 (diff) | |
download | PrismLauncher-10678096e57eb5b344f0dd39ad178403640b722a.tar.gz PrismLauncher-10678096e57eb5b344f0dd39ad178403640b722a.tar.bz2 PrismLauncher-10678096e57eb5b344f0dd39ad178403640b722a.zip |
Persist app data between install versions
Diffstat (limited to 'launcher/Application.cpp')
-rw-r--r-- | launcher/Application.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 1d97a5f2..b91b3157 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -280,7 +280,16 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) } else { - QDir foo(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "..")); + QDir foo; + if (DesktopServices::isSnap()) + { + foo = QDir(getenv("SNAP_USER_COMMON")); + } + else + { + foo = QDir(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "..")); + } + dataPath = foo.absolutePath(); adjustedBy = "Persistent data path"; |