File filter for FileChooser with zenity does not work


#1

When I set a file filter in my FileChooser on Linux with zenity, no files will be shown. I noticed that in the zenity gui the filter has the single quoted filter like '*.png' instead of plain *.png.

Removing the single quotes in juce_linux_FileChooser.cpp on line 138 makes it work again.

 

--- a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp
+++ b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp
@@ -135,7 +135,7 @@ static void addZenityArgs (StringArray& args, String& separator,
         tokens.addTokens (filters, ";,|", "\"");
 
         for (int i = 0; i < tokens.size(); ++i)
-            args.add ("--file-filter='" + tokens[i] + "'");
+            args.add ("--file-filter=" + tokens[i]);
     }
 
     if (file.isDirectory())

#2

Ok, thanks, I'll update that.