regolith-linux/ilia

File search: multiple entries from the same path

Closed this issue · 5 comments

pjz commented

I accidentally ended up with multiple copies of ~/.local/share/applications in my $XDG_DATA_DIRS, and every application in that dir showed up multiple times.

Expected: each application shows up only once no matter how many times its path is listed under XDG_DATA_DIRS.

The logic that reads the directories is on the critical path to load the window. I'm reluctant to add additional steps to fixup invalid input (in this case duplicate entries in the env variable) at the cost of slower start time.

pjz commented

I'm not sure it's invalid so much as redundant.

Shouldn't be too slow to put all the entries into a HashSet and return that instead of the array; load_apps() just iterates over it anyway.

Note that the 'commands' pane has the same issue with duplicate paths in $PATH.

True enough, it is redundant. In any case, a different issue has happily resulted in a fix for this as well. In a subsequent release we'll be sourcing the paths from dconf (view/modify w gsettings) rather than environment variable. This gives you the chance to setup ilia's paths however you like. Related commit: f9eacc0

pjz commented

is there something that keeps the same thing from happening with $PATH?

(sorry for the delay) Um, yes I believe if PATH has redundant elements then ilia will display them.