How to make filefilter's patterns case insensitive?



Hello,

Let's say, that I need to provide a Gtk::FileFilter to Gtk::FileChooserDialog, that will show all files with extension .abc, but also .ABC and .aBc etc., and I cannot provide filefilter with mime-type. Is there any simple way to make filefilter pattern (provided with 'void add_pattern (const Glib::ustring& pattern)') case insensitive?

I tried sth like this:
	Glib::ustring tmp = "*.abc";
	fileFilter.add_pattern (tmp.casefold ());
but with no luck.

For now I did:
	fileFilter.add_pattern ("*.[Aa][Bb][Cc]");
but it's kind of inconvenient.

It would be great and intuitive, if the add_pattern method was like:
	void add_pattern (const Glib::ustring& pattern, bool caseSensitive=FALSE);
but well, maybe there's even simpler method, that I'm not aware of?

Regards,
phan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]