diff options
Diffstat (limited to 'embed/mozilla/FilePicker.cpp')
-rw-r--r-- | embed/mozilla/FilePicker.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp index ee275af19..77e1c436c 100644 --- a/embed/mozilla/FilePicker.cpp +++ b/embed/mozilla/FilePicker.cpp @@ -188,19 +188,27 @@ NS_IMETHODIMP GFilePicker::AppendFilters(PRInt32 filterMask) /* void appendFilter (in wstring title, in wstring filter); */ NS_IMETHODIMP GFilePicker::AppendFilter(const PRUnichar *title, const PRUnichar *filter) { - GtkFileFilter *filth; - LOG ("GFilePicker::AppendFilter title '%s' for '%s'", NS_ConvertUCS2toUTF8 (title).get(), NS_ConvertUCS2toUTF8 (filter).get()) - filth = gtk_file_filter_new (); + nsCAutoString pattern = NS_ConvertUCS2toUTF8 (filter); + pattern.StripWhitespace(); - gtk_file_filter_set_name (filth, NS_ConvertUCS2toUTF8(title).get()); - gtk_file_filter_add_pattern (filth, NS_ConvertUCS2toUTF8(filter).get()); + char **patterns = g_strsplit (pattern.get(), ";", -1); + + GtkFileFilter *filth = gtk_file_filter_new (); + + for (int i = 0; patterns[i] != NULL; i++) + { + gtk_file_filter_add_pattern (filth, patterns[i]); + } + gtk_file_filter_set_name (filth, NS_ConvertUCS2toUTF8(title).get()); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (mDialog), filth); + g_strfreev (patterns); + return NS_OK; } |