OSDN Git Service

remove redundant QDeclarative_isFileCaseCorrect()
authorIvailo Monev <xakepa10@gmail.com>
Sun, 27 Dec 2020 06:30:01 +0000 (06:30 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 27 Dec 2020 06:30:01 +0000 (06:30 +0000)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/declarative/qml/qdeclarativedirparser.cpp
src/declarative/qml/qdeclarativeengine.cpp
src/declarative/qml/qdeclarativeglobal_p.h
src/declarative/qml/qdeclarativeimport.cpp
src/declarative/qml/qdeclarativetypeloader.cpp

index a0eb85f..4b3f415 100644 (file)
@@ -98,12 +98,7 @@ bool QDeclarativeDirParser::parse()
 
     if (_source.isEmpty() && !_filePathSouce.isEmpty()) {
         QFile file(_filePathSouce);
-        if (!QDeclarative_isFileCaseCorrect(_filePathSouce)) {
-            QDeclarativeError error;
-            error.setDescription(QString::fromUtf8("cannot load module \"$$URI$$\": File name case mismatch for \"%1\"").arg(_filePathSouce));
-            _errors.prepend(error);
-            return false;
-        } else if (file.open(QFile::ReadOnly)) {
+        if (file.open(QFile::ReadOnly)) {
             _source = QString::fromUtf8(file.readAll());
         } else {
             QDeclarativeError error;
index a2b6c7b..a9e15d5 100644 (file)
@@ -2398,12 +2398,6 @@ const QMetaObject *QDeclarativeEnginePrivate::metaObjectForType(int t) const
     }
 }
 
-bool QDeclarative_isFileCaseCorrect(const QString &fileName)
-{
-    Q_UNUSED(fileName)
-    return true;
-}
-
 QT_END_NAMESPACE
 
 #include "moc_qdeclarativeengine.h"
index 5f082d2..51fad3d 100644 (file)
@@ -62,19 +62,6 @@ struct QDeclarativeGraphics_DerivedObject : public QObject
 };
 
 /*!
-    Returns true if the case of \a fileName is equivalent to the file case of 
-    \a fileName on disk, and false otherwise.
-
-    This is used to ensure that the behavior of QML on a case-insensitive file 
-    system is the same as on a case-sensitive file system.  This function 
-    performs a "best effort" attempt to determine the real case of the file. 
-    It may have false positives (say the case is correct when it isn't), but it
-    should never have a false negative (say the case is incorrect when it is 
-    correct).
-*/
-bool QDeclarative_isFileCaseCorrect(const QString &fileName);
-
-/*!
     Makes the \a object a child of \a parent.  Note that when using this method,
     neither \a parent nor the object's previous parent (if it had one) will
     receive ChildRemoved or ChildAdded events.
index f7400a0..9702624 100644 (file)
@@ -932,11 +932,6 @@ bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QSt
     }
 
     if (!engineInitialized || !typesRegistered) {
-        if (!QDeclarative_isFileCaseCorrect(absoluteFilePath)) {
-            if (errorString) 
-                *errorString = tr("File name case mismatch for \"%1\"").arg(absoluteFilePath);
-            return false;
-        }
         QPluginLoader loader(absoluteFilePath);
 
         if (!loader.load()) {
index 378f273..70f232a 100644 (file)
@@ -517,13 +517,6 @@ void QDeclarativeDataLoader::load(QDeclarativeDataBlob *blob)
     QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(blob->m_url);
 
     if (!lf.isEmpty()) {
-        if (!QDeclarative_isFileCaseCorrect(lf)) {
-            QDeclarativeError error;
-            error.setUrl(blob->m_url);
-            error.setDescription(QLatin1String("File name case mismatch"));
-            blob->setError(error);
-            return;
-        }
         QFile file(lf);
         if (file.open(QFile::ReadOnly)) {
             QByteArray data = file.readAll();