2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-09 11:05:12 +00:00

Make Linux file dialog API better

This commit is contained in:
Ilya Fedin
2021-06-23 03:20:40 +04:00
committed by John Preston
parent 8b839f46b2
commit f011c84ce8
8 changed files with 38 additions and 54 deletions

View File

@@ -171,7 +171,7 @@ bool Get(
parent = parent->window();
}
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
if (XDP::Use(type)) {
{
const auto result = XDP::Get(
parent,
files,
@@ -187,15 +187,17 @@ bool Get(
}
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
if (const auto integration = GtkIntegration::Instance()) {
if (integration->useFileDialog(type)) {
return integration->getFileDialog(
parent,
files,
remoteContent,
caption,
filter,
type,
startFile);
const auto result = integration->getFileDialog(
parent,
files,
remoteContent,
caption,
filter,
type,
startFile);
if (result.has_value()) {
return *result;
}
}
// avoid situation when portals don't work