fix: honor properties.showHiddenFiles on Linux (#15503)

Previously the code only set the GtkFileChooser's property if `properties.showHiddenFiles` was set. 

This PR unconditionally sets the GtkFileChooser's property so that hidden files will be hidden if `properties.showHiddenFiles` was not set.
This commit is contained in:
Charles Kerr 2018-10-31 16:13:01 -05:00 committed by GitHub
parent a8f2646ba6
commit feb31d088b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,10 +94,14 @@ class FileChooserDialog {
} }
void SetupProperties(int properties) { void SetupProperties(int properties) {
if (properties & FILE_DIALOG_MULTI_SELECTIONS) const auto hasProp = [properties](FileDialogProperty prop) {
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog()), TRUE); return gboolean((properties & prop) != 0);
if (properties & FILE_DIALOG_SHOW_HIDDEN_FILES) };
g_object_set(dialog(), "show-hidden", TRUE, NULL); auto* file_chooser = GTK_FILE_CHOOSER(dialog());
gtk_file_chooser_set_select_multiple(file_chooser,
hasProp(FILE_DIALOG_MULTI_SELECTIONS));
gtk_file_chooser_set_show_hidden(file_chooser,
hasProp(FILE_DIALOG_SHOW_HIDDEN_FILES));
} }
void RunAsynchronous() { void RunAsynchronous() {