summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2010-08-30 13:02:29 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2010-09-07 12:17:06 (GMT)
commit7f369fc76079695f00e249e017328fdf6d5e0680 (patch)
tree031de9468fd3547867f1186e24f69aa1fbe484aa
parent659c4d56a075c1f49ece99be38d7e436b2c53581 (diff)
downloadQt-7f369fc76079695f00e249e017328fdf6d5e0680.zip
Qt-7f369fc76079695f00e249e017328fdf6d5e0680.tar.gz
Qt-7f369fc76079695f00e249e017328fdf6d5e0680.tar.bz2
Removed QFileInfoPrivate::initFileEngine
As it served no real purpose. Instead, the relevant bits were inlined in the constructor that used it and makeAbsolute was adapted to use operator=. Reviewed-by: Thomas Zander
-rw-r--r--src/corelib/io/qfileinfo.cpp12
-rw-r--r--src/corelib/io/qfileinfo_p.h5
2 files changed, 4 insertions, 13 deletions
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index fe557d0..ccfc9c2 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -47,15 +47,6 @@
QT_BEGIN_NAMESPACE
-void QFileInfoPrivate::initFileEngine(const QString &file)
-{
- delete fileEngine;
- fileEngine = 0;
- clear();
- fileEngine = QAbstractFileEngine::create(file);
- fileName = file;
-}
-
QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const
{
if (cache_enabled && !fileNames[(int)name].isNull())
@@ -586,7 +577,8 @@ bool QFileInfo::makeAbsolute()
return false;
QString absFileName = d_ptr.constData()->getFileName(QAbstractFileEngine::AbsoluteName);
// QSharedDataPointer::operator->() will detach.
- d_ptr->initFileEngine(absFileName);
+
+ *this = QFileInfo(absFileName);
return true;
}
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h
index 138116e..f23ae53 100644
--- a/src/corelib/io/qfileinfo_p.h
+++ b/src/corelib/io/qfileinfo_p.h
@@ -79,16 +79,15 @@ public:
cachedFlags(0), cache_enabled(copy.cache_enabled), fileFlags(0), fileSize(0)
{}
inline QFileInfoPrivate(const QString &file)
- : QSharedData(), fileEngine(0),
+ : QSharedData(), fileEngine(QAbstractFileEngine::create(file)),
+ fileName(file),
cachedFlags(0), cache_enabled(1), fileFlags(0), fileSize(0)
{
- initFileEngine(file);
}
inline ~QFileInfoPrivate()
{
delete fileEngine;
}
- void initFileEngine(const QString &);
inline void clearFlags() const {
fileFlags = 0;