Bug 417762

Summary: Setting exclude folders under HOME do not work
Product: [Applications] systemsettings Reporter: Christoph Vogtländer <kde>
Component: kcm_balooAssignee: baloo-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: plasma-bugs
Priority: NOR    
Version: 5.18.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Christoph Vogtländer 2020-02-17 01:04:02 UTC
SUMMARY
Setting exclude folders does not work because "$HOME" already contains a trailing slash, resulting in double slashes. Files in excluded folders will be indexed.

STEPS TO REPRODUCE
1. add a folder to exclude list via systemsettings, e.g. "tmp"

OBSERVED RESULT
Entry in baloofilerc "exclude folders[$e]=$HOME/tmp/" is created. "balooctl config show excludeFolders" will show that this is evaluated to

/home/user//tmp/

(note the double "/" after HOME)
This is because "$HOME" already contains a trailing slash

Baloo will index files in ~/tmp

Manually changing the option in baloofilerc to "exclude folders[$e]=${HOME}tmp/" works as expected.


EXPECTED RESULT
Baloo should not index files in ~/tmp, the entry should be 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.18.0
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Comment 1 Stefan Brüns 2020-03-24 20:39:51 UTC
Git commit 7498b41a1979b084d05b99a51d3561eeef68e974 by Stefan Brüns.
Committed on 24/03/2020 at 20:39.
Pushed by bruns into branch 'master'.

[Baloo KCM] Complete overhaul of the include/exclude folder list

Summary:
The current "Excluded folders" list in the KCM is quite awkward:

1. It tries to mimic baloos automatic exclusion of external drives,
   but fails doing so and adds almost any external drive even when not
   mounted below an indexable path.

2. Deleting an autogenerated entry actually **adds** it to the included
   folder list, and then hides it.

3. There is no way to show the included folder list, or add any entries
   to it.

Remove the custom "excluded mounts" heuristic from the KCM and retrieve
the additional (not explicitly configured) excluded ones from baloo.

Replace the "excluded list" with a common list for included and excluded
folders, and flag its state. This also makes it easy to add additional
properties later.

Create a new UI delegate for each config list item, allowing to enable
and disable indexing for each entry. Make the "delete" actually always
delete a config entry, and make the control inline. Move the "Add" button
to the *right* bottom of the list (in accordance with UI guidelines) and
add some text to it.

Depends on D28024

Solves the following parts of T9879:
[x] Allow adding of includeFolders in the KCM
[x] Correctly show excludeFolders below explicit (non-$HOME) includeFolders in KCM
Related: bug 417763, bug 417170, bug 366521

Reviewers: #baloo, #vdg, ngraham, mart

Reviewed By: #baloo, #vdg, ngraham

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28025

M  +119  -113  kcms/baloo/filteredfoldermodel.cpp
M  +18   -12   kcms/baloo/filteredfoldermodel.h
M  +76   -19   kcms/baloo/package/contents/ui/main.qml

https://commits.kde.org/plasma-desktop/7498b41a1979b084d05b99a51d3561eeef68e974