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 <niccolo@venerandi.com>
Gbp-Pq: Name upstream_01978f58_Do-not-track-cache-partitions-with-freespacenotifier.patch
#include <Solid/StorageVolume>
#include <QDir>
+#include <QFile>
#include "kded_interface.h"
if (auto generic = device.as<Solid::GenericInterface>()) {
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;
}