summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Müller2024-10-06 15:56:59 +0200
committerWolfgang Müller2024-10-06 15:56:59 +0200
commit7c92bb9645e10ab15291d581648c04697cf9e280 (patch)
treee720b4ef1e78124e82f4d419e4e7ebff368a88d9
parent52d204ddadde5a22d2d4cd4d18f629bc76389162 (diff)
downloadportage-roles-7c92bb9645e10ab15291d581648c04697cf9e280.tar.gz
desktop-plasma: Fix trash size calculation for kde-frameworks/kio:6
Reported and merged upstream at [1] but will probably take a while until it's available in a release. [1] https://invent.kde.org/frameworks/kio/-/merge_requests/1729
-rw-r--r--desktop-plasma/patches/kde-frameworks/kio:6/0001-TrashSizeCache-Use-correct-iterator-flags.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/desktop-plasma/patches/kde-frameworks/kio:6/0001-TrashSizeCache-Use-correct-iterator-flags.patch b/desktop-plasma/patches/kde-frameworks/kio:6/0001-TrashSizeCache-Use-correct-iterator-flags.patch
new file mode 100644
index 0000000..a24e1c0
--- /dev/null
+++ b/desktop-plasma/patches/kde-frameworks/kio:6/0001-TrashSizeCache-Use-correct-iterator-flags.patch
@@ -0,0 +1,29 @@
+From 241eb504801bc4ee12555fa2c8737b409383ba5c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Wolfgang=20M=C3=BCller?= <wolf@oriole.systems>
+Date: Fri, 4 Oct 2024 16:27:40 +0200
+Subject: [PATCH] TrashSizeCache: Use correct flags for QDirIterator
+
+When calculating the size of the trash we walk through all files in the
+trash path using QDirIterator. In 0ab81b6ba (trashimpl: optimize
+TrashSizeCache::calculateSize, 2023-09-05) its invocation was changed to
+include the QDir::NoDotAndDotDot filter.
+---
+ src/kioworkers/trash/trashsizecache.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/kioworkers/trash/trashsizecache.cpp b/src/kioworkers/trash/trashsizecache.cpp
+index 81e71f4b9..e67618554 100644
+--- a/src/kioworkers/trash/trashsizecache.cpp
++++ b/src/kioworkers/trash/trashsizecache.cpp
+@@ -146,7 +146,7 @@ TrashSizeCache::SizeAndModTime TrashSizeCache::scanFilesInTrash(ScanFilesInTrash
+
+ // Iterate over the actual trashed files.
+ // Orphan items (no .fileinfo) still take space.
+- QDirIterator it(mTrashPath + QLatin1String("/files/"), QDir::NoDotAndDotDot);
++ QDirIterator it(mTrashPath + QLatin1String("/files/"), QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
+ qint64 sum = 0;
+ qint64 max_mtime = 0;
+ const auto checkMaxTime = [&max_mtime](const qint64 lastModTime) {
+--
+2.46.2
+