mirror of
https://github.com/overte-org/overte.git
synced 2025-08-17 18:10:38 +02:00
Merge pull request #6583 from birarda/extension-ci
use a case insensitive check for extensions in Application
This commit is contained in:
commit
6cf1ad464f
2 changed files with 6 additions and 4 deletions
|
@ -4071,7 +4071,7 @@ bool Application::canAcceptURL(const QString& urlString) {
|
|||
QString lowerPath = url.path().toLower();
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
if (lowerPath.endsWith(i.key())) {
|
||||
if (lowerPath.endsWith(i.key(), Qt::CaseInsensitive)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -4091,7 +4091,7 @@ bool Application::acceptURL(const QString& urlString, bool defaultUpload) {
|
|||
QString lowerPath = url.path().toLower();
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
if (lowerPath.endsWith(i.key())) {
|
||||
if (lowerPath.endsWith(i.key(), Qt::CaseInsensitive)) {
|
||||
AcceptURLMethod method = i.value();
|
||||
return (this->*method)(urlString);
|
||||
}
|
||||
|
@ -4191,7 +4191,7 @@ bool Application::askToUploadAsset(const QString& filename) {
|
|||
messageBox.setDefaultButton(QMessageBox::Ok);
|
||||
|
||||
// Option to drop model in world for models
|
||||
if (filename.endsWith(FBX_EXTENSION) || filename.endsWith(OBJ_EXTENSION)) {
|
||||
if (filename.endsWith(FBX_EXTENSION, Qt::CaseInsensitive) || filename.endsWith(OBJ_EXTENSION, Qt::CaseInsensitive)) {
|
||||
auto checkBox = new QCheckBox(&messageBox);
|
||||
checkBox->setText("Add to scene");
|
||||
messageBox.setCheckBox(checkBox);
|
||||
|
@ -4226,7 +4226,8 @@ void Application::modelUploadFinished(AssetUpload* upload, const QString& hash)
|
|||
auto filename = QFileInfo(upload->getFilename()).fileName();
|
||||
|
||||
if ((upload->getError() == AssetUpload::NoError) &&
|
||||
(filename.endsWith(FBX_EXTENSION) || filename.endsWith(OBJ_EXTENSION))) {
|
||||
(upload->getExtension().endsWith(FBX_EXTENSION, Qt::CaseInsensitive) ||
|
||||
upload->getExtension().endsWith(OBJ_EXTENSION, Qt::CaseInsensitive))) {
|
||||
|
||||
auto entities = DependencyManager::get<EntityScriptingInterface>();
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ void AssetUpload::start() {
|
|||
|
||||
// file opened, read the data and grab the extension
|
||||
_extension = QFileInfo(_filename).suffix();
|
||||
_extension = _extension.toLower();
|
||||
|
||||
_data = file.readAll();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue