File: upstream_01978f58_Do-not-track-cache-partitions-with-freespacenotifier.patch

package info (click to toggle)
plasma-workspace 4%3A6.3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,900 kB
  • sloc: cpp: 125,434; xml: 31,579; python: 3,976; perl: 572; sh: 234; javascript: 74; ruby: 39; ansic: 13; makefile: 9
file content (49 lines) | stat: -rw-r--r-- 1,568 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 01978f583ae1d2878830ccd8b58c4b3e0c39f257 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niccol=C3=B2=20Venerandi?= <niccolo@venerandi.com>
Date: Thu, 29 May 2025 07:25:03 +0000
Subject: [PATCH] Do not track cache partitions with freespacenotifier
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
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 <niccolo@venerandi.com>
---
 freespacenotifier/module.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/freespacenotifier/module.cpp b/freespacenotifier/module.cpp
index 3d8e06c0a4..1700a3695d 100644
--- a/freespacenotifier/module.cpp
+++ b/freespacenotifier/module.cpp
@@ -19,6 +19,7 @@
 #include <Solid/StorageVolume>
 
 #include <QDir>
+#include <QFile>
 
 #include "kded_interface.h"
 
@@ -74,7 +75,11 @@ void FreeSpaceNotifierModule::onNewSolidDevice(const QString &udi)
     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;
     }
 
-- 
GitLab