From 9c4cb4bd2d49a2429b71b2eea1522efcf41f1ded Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 26 Sep 2014 16:53:29 +0200 Subject: Use case insensitive comparison instead of toLower(). Change-Id: I73907afab82cdef8e717def6095cd7d03236fadf Reviewed-by: Joerg Bornemann --- src/activeqt/container/qaxbase.cpp | 4 ++-- src/activeqt/control/qaxfactory.cpp | 2 +- src/activeqt/control/qaxserver.cpp | 2 +- tools/testcon/changeproperties.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp index 58d59f2..f88172c 100644 --- a/src/activeqt/container/qaxbase.cpp +++ b/src/activeqt/container/qaxbase.cpp @@ -990,7 +990,7 @@ QAxMetaObject *QAxBase::internalMetaObject() const */ bool QAxBase::setControl(const QString &c) { - if (c.toLower() == d->ctrl.toLower()) + if (!c.compare(d->ctrl, Qt::CaseInsensitive)) return !d->ctrl.isEmpty(); QString search = c; @@ -1025,7 +1025,7 @@ bool QAxBase::setControl(const QString &c) search = c; } - if (search.toLower() == d->ctrl.toLower()) + if (!search.compare(d->ctrl, Qt::CaseInsensitive)) return !d->ctrl.isEmpty(); clear(); diff --git a/src/activeqt/control/qaxfactory.cpp b/src/activeqt/control/qaxfactory.cpp index b510f18..bee8c16 100644 --- a/src/activeqt/control/qaxfactory.cpp +++ b/src/activeqt/control/qaxfactory.cpp @@ -492,7 +492,7 @@ bool QAxFactory::registerActiveObject(QObject *object) if (qstricmp(object->metaObject()->classInfo(object->metaObject()->indexOfClassInfo("RegisterObject")).value(), "yes")) return false; - if (!QString::fromWCharArray(qAxModuleFilename).toLower().endsWith(QLatin1String(".exe"))) + if (!QString::fromWCharArray(qAxModuleFilename).endsWith(QLatin1String(".exe"), Qt::CaseInsensitive)) return false; ActiveObject *active = new ActiveObject(object, qAxFactory()); diff --git a/src/activeqt/control/qaxserver.cpp b/src/activeqt/control/qaxserver.cpp index 58b3faf..0f2e0ff 100644 --- a/src/activeqt/control/qaxserver.cpp +++ b/src/activeqt/control/qaxserver.cpp @@ -303,7 +303,7 @@ HRESULT UpdateRegistry(BOOL bRegister) settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/Control/."), QVariant(QLatin1String(""))); if (insertable) settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/Insertable/."), QVariant(QLatin1String(""))); - if (file.right(3).toLower() == QLatin1String("dll")) + if (file.endsWith(QLatin1String("dll"), Qt::CaseInsensitive)) settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/InProcServer32/."), file); else settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/LocalServer32/."), diff --git a/tools/testcon/changeproperties.cpp b/tools/testcon/changeproperties.cpp index 3a7fb68..df8000d 100644 --- a/tools/testcon/changeproperties.cpp +++ b/tools/testcon/changeproperties.cpp @@ -141,8 +141,8 @@ void ChangeProperties::on_buttonSet_clicked() break; case QVariant::Bool: { - QString txt = editValue->text().toLower(); - value = QVariant(txt != QLatin1String("0") && txt != QLatin1String("false")); + const QString txt = editValue->text(); + value = QVariant(txt != QLatin1String("0") && txt.compare(QLatin1String("false"), Qt::CaseInsensitive)); } break; case QVariant::List: -- cgit v1.2.1