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) { ReadIntOption(settings, "file_dialog_type", [&](auto v) {
const auto typedValue = Platform::FileDialog::ImplementationType(v); using Platform::FileDialog::ImplementationType;
if (typedValue >= Platform::FileDialog::ImplementationType::Default if (v >= int(ImplementationType::Default)
&& typedValue < Platform::FileDialog::ImplementationType::Count) { && v < int(ImplementationType::Count)) {
SetFileDialogType(typedValue); 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) { QString ImplementationTypeLabel(ImplementationType value) {
switch (value) { switch (value) {
case ImplementationType::XDP: return qsl("XDG Desktop Portal"); case ImplementationType::XDP: return qsl("XDG Desktop Portal");
case ImplementationType::GTK: return qsl("GTK");
case ImplementationType::Qt: return qsl("Qt"); case ImplementationType::Qt: return qsl("Qt");
} }
Unexpected("Value in Platform::FileDialog::ImplementationTypeLabel."); Unexpected("Value in Platform::FileDialog::ImplementationTypeLabel.");
@ -105,14 +104,6 @@ QString ImplementationTypeDescription(ImplementationType value) {
#ifdef DESKTOP_APP_DISABLE_DBUS_INTEGRATION #ifdef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
case ImplementationType::XDP: return tr::ktg_file_dialog_disabled_on_build(tr::now); case ImplementationType::XDP: return tr::ktg_file_dialog_disabled_on_build(tr::now);
#endif // DESKTOP_APP_DISABLE_DBUS_INTEGRATION #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(); return QString();
} }

View file

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