summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfileinfo.cpp
diff options
context:
space:
mode:
authorAndreas Kling <info@andreaskling.com>2009-12-21 13:58:28 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-12-21 13:58:54 (GMT)
commit032036bfb3e69c41b9a3c557d4c9322d55154e25 (patch)
treef76395369950c593fa4582c18afa625883d60a74 /src/corelib/io/qfileinfo.cpp
parentddf34f39efcbe679f1a8216df58da0c61e98ec79 (diff)
downloadQt-032036bfb3e69c41b9a3c557d4c9322d55154e25.zip
Qt-032036bfb3e69c41b9a3c557d4c9322d55154e25.tar.gz
Qt-032036bfb3e69c41b9a3c557d4c9322d55154e25.tar.bz2
Warn when calling QFileInfo::absolutePath() on an improper object.
Merge-request: 1821 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Diffstat (limited to 'src/corelib/io/qfileinfo.cpp')
-rw-r--r--src/corelib/io/qfileinfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 61081a1..0a435b9 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -573,6 +573,8 @@ QString QFileInfo::canonicalFilePath() const
QString QFileInfo::absolutePath() const
{
Q_D(const QFileInfo);
+ if (d->data->fileName.isEmpty())
+ qWarning("QFileInfo::absolutePath: Constructed with empty filename");
if(!d->data->fileEngine)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::AbsolutePathName);