- // parse filters
- wxArrayString wildDescriptions, wildFilters;
- if (!wxParseCommonDialogsFilter(m_wildCard, wildDescriptions, wildFilters))
- {
- wxFAIL_MSG( wxT("Wrong file type description") );
- }
- else
- {
- // add parsed to GtkChooser
- for (size_t n = 0; n < wildFilters.GetCount(); n++)
+ // empty current filter list:
+ GSList* ifilters = gtk_file_chooser_list_filters(chooser);
+ GSList* filters = ifilters;
+ while (ifilters)
+ {
+ gtk_file_chooser_remove_filter(chooser,GTK_FILE_FILTER(ifilters->data));
+ ifilters = ifilters->next;
+ }
+ g_slist_free(filters);
+
+ // parse filters
+ wxArrayString wildDescriptions, wildFilters;
+ if (!wxParseCommonDialogsFilter(m_wildCard, wildDescriptions, wildFilters))
+ {
+ wxFAIL_MSG( wxT("Wrong file type description") );
+ }
+ else