diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-10 00:12:14 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-10 00:12:14 (GMT) |
commit | 5c0d1ab1236b895e84d254ac6670c802e9162952 (patch) | |
tree | 18532f03e7cae7fb88b00d8b9d4d7514c50ea0ab /src/corelib/io/qdir.cpp | |
parent | 62c5bafeec64ef5a81a9011b4cf377b5d1d20653 (diff) | |
parent | ad35d25e78c8252a72108a4ba931934047c4707e (diff) | |
download | Qt-5c0d1ab1236b895e84d254ac6670c802e9162952.zip Qt-5c0d1ab1236b895e84d254ac6670c802e9162952.tar.gz Qt-5c0d1ab1236b895e84d254ac6670c802e9162952.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging:
Merge fixes for QDir::operator==
QSslCertificate: block all DigiNotar (intermediate and root) certs
Restore Qt4.7 behaviour of QFileInfo::absolute(File)Path
Fix compile error on MSVC2008
Fix comparison of absolute, unclean paths in QDir
Wrap calls to Sequence::push_back
Diffstat (limited to 'src/corelib/io/qdir.cpp')
-rw-r--r-- | src/corelib/io/qdir.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index d9086c1..4ba8e06 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -198,7 +198,7 @@ inline void QDirPrivate::resolveAbsoluteEntry() const QString absoluteName; if (fileEngine.isNull()) { - if (!dirEntry.isRelative()) { + if (!dirEntry.isRelative() && dirEntry.isClean()) { absoluteDirEntry = dirEntry; return; } @@ -1638,8 +1638,19 @@ bool QDir::operator==(const QDir &dir) const if (d->dirEntry.filePath() == other->dirEntry.filePath()) return true; - // Fallback to expensive canonical path computation - return canonicalPath().compare(dir.canonicalPath(), sensitive) == 0; + if (exists()) { + if (!dir.exists()) + return false; //can't be equal if only one exists + // Both exist, fallback to expensive canonical path computation + return canonicalPath().compare(dir.canonicalPath(), sensitive) == 0; + } else { + if (dir.exists()) + return false; //can't be equal if only one exists + // Neither exists, compare absolute paths rather than canonical (which would be empty strings) + d->resolveAbsoluteEntry(); + other->resolveAbsoluteEntry(); + return d->absoluteDirEntry.filePath().compare(other->absoluteDirEntry.filePath(), sensitive) == 0; + } } return false; } |