Added QSaveFile to the bootstrap library

It's quite a simple addition and required for the ahead of time compilation
tool for qtdeclarative.

Change-Id: Iba85ae5182919cdb5ab15a0b643e57c103eae632
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Simon Hausmann 2016-12-30 16:06:31 +01:00
parent 59ae55e12e
commit 79bf4e8f1c
3 changed files with 20 additions and 5 deletions

View File

@ -104,13 +104,14 @@ QSaveFilePrivate::~QSaveFilePrivate()
\sa QTextStream, QDataStream, QFileInfo, QDir, QFile, QTemporaryFile
*/
/*!
Constructs a new file object with the given \a parent.
*/
QSaveFile::QSaveFile(QObject *parent)
: QFileDevice(*new QSaveFilePrivate, parent)
#ifdef QT_NO_QOBJECT
QSaveFile::QSaveFile(const QString &name)
: QFileDevice(*new QSaveFilePrivate)
{
Q_D(QSaveFile);
d->fileName = name;
}
#else
/*!
Constructs a new file object to represent the file with the given \a name.
*/
@ -120,6 +121,14 @@ QSaveFile::QSaveFile(const QString &name)
Q_D(QSaveFile);
d->fileName = name;
}
/*!
Constructs a new file object with the given \a parent.
*/
QSaveFile::QSaveFile(QObject *parent)
: QFileDevice(*new QSaveFilePrivate, parent)
{
}
/*!
Constructs a new file object with the given \a parent to represent the
file with the specified \a name.
@ -130,6 +139,7 @@ QSaveFile::QSaveFile(const QString &name, QObject *parent)
Q_D(QSaveFile);
d->fileName = name;
}
#endif
/*!
Destroys the file object, discarding the saved contents unless commit() was called.

View File

@ -58,14 +58,18 @@ class QSaveFilePrivate;
class Q_CORE_EXPORT QSaveFile : public QFileDevice
{
#ifndef QT_NO_QOBJECT
Q_OBJECT
#endif
Q_DECLARE_PRIVATE(QSaveFile)
public:
explicit QSaveFile(const QString &name);
#ifndef QT_NO_QOBJECT
explicit QSaveFile(QObject *parent = Q_NULLPTR);
explicit QSaveFile(const QString &name, QObject *parent);
#endif
~QSaveFile();
QString fileName() const Q_DECL_OVERRIDE;

View File

@ -46,6 +46,7 @@ SOURCES += \
../../corelib/io/qresource.cpp \
../../corelib/io/qtemporaryfile.cpp \
../../corelib/io/qtextstream.cpp \
../../corelib/io/qsavefile.cpp \
../../corelib/io/qstandardpaths.cpp \
../../corelib/io/qloggingcategory.cpp \
../../corelib/io/qloggingregistry.cpp \