From 79281991e21bb5bd3a6f3288ac934aa4c2b33fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 25 Nov 2010 10:47:42 +0100 Subject: Let's use engine's understanding of relative path As much as I'd like to have the definition of "relative" be independent of custom engines, the current architecture prevents us from doing that without introducing knowledge about them in QFileSystemEntry. Fixing this specifically for resource files would be possible, but let's not break custom engines... just yet. Reviewed-by: Prasanth Ullattil --- src/corelib/io/qdir.cpp | 4 +++- src/corelib/io/qfileinfo.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 22a3baa..e1fed0d 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1544,7 +1544,9 @@ bool QDir::isRoot() const */ bool QDir::isRelative() const { - return d_ptr->dirEntry.isRelative(); + if (d_ptr->fileEngine.isNull()) + return d_ptr->dirEntry.isRelative(); + return d_ptr->fileEngine->isRelativePath(); } diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 471da2e..9041c94 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -623,7 +623,9 @@ bool QFileInfo::isRelative() const Q_D(const QFileInfo); if (d->isDefaultConstructed) return true; - return d->fileEntry.isRelative(); + if (d->fileEngine == 0) + return d->fileEntry.isRelative(); + return d->fileEngine->isRelativePath(); } /*! -- cgit v0.12