diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-02-16 01:01:21 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-02-16 01:01:21 +0800 |
commit | 3976ee76b10e72b8e6155c6adce5ab28724fd5db (patch) | |
tree | 23d818f921a1bd0f9945d3de4d15b15a66f8fe94 | |
parent | debbe2037d60a1a354185b5c2e378d9ca757ef40 (diff) | |
download | gsoc2013-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).
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | embed/mozilla/FilePicker.cpp | 18 |
2 files changed, 19 insertions, 5 deletions
@@ -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; } |