mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +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/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/linux/base_linux_glibmm_helper.h"
|
||||
#include "storage/localstorage.h"
|
||||
|
@ -642,18 +640,8 @@ rpl::producer<> XDPFileDialog::rejected() {
|
|||
} // namespace
|
||||
|
||||
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();
|
||||
|
||||
return ShouldUse
|
||||
&& Version.has_value()
|
||||
return Version.has_value()
|
||||
&& (type != Type::ReadFolder || *Version >= 3);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue