diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-06-04 16:02:06 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-06-24 15:43:58 +0000 |
commit | ec8c1dcf147ac71ea3c0105d67c2575ab733d348 (patch) | |
tree | c7e9f264ee899779d154e3bb0afc3871f61c60d4 /src/corelib/io | |
parent | 0e41a58fb8f15a9a0790db2f33efe32d3c227bc2 (diff) |
Make QDir::relativeFilePath() return "." for a path to itself.
The rationale being that the empty string is not a valid path component.
[ChangeLog][QtCore][QDir] QDir::relativeFilePath() now returns "."
instead of an empty string if the given path is the same as the
directory.
Change-Id: Ibcf31904b2ae5edf5639d4c2e5ba234365d347fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qdir.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 9b1ec3917a..6687ff846c 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -777,6 +777,8 @@ QString QDir::relativeFilePath(const QString &fileName) const result += QLatin1Char('/'); } + if (result.isEmpty()) + return QLatin1String("."); return result; } |