summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfileinfo.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2011-08-11 16:17:40 +0200
committerJoão Abecasis <joao.abecasis@nokia.com>2011-08-26 14:07:36 +0200
commit664abe11efdbf582a5433abccf0d8c6fdbe2b040 (patch)
treeede8c86e75272b1b9197a91b13a26cccf654e8e6 /src/corelib/io/qfileinfo.cpp
parentdcee6e1371d899eb79717b8e3f3eec08b765db82 (diff)
Compare non-canonical paths before falling back on expensive computation
Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'src/corelib/io/qfileinfo.cpp')
-rw-r--r--src/corelib/io/qfileinfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 6e2520697c..ff328da941 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -391,6 +391,11 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const
return true;
if (d->isDefaultConstructed || fileinfo.d_ptr->isDefaultConstructed)
return false;
+
+ // Assume files are the same if path is the same
+ if (d->fileEntry.filePath() == fileinfo.d_ptr->fileEntry.filePath())
+ return true;
+
Qt::CaseSensitivity sensitive;
if (d->fileEngine == 0 || fileinfo.d_ptr->fileEngine == 0) {
if (d->fileEngine != fileinfo.d_ptr->fileEngine) // one is native, the other is a custom file-engine