diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2011-08-11 14:17:40 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2011-08-26 12:07:36 (GMT) |
commit | 664abe11efdbf582a5433abccf0d8c6fdbe2b040 (patch) | |
tree | ede8c86e75272b1b9197a91b13a26cccf654e8e6 /src/corelib/io/qfileinfo.cpp | |
parent | dcee6e1371d899eb79717b8e3f3eec08b765db82 (diff) | |
download | Qt-664abe11efdbf582a5433abccf0d8c6fdbe2b040.zip Qt-664abe11efdbf582a5433abccf0d8c6fdbe2b040.tar.gz Qt-664abe11efdbf582a5433abccf0d8c6fdbe2b040.tar.bz2 |
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.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 6e25206..ff328da 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 |