From 1e303a286e0df7723ca0144539407192363cafe3 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 12 Jun 2014 17:02:23 +0200 Subject: 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 Reviewed-by: Jerome Pasion --- src/corelib/io/qfileinfo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/corelib/io') 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() */ -- cgit v1.2.3