From: Niccolò Venerandi Date: Thu, 29 May 2025 07:25:03 +0000 (+0000) Subject: [PATCH] Do not track cache partitions with freespacenotifier X-Git-Tag: archive/raspbian/4%6.3.6-2+rpi1^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=12e599d3a0426539c3f654298bad8915f71bb07b;p=plasma-workspace.git [PATCH] Do not track cache partitions with freespacenotifier 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 --- 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; }