mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 20:54:25 +02:00
make filename extension checking less wrong
This commit is contained in:
parent
c7540af787
commit
9ef9452cf6
1 changed files with 2 additions and 3 deletions
|
@ -29,10 +29,9 @@ QString& PathUtils::resourcesPath() {
|
|||
|
||||
|
||||
QString fileNameWithoutExtension(const QString& fileName, const QVector<QString> possibleExtensions) {
|
||||
QString fileNameLowered = fileName.toLower();
|
||||
foreach (const QString possibleExtension, possibleExtensions) {
|
||||
if (fileName.endsWith(possibleExtension) ||
|
||||
fileName.endsWith(possibleExtension.toUpper()) ||
|
||||
fileName.endsWith(possibleExtension.toLower())) {
|
||||
if (fileNameLowered.endsWith(possibleExtension.toLower())) {
|
||||
return fileName.left(fileName.count() - possibleExtension.count() - 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue