Skip to content

Commit

Permalink
fix: prioritize local filesystem for AppImages in portable mode (fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Mar 26, 2023
1 parent bfb0b98 commit fbf906a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/lib/src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,16 @@ QString savePath(const QString &file, bool exists, bool writable)
}
}

// Install directory
// AppImages should read from their embedded filesystem even when running in portable mode
#ifdef __linux__
if (QCoreApplication::applicationFilePath().endsWith(".AppImage")) {
if (validSavePath(qApp->applicationDirPath() + "/../share/Grabber/" + check, writable)) {
return QDir::toNativeSeparators(qApp->applicationDirPath() + "/../share/Grabber/" + file);
}
}
#endif

// Install directory and portable mode
if (validSavePath(qApp->applicationDirPath() + "/" + check, writable)) {
return QDir::toNativeSeparators(qApp->applicationDirPath() + "/" + file);
}
Expand Down

0 comments on commit fbf906a

Please sign in to comment.