Sophie

Sophie

distrib > Mageia > 8 > armv7hl > media > core-release-src > by-pkgid > a01e0d8f365a06fd71468b0f6d964555 > files > 4

baloo-5.76.0-2.mga8.src.rpm

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