[indexcleaner] Avoid removing included folders below excluded ones
This fixes a regression introduced with commit e58804bf9eb8
("React to config updates inside indexer").
The recursion should stop when it reaches an explicitly included folder,
thus pass shouldDelete also into the iteration for excluded folders.
The current unconditional removal causes recurrent indexing of included
subtrees on each login.
Do a depth first walk, and after returning check if there are any
children left. Only delete the folder if it is empty. Otherwise, the
directory tree structure has dangling subtrees.
configure an includeFolder below an excludeFolder
start balooctl monitor
files below the includeFolder should not be needed to be reindexed
Reviewed By: Baloo, ngraham
Differential Revision: https://phabricator.kde.org/D20299