aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-02-16 01:01:21 +0800
committerChristian Persch <chpe@src.gnome.org>2004-02-16 01:01:21 +0800
commit3976ee76b10e72b8e6155c6adce5ab28724fd5db (patch)
tree23d818f921a1bd0f9945d3de4d15b15a66f8fe94 /embed
parentdebbe2037d60a1a354185b5c2e378d9ca757ef40 (diff)
downloadgsoc2013-epiphany-3976ee76b10e72b8e6155c6adce5ab28724fd5db.tar
gsoc2013-epiphany-3976ee76b10e72b8e6155c6adce5ab28724fd5db.tar.gz
gsoc2013-epiphany-3976ee76b10e72b8e6155c6adce5ab28724fd5db.tar.bz2
gsoc2013-epiphany-3976ee76b10e72b8e6155c6adce5ab28724fd5db.tar.lz
gsoc2013-epiphany-3976ee76b10e72b8e6155c6adce5ab28724fd5db.tar.xz
gsoc2013-epiphany-3976ee76b10e72b8e6155c6adce5ab28724fd5db.tar.zst
gsoc2013-epiphany-3976ee76b10e72b8e6155c6adce5ab28724fd5db.zip
Make it work (TM).
2004-02-15 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/FilePicker.cpp: (::AppendFilter): Make it work (TM).
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/FilePicker.cpp18
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;
}