projectview: Only append .qet if not snap or flatpak

This commit is contained in:
Maximilian Federle 2022-01-26 13:18:05 +01:00 committed by Laurent Trinques
parent 4334c8ec8c
commit 306f4c7b54

View File

@ -339,8 +339,11 @@ QString ProjectView::askUserForFilePath(bool assign) {
// if no filepath is provided, return an empty string // if no filepath is provided, return an empty string
if (filepath.isEmpty()) return(filepath); if (filepath.isEmpty()) return(filepath);
// if the name does not end with the .qet extension and we're _not_ running as a flatpak, append it // if the name does not end with the .qet extension and we're _not_ using xdg-desktop-portal, append it
if (!filepath.endsWith(".qet", Qt::CaseInsensitive) && !qEnvironmentVariableIsSet("FLATPAK_ID")) filepath += ".qet"; bool usesPortal =
qEnvironmentVariableIsSet("FLATPAK_ID") ||
qEnvironmentVariableIsSet("SNAP_NAME");
if (!filepath.endsWith(".qet", Qt::CaseInsensitive) && !usesPortal) filepath += ".qet";
if (assign) { if (assign) {
// assign the provided filepath to the currently edited project // assign the provided filepath to the currently edited project