From 78c84c6353257a477efc307e28f713ec70d2247a Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 9 Apr 2019 15:50:57 +0200 Subject: qdoc: Fix warnings about missing \inmodule command Fix warnings qtbase/src/corelib/io/qprocess.cpp:776: (qdoc) warning: Class CreateProcessArguments has no \inmodule command; using project name by default: QtCore qtbase/src/corelib/serialization/qcborstream.cpp:1441: (qdoc) warning: Class StringResult has no \inmodule command; using project name by default: QtCore Change-Id: I1c85ca32aff1f89f70898af7b11cfead96c80349 Reviewed-by: Leena Miettinen --- src/corelib/io/qprocess.cpp | 1 + src/corelib/serialization/qcborstream.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index e1f4a3a311..7b2de02d1d 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -775,6 +775,7 @@ void QProcessPrivate::Channel::clear() /*! \class QProcess::CreateProcessArguments + \inmodule QtCore \note This struct is only available on the Windows platform. This struct is a representation of all parameters of the Windows API diff --git a/src/corelib/serialization/qcborstream.cpp b/src/corelib/serialization/qcborstream.cpp index df38118805..87ae316041 100644 --- a/src/corelib/serialization/qcborstream.cpp +++ b/src/corelib/serialization/qcborstream.cpp @@ -1440,6 +1440,7 @@ bool QCborStreamWriter::endMap() /*! \class QCborStreamReader::StringResult + \inmodule QtCore This class is returned by readString() and readByteArray(), with either the contents of the string that was read or an indication that the parsing is -- cgit v1.2.3 From a3acf568d1785d15ebf4d9973df6f9c277d5158a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 25 Apr 2019 13:10:51 -0700 Subject: Make QFile::copy() less likely to create zero-sized QFile::copy() didn't have the syncToDisk() call that QSaveFile::commit() has. So add it. [ChangeLog][QtCore][QFile] Made QFile::copy() issue a filesystem- synchronization system call, which would make it less likely to result in incomplete or corrupt files if the system reboots or uncleanly shuts down soon after the function returns. New code is advised to use QSaveFile instead, which also allows to display a progress report while copying. Fixes: QTBUG-75407 Change-Id: I95ecabe2f50e450c991afffd1598d09ec73f6482 Reviewed-by: Henrik Hartz Reviewed-by: Volker Hilsheimer Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qfile.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 3166fa1b83..1fb9af576c 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -832,10 +832,16 @@ QFile::copy(const QString &newName) error = true; } } - if (!error && !out.rename(newName)) { - error = true; - close(); - d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName)); + + if (!error) { + // Sync to disk if possible. Ignore errors (e.g. not supported). + d->fileEngine->syncToDisk(); + + if (!out.rename(newName)) { + error = true; + close(); + d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName)); + } } #ifdef QT_NO_TEMPORARYFILE if (error) -- cgit v1.2.3