mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-12-29 06:12:05 +02:00
Fix extension filter in file selection dialog
This fixes commit eb63294231
This commit is contained in:
parent
46386a2054
commit
dad8d1bad5
@ -118,11 +118,20 @@ void FileLister::browse(bool clean)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (vector<string>::iterator it = vfilter.begin(); it != vfilter.end(); ++it) {
|
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 (it->length() < file.length()) {
|
||||||
|
if (file[file.length() - it->length() - 1] != '.')
|
||||||
|
continue;
|
||||||
|
|
||||||
string file_lowercase =
|
string file_lowercase =
|
||||||
file.substr(file.length() - it->length());
|
file.substr(file.length() - it->length());
|
||||||
if (file_lowercase[0] != '.')
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* XXX: This won't accept UTF-8 codes.
|
/* XXX: This won't accept UTF-8 codes.
|
||||||
* Thanksfully file extensions shouldn't contain any. */
|
* Thanksfully file extensions shouldn't contain any. */
|
||||||
|
Loading…
Reference in New Issue
Block a user