summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfileinfo.cpp
diff options
context:
space:
mode:
authorAndreas Kling <andreas.kling@nokia.com>2010-01-13 09:37:10 (GMT)
committerAndreas Kling <andreas.kling@nokia.com>2010-01-13 10:54:33 (GMT)
commit15b10bf77dde5235083f383c186e809c16e2e56a (patch)
tree67f9257045ea2b42e682dabf2565026f3c76f93f /src/corelib/io/qfileinfo.cpp
parentdd62687182830aa353ef573f653fe913fd42a8d0 (diff)
downloadQt-15b10bf77dde5235083f383c186e809c16e2e56a.zip
Qt-15b10bf77dde5235083f383c186e809c16e2e56a.tar.gz
Qt-15b10bf77dde5235083f383c186e809c16e2e56a.tar.bz2
Remove erroneous warning in QFileInfo::absolutePath()
QFileInfo().absolutePath() is legal and shouldn't produce a warning. Reviewed-by: João Abecasis
Diffstat (limited to 'src/corelib/io/qfileinfo.cpp')
-rw-r--r--src/corelib/io/qfileinfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index b4437db..e90529e 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -573,10 +573,13 @@ QString QFileInfo::canonicalFilePath() const
QString QFileInfo::absolutePath() const
{
Q_D(const QFileInfo);
- if (d->data->fileName.isEmpty())
+
+ if (!d->data->fileEngine) {
+ return QLatin1String("");
+ } else if (d->data->fileName.isEmpty()) {
qWarning("QFileInfo::absolutePath: Constructed with empty filename");
- if(!d->data->fileEngine)
return QLatin1String("");
+ }
return d->getFileName(QAbstractFileEngine::AbsolutePathName);
}