From 4f1567ec97146a88014b1a2c8ad62e136a978aee Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Wed, 26 Jan 2022 13:18:05 +0100 Subject: [PATCH] projectview: Only append .qet if not snap or flatpak --- sources/projectview.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sources/projectview.cpp b/sources/projectview.cpp index d227e5ef5..51bd9ab98 100644 --- a/sources/projectview.cpp +++ b/sources/projectview.cpp @@ -339,8 +339,11 @@ QString ProjectView::askUserForFilePath(bool assign) { // if no filepath is provided, return an empty string 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 (!filepath.endsWith(".qet", Qt::CaseInsensitive) && !qEnvironmentVariableIsSet("FLATPAK_ID")) filepath += ".qet"; + // if the name does not end with the .qet extension and we're _not_ using xdg-desktop-portal, append it + bool usesPortal = + qEnvironmentVariableIsSet("FLATPAK_ID") || + qEnvironmentVariableIsSet("SNAP_NAME"); + if (!filepath.endsWith(".qet", Qt::CaseInsensitive) && !usesPortal) filepath += ".qet"; if (assign) { // assign the provided filepath to the currently edited project