aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2018-05-28 12:30:47 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2018-05-28 10:33:04 +0000
commit56a2b70247270c780247a1d2dcc670c3f0f5ab80 (patch)
tree59a8a029b6a43252a16455fd7df4536318cfc497
parent9a44e3b6ca81f0e84d774a95e45b449b5d4cb583 (diff)
Remove old pre-QFileSystemEngine-rewrite code
Once upon a time, calling stat directly on Unix-alike systems gave a significant speed-up compared to calling QFile::exists. These days not so much. It also breaks any use of custom subclasses of QAbstractFileEngine. Task-number: QTBUG-68463 Change-Id: Icae8a16880723dee13c460cfdb15b03dc63c1371 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/qml/qml/qqmltypeloader.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 4dc9c073fe..c656fac4ff 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -1847,15 +1847,7 @@ QString QQmlTypeLoader::absoluteFilePath(const QString &path)
if (*value)
absoluteFilePath = path;
} else {
- bool exists = false;
-#ifdef Q_OS_UNIX
- struct stat statBuf;
- // XXX Avoid encoding entire path. Should store encoded dirpath in cache
- if (::stat(QFile::encodeName(path).constData(), &statBuf) == 0)
- exists = S_ISREG(statBuf.st_mode);
-#else
- exists = QFile::exists(path);
-#endif
+ bool exists = QFile::exists(path);
fileSet->insert(fileName, new bool(exists));
if (exists)
absoluteFilePath = path;