Make calling QSaveFile::commit() non-fatal if it's not open.

This commit is contained in:
Felix Geyer 2015-07-09 23:17:04 +02:00
parent f22069bb11
commit 577609b3e3

View File

@ -279,7 +279,10 @@ bool QSaveFile::commit()
Q_D(QSaveFile);
if (!d->tempFile)
return false;
Q_ASSERT(isOpen());
if (!isOpen()) {
qWarning("QSaveFile::commit: File (%s) is not open", qPrintable(fileName()));
return false;
}
QIODevice::close(); // flush and close
if (d->error != QFile::NoError) {
d->tempFile->remove();