Persist app data between install versions

This commit is contained in:
ashuntu 2023-07-07 13:20:15 -05:00
parent b6e9a54951
commit 10678096e5

View File

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