From 7c92bb9645e10ab15291d581648c04697cf9e280 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Sun, 6 Oct 2024 15:56:59 +0200 Subject: 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 --- ...TrashSizeCache-Use-correct-iterator-flags.patch | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 desktop-plasma/patches/kde-frameworks/kio:6/0001-TrashSizeCache-Use-correct-iterator-flags.patch (limited to 'desktop-plasma') 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?= +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 + -- cgit v1.2.3-2-gb3c3