mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Prefer portal file dialog in all environments
This commit is contained in:
parent
d8ffc114d3
commit
16ba20f898
1 changed files with 1 additions and 13 deletions
|
@ -8,8 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "platform/linux/linux_xdp_file_dialog.h"
|
#include "platform/linux/linux_xdp_file_dialog.h"
|
||||||
|
|
||||||
#include "platform/platform_file_utilities.h"
|
#include "platform/platform_file_utilities.h"
|
||||||
#include "platform/linux/linux_desktop_environment.h"
|
|
||||||
#include "platform/linux/specific_linux.h"
|
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
#include "base/platform/linux/base_linux_glibmm_helper.h"
|
#include "base/platform/linux/base_linux_glibmm_helper.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
|
@ -642,18 +640,8 @@ rpl::producer<> XDPFileDialog::rejected() {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
bool Use(Type type) {
|
bool Use(Type type) {
|
||||||
static const auto ShouldUse = [&] {
|
|
||||||
const auto envVar = qEnvironmentVariableIsSet("TDESKTOP_USE_PORTAL");
|
|
||||||
const auto confined = InFlatpak() || InSnap();
|
|
||||||
const auto notGtkBased = !DesktopEnvironment::IsGtkBased();
|
|
||||||
|
|
||||||
return confined || notGtkBased || envVar;
|
|
||||||
}();
|
|
||||||
|
|
||||||
static const auto Version = FileChooserPortalVersion();
|
static const auto Version = FileChooserPortalVersion();
|
||||||
|
return Version.has_value()
|
||||||
return ShouldUse
|
|
||||||
&& Version.has_value()
|
|
||||||
&& (type != Type::ReadFolder || *Version >= 3);
|
&& (type != Type::ReadFolder || *Version >= 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue