QTemporaryDir: Output warnings on removal failure.

Change-Id: I38d0a07c355f73899cc5f6eac60bd8cbedc73cb2
Reviewed-by: David Faure <david.faure@kdab.com>
bb10
Friedemann Kleint 2013-10-02 12:24:14 +02:00 committed by The Qt Project
parent f6dc131628
commit 7d4236d281
1 changed files with 7 additions and 1 deletions

View File

@ -299,7 +299,13 @@ bool QTemporaryDir::remove()
Q_ASSERT(!path().isEmpty());
Q_ASSERT(path() != QLatin1String("."));
return QDir(path()).removeRecursively();
const bool result = QDir(path()).removeRecursively();
if (!result) {
qWarning() << "QTemporaryDir: Unable to remove"
<< QDir::toNativeSeparators(path())
<< "most likely due to the presence of read-only files.";
}
return result;
}
QT_END_NAMESPACE