From 12e599d3a0426539c3f654298bad8915f71bb07b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niccol=C3=B2=20Venerandi?= Date: Thu, 29 May 2025 07:25:03 +0000 Subject: [PATCH] [PATCH] Do not track cache partitions with freespacenotifier MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit BUG:504423 (cherry picked from commit f4a08099d0aae466f06f0094498cc593c8ce4532) e033ef89 Do not track cache partitions with freespacenotifier 5203019a Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Niccolò Venerandi Gbp-Pq: Name upstream_01978f58_Do-not-track-cache-partitions-with-freespacenotifier.patch --- freespacenotifier/module.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/freespacenotifier/module.cpp b/freespacenotifier/module.cpp index 3d8e06c0..1700a369 100644 --- a/freespacenotifier/module.cpp +++ b/freespacenotifier/module.cpp @@ -19,6 +19,7 @@ #include #include +#include #include "kded_interface.h" @@ -74,7 +75,11 @@ void FreeSpaceNotifierModule::onNewSolidDevice(const QString &udi) if (auto generic = device.as()) { isReadOnly = generic->property(QStringLiteral("ReadOnly")).toBool(); } - if (isReadOnly) { + // Cache devices should be marked through a + // CACHEDIR.TAG file to avoid indexing; see + // https://bford.info/cachedir/ for reference. + const bool isCache = QFile::exists(QDir(access->filePath()).filePath(QStringLiteral("CACHEDIR.TAG"))); + if (isReadOnly || isCache) { return; } -- 2.30.2