diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-06-12 17:02:23 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@digia.com> | 2014-06-25 13:34:07 +0200 |
commit | 1e303a286e0df7723ca0144539407192363cafe3 (patch) | |
tree | 3bcdd034637a5ab7c079786556d0f5eb55fd045c /src | |
parent | 51d6df1d18322c630f79567ed22de3718436d78d (diff) |
Mark behavior of QFileInfo::absoluteFilePath as undefined in corner cases
The current description was misleading, since e.g.
QFileInfo().absoluteFilePath()
will always return an empty string.
QFileInfo("").absoluteFilePath()
however will return the current working directory ...
Instead of documenting these small quirks we should rather mark the
exact behavior as undefined, like we already do for absolutePath().
Change-Id: I70358413528429c2c2dee37480ad018aae26e6cb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qfileinfo.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 60f7e47e62..210bb3898c 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -530,7 +530,8 @@ void QFileInfo::setFile(const QDir &dir, const QString &file) is true. In contrast to canonicalFilePath(), symbolic links or redundant "." or ".." elements are not necessarily removed. - If the QFileInfo is empty it returns QDir::currentPath(). + \warning If filePath() is empty the behavior of this function + is undefined. \sa filePath(), canonicalFilePath(), isRelative() */ @@ -572,8 +573,8 @@ QString QFileInfo::canonicalFilePath() const In contrast to canonicalPath() symbolic links or redundant "." or ".." elements are not necessarily removed. - \warning If the QFileInfo object was created with an empty QString, - the behavior of this function is undefined. + \warning If filePath() is empty the behavior of this function + is undefined. \sa absoluteFilePath(), path(), canonicalPath(), fileName(), isRelative() */ |