summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qsavefile.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-12-30 16:06:31 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-01-02 12:51:37 +0000
commit79bf4e8f1c4415d92ab335c5a72b9e4c9332fdd3 (patch)
treef4a62a13437d945b18840c882c5951767ad4b4ec /src/corelib/io/qsavefile.cpp
parent59ae55e12e075005ceae6e353ef1ee00817ec751 (diff)
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>
Diffstat (limited to 'src/corelib/io/qsavefile.cpp')
-rw-r--r--src/corelib/io/qsavefile.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp
index 0254eb984f..d8166014db 100644
--- a/src/corelib/io/qsavefile.cpp
+++ b/src/corelib/io/qsavefile.cpp
@@ -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.