Remove gtk file dialog option (#189)

Since gtk file dialog implementation was removed from tdesktop
This commit is contained in:
ilya-fedin 2021-07-20 01:04:07 +00:00 committed by GitHub
parent 7f295113e0
commit f541e46147
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 14 deletions

View file

@ -650,10 +650,13 @@ bool Manager::readCustomFile() {
});
ReadIntOption(settings, "file_dialog_type", [&](auto v) {
const auto typedValue = Platform::FileDialog::ImplementationType(v);
if (typedValue >= Platform::FileDialog::ImplementationType::Default
&& typedValue < Platform::FileDialog::ImplementationType::Count) {
SetFileDialogType(typedValue);
using Platform::FileDialog::ImplementationType;
if (v >= int(ImplementationType::Default)
&& v < int(ImplementationType::Count)) {
SetFileDialogType(ImplementationType(v));
} else if (v >= int(ImplementationType::Count)) {
SetFileDialogType(ImplementationType(
int(ImplementationType::Count) - 1));
}
});

View file

@ -94,7 +94,6 @@ namespace FileDialog {
QString ImplementationTypeLabel(ImplementationType value) {
switch (value) {
case ImplementationType::XDP: return qsl("XDG Desktop Portal");
case ImplementationType::GTK: return qsl("GTK");
case ImplementationType::Qt: return qsl("Qt");
}
Unexpected("Value in Platform::FileDialog::ImplementationTypeLabel.");
@ -105,14 +104,6 @@ QString ImplementationTypeDescription(ImplementationType value) {
#ifdef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
case ImplementationType::XDP: return tr::ktg_file_dialog_disabled_on_build(tr::now);
#endif // DESKTOP_APP_DISABLE_DBUS_INTEGRATION
#ifdef DESKTOP_APP_DISABLE_GTK_INTEGRATION
case ImplementationType::GTK: return tr::ktg_file_dialog_disabled_on_build(tr::now);
#else // DESKTOP_APP_DISABLE_GTK_INTEGRATION
case ImplementationType::GTK:
return GtkIntegration::Instance()
? QString()
: tr::ktg_file_dialog_disabled_by_option(tr::now);
#endif // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
}
return QString();
}

View file

@ -30,7 +30,6 @@ namespace FileDialog {
enum class ImplementationType {
Default,
XDP,
GTK,
Qt,
Count,
};