Skip to content

Commit

Permalink
fix: honor properties.showHiddenFiles on Linux (#15506)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
trop[bot] authored and codebytere committed Nov 2, 2018
1 parent 8e31642 commit acea9d1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions atom/browser/ui/file_dialog_gtk.cc
Expand Up @@ -94,10 +94,14 @@ class FileChooserDialog {
}

void SetupProperties(int properties) {
if (properties & FILE_DIALOG_MULTI_SELECTIONS)
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog()), TRUE);
if (properties & FILE_DIALOG_SHOW_HIDDEN_FILES)
g_object_set(dialog(), "show-hidden", TRUE, NULL);
const auto hasProp = [properties](FileDialogProperty prop) {
return gboolean((properties & prop) != 0);
};
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() {
Expand Down

0 comments on commit acea9d1

Please sign in to comment.