From eefa6379f9d66134102998346b54e8a017d47407 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 13 Dec 2022 23:47:08 +0100 Subject: [PATCH] I don't see why this would have detached, but make clazy happy --- src/MxcImageProvider.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp index ade12dee..de800e93 100644 --- a/src/MxcImageProvider.cpp +++ b/src/MxcImageProvider.cpp @@ -42,7 +42,8 @@ MxcImageProvider::MxcImageProvider(QObject *parent) QDir::SortFlags(QDir::Name | QDir::IgnoreCase), QDir::Filter::Writable | QDir::Filter::NoDotAndDotDot | QDir::Filter::Files); - for (const auto &fileInfo : dir.entryInfoList()) { + auto files = dir.entryInfoList(); + for (const auto &fileInfo : qAsConst(files)) { if (fileInfo.fileTime(QFile::FileTime::FileAccessTime) .daysTo(QDateTime::currentDateTime()) > 30) { if (QFile::remove(fileInfo.absoluteFilePath()))