aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--embed/mozilla/FilePicker.cpp18
2 files changed, 19 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index dd198a0d9..635fd6cd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2004-02-15 Christian Persch <chpe@cvs.gnome.org>
+ * embed/mozilla/FilePicker.cpp: (::AppendFilter):
+
+ Make it work (TM).
+
+2004-02-15 Christian Persch <chpe@cvs.gnome.org>
+
* embed/mozilla/FilePicker.cpp: (::Show), (::GFilePicker),
(::~GFilePicker):
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;
}