Bug 439403

Summary: Folder specific configuration show multiple home directory rules that cannot be deleted
Product: [Frameworks and Libraries] frameworks-baloo Reporter: Massimiliano L <m.lincetto>
Component: generalAssignee: baloo-bugs-null
Status: RESOLVED DUPLICATE    
Severity: normal CC: groot, nate, plasma-bugs, tagwerk19
Priority: NOR    
Version: 5.83.0   
Target Milestone: ---   
Platform: Netrunner   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=429910
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Massimiliano L 2021-07-02 12:31:44 UTC
SUMMARY
I realised some folders and files were not indexed.

Checking the "File Search" configuration module I notice that there are two identical entries for the same '/home/username' directory, one set to "indexed" and one set to "not indexed".

The two rules cannot be deleted as the corresponding button is greyed out.

Resetting to default creates a third entry for the home directory that cannot be deleted as well. So now I have three entries for the home directory.

STEPS TO REPRODUCE
I am not sure, since it is impossible to go back to the default.

OBSERVED RESULT
Multiple rules for the home directory are created and cannot be deleted.

EXPECTED RESULT
Only one entry for the same directory should exist (to avoid redundant contradictory rules).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 34
(available in About System)
KDE Plasma Version: 5.22.2
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
Comment 1 groot 2021-07-03 12:02:54 UTC
Please take a look at `~/.config/baloofilerc` (the configuration file for baloo). I can't reproduce this, but that's possibly because I can't get two entries for the home directory to begin with.

There are two interesting lines in that file:

```
exclude folders[$e]=$HOME/kde/
folders[$e]=$HOME/,/mnt/lc/
```

(look for the line starting with "exclude folders" and the line starting with "folders"; the text above is **my** configuration). I'm curious if your home-directory is listed twice, or is listed ander different paths to the same directory.
Comment 2 Massimiliano L 2021-07-05 07:47:13 UTC
(In reply to groot from comment #1)
> Please take a look at `~/.config/baloofilerc` (the configuration file for
> baloo). I can't reproduce this, but that's possibly because I can't get two
> entries for the home directory to begin with.
> 
> There are two interesting lines in that file:
> 
> ```
> exclude folders[$e]=$HOME/kde/
> folders[$e]=$HOME/,/mnt/lc/
> ```
> 
> (look for the line starting with "exclude folders" and the line starting
> with "folders"; the text above is **my** configuration). I'm curious if your
> home-directory is listed twice, or is listed ander different paths to the
> same directory.

Thanks for the assistance!

At this right moment, I have three immutable rules for the home directory, two set to "indexed" and one set to "non indexed". Plus I have two rules for $HOME/Music and $HOME/Pictures

In my config file:
> dbVersion=2
> exclude filters= [... bunch of extensions]
> exclude filters version=8
> exclude folders[$d]

If I change the third entry for $HOME to "Indexed", the line in my config file changes and becomes:
> exclude filters version=8
> exclude folders[$d]
> folders[$e]=$HOME/,$HOME/,$HOME/,$HOME/Music/,$HOME/Pictures/

So some rules that before were implicit become explicit. If I change the first entry for $HOME to "Not indexed", the duplicate entries disappear and I get in my config file:

> exclude filters version=8
> exclude folders[$d]
> folders[$e]=$HOME/

Now I reset everything to the defaults again, and I get back the three entries for $HOME + $HOME/Pictures and $HOME/Music. The lines in the config file becomes:

> exclude filters version=8
> exclude folders[$e]=$HOME

So it seems something is wrong with the default "template". Would you know where that is coded so I may check if something is wrong with my installation?
Comment 3 Bug Janitor Service 2021-07-20 04:33:34 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Nate Graham 2021-08-04 18:48:39 UTC
Oh jeez.
Comment 5 Nate Graham 2021-08-09 21:21:31 UTC
Massimiliano, feel free to take a look at the code in https://invent.kde.org/frameworks/baloo/-/tree/master/src
Comment 6 tagwerk19 2021-08-10 08:13:07 UTC
Also "self-reproducing, irremovable items", Bug 429910

Fedora also has its own ideas; it decides it wants to index Documents, Music, Pictures and Videos.

You might not see that initially in System Settings > Search but somehow it is tattooed into the system 8-/

I've "ended up with":
     ...
    exclude folders[$e]=$HOME/
    folders[$e]=$HOME/Documents/,$HOME/Music/,$HOME/Pictures/,$HOME/Videos/
     ...

That _seems_ stable for me.
Comment 7 Massimiliano L 2021-12-28 09:26:29 UTC
I tried to grep the source code to find the origin of these presets, but I was not successful. My current skills are insufficient to troubleshoot this more in depth.

Ultimately I think this is a duplicate of Bug 429910 (the discussion there has been a bit untidy but it is clear the underlying issue is the same or tightly related). I am tentatively closing this report.

*** This bug has been marked as a duplicate of bug 429910 ***