From 7d4236d28133519c30d1c500442393c87439b1f9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 2 Oct 2013 12:24:14 +0200 Subject: [PATCH] QTemporaryDir: Output warnings on removal failure. Change-Id: I38d0a07c355f73899cc5f6eac60bd8cbedc73cb2 Reviewed-by: David Faure --- src/corelib/io/qtemporarydir.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index 755c31f371..f21403d7f1 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -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