summaryrefslogtreecommitdiff
path: root/kde-frameworks/baloo/files/baloo-5.77.0-strip-trailing-slash.patch
blob: ab9c7639799f2511f21e232864c90f87d35427e7 (plain)
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
From 9b61371fdefbd538938f20cdc87eed03d170fa5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sat, 12 Dec 2020 19:01:45 +0100
Subject: [PATCH] [BasicIndexingJob] Strip trailing slash from folders

If BasicIndexingJob is called with a path with a trailing slash, the
search for the last slash (separating name from parent path) goes wrong.

This was wrong already earlier, but with commit 47ebc15844f6b8a8
("[Document] Add parent document ID and populate it") this caused
document and parent id to be the same.

CCBUG: 430273
---
 src/file/basicindexingjob.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/file/basicindexingjob.cpp b/src/file/basicindexingjob.cpp
index e00c6a2b..c0f18ddd 100644
--- a/src/file/basicindexingjob.cpp
+++ b/src/file/basicindexingjob.cpp
@@ -23,6 +23,9 @@ BasicIndexingJob::BasicIndexingJob(const QString& filePath, const QString& mimet
     , m_mimetype(mimetype)
     , m_indexingLevel(level)
 {
+    if (m_filePath.endsWith(QChar('/'))) {
+	m_filePath.chop(1);
+    }
 }
 
 namespace {
-- 
GitLab