1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-12-28 16:01:09 +02:00

Fix extension filter in file selection dialog

This fixes commit eb63294231
This commit is contained in:
Paul Cercueil 2013-07-05 14:42:55 -04:00
parent 46386a2054
commit dad8d1bad5

View File

@ -118,11 +118,20 @@ void FileLister::browse(bool clean)
continue;
for (vector<string>::iterator it = vfilter.begin(); it != vfilter.end(); ++it) {
if (file.find('.') == string::npos) {
if (!it->empty())
continue;
files.push_back(file);
break;
}
if (it->length() < file.length()) {
if (file[file.length() - it->length() - 1] != '.')
continue;
string file_lowercase =
file.substr(file.length() - it->length());
if (file_lowercase[0] != '.')
continue;
/* XXX: This won't accept UTF-8 codes.
* Thanksfully file extensions shouldn't contain any. */