Fix choosing directories in snap and flatpak

This commit is contained in:
Ilya Fedin 2020-11-06 10:37:30 +04:00 committed by John Preston
parent 5c8820d5d8
commit aec2b8df7e

View file

@ -113,15 +113,17 @@ bool UseNative(Type type = Type::ReadFile) {
// or if QT_QPA_PLATFORMTHEME=(gtk2|gtk3) // or if QT_QPA_PLATFORMTHEME=(gtk2|gtk3)
// or if portals are used and operation is to open folder // or if portals are used and operation is to open folder
// and portal doesn't support folder choosing // and portal doesn't support folder choosing
const auto sandboxedOrCustomPortal = InFlatpak()
|| InSnap()
|| UseXDGDesktopPortal();
const auto neededForPortal = (type == Type::ReadFolder) const auto neededForPortal = (type == Type::ReadFolder)
&& !CanOpenDirectoryWithPortal(); && !CanOpenDirectoryWithPortal();
const auto neededNonForced = DesktopEnvironment::IsGtkBased() const auto neededNonForced = DesktopEnvironment::IsGtkBased()
|| (UseXDGDesktopPortal() && neededForPortal); || (sandboxedOrCustomPortal && neededForPortal);
const auto excludeNonForced = InFlatpak() const auto excludeNonForced = sandboxedOrCustomPortal && !neededForPortal;
|| InSnap()
|| (UseXDGDesktopPortal() && !neededForPortal);
return IsGtkIntegrationForced() return IsGtkIntegrationForced()
|| (neededNonForced && !excludeNonForced); || (neededNonForced && !excludeNonForced);