Summary: | Summary: Dolphin/Baloo search with symlinks | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | tagwerk19 |
Component: | search | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | REPORTED --- | ||
Severity: | normal | CC: | bugseforuns, colinetnathan98, cousinmarc, dagobertram, dschridde+kde, info, jan.rathmann, katyaberezyaka, kde-bugs, kfm-devel, Landgraf132, metalbrick, nightmarex1337, r.oosterhoff, rapiteanu.catalin, sadiyumusak, sonichedgehog_hyperblast00, stefan.bruens, stein.peter |
Priority: | HI | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
See Also: |
https://bugs.kde.org/show_bug.cgi?id=333678 https://bugs.kde.org/show_bug.cgi?id=424871 https://bugs.kde.org/show_bug.cgi?id=434610 https://bugs.kde.org/show_bug.cgi?id=435383 https://bugs.kde.org/show_bug.cgi?id=436737 https://bugs.kde.org/show_bug.cgi?id=439438 https://bugs.kde.org/show_bug.cgi?id=442786 https://bugs.kde.org/show_bug.cgi?id=446715 https://bugs.kde.org/show_bug.cgi?id=459572 |
||
Latest Commit: | Version Fixed In: |
Description
tagwerk19
2021-12-17 10:37:23 UTC
*** Bug 435383 has been marked as a duplicate of this bug. *** *** Bug 439438 has been marked as a duplicate of this bug. *** *** Bug 442786 has been marked as a duplicate of this bug. *** *** Bug 446715 has been marked as a duplicate of this bug. *** *** Bug 424871 has been marked as a duplicate of this bug. *** *** Bug 333678 has been marked as a duplicate of this bug. *** *** Bug 447896 has been marked as a duplicate of this bug. *** https://old.reddit.com/r/kde/comments/slfacb/search_result_bug_using_a_shortcut_will_mess_with/ > Lets say I have a folder located in my pictures. And I have an shortcut to that > folder in my documents. So when I click the short cut, the directory is > "documents/custom-shortcut-link/" instead of "pictures/custom-folder-in-pictures" > > The work around for this at least is when you create a shortcut, is right click > an open space in dolphin. Create new -> Link to Location (url) instead of > Create new -> Link to File or Directory. This will still get you to your > location, but instead it puts you in "pictures/custom-folder-in-pictures" Nice! This helps where baloo has indexed the folders, you follow a symlink on the desktop and don't get any results when you search. "Case 1a" in the summary.... The "Link to Location (URL)" works like a change directory and not a symbolic link. Baloo will not automatically index anything pointed to using "Link to Location", you would need to make sure the destination folder was included in Baloo's "included folders" list (as per Case 2a...) In the case where Baloo has not indexed the folders, Dolphin does its own "there and then" recursive search and doesn't follow the "Link to Location" references (whereas it does follow symlinks, described in Case 3). There's a difference in behaviour here... See also: The trouble with symbolic links https://lwn.net/Articles/899543/ *** Bug 459572 has been marked as a duplicate of this bug. *** This is mostly a bug in dolphin, it should pass the canonical path to baloo. When you use `baloosearch -d ...`, it will return results even when the specified directory path contains symlinks, as it resolves the specified directory to its canonical path. In case you wonder why canonicalization is the callers (in this case dolphin) responsibility: Canonicalization is a potentially blocking file system operation. Dolphin can use KIO to resolve the path without blocking the UI, it may even already have the canonical path at hand. > ls -l . ; readlink -f /home/stefan/Sources/testdata/symlink_parent/testdata/symlink ; \
> baloosearch -v ; baloosearch -i -d /home/stefan/Sources/testdata/symlink_parent/testdata/symlink foo
> insgesamt 3960
> -rw-r--r-- 1 stefan users 6 18. Mär 15:44 foo2.txt
> -rw-r--r-- 1 stefan users 6 18. Mär 15:44 foo.txt
> -rw-r--r-- 1 stefan users 6 18. Mär 15:08 hello.txt
> drwxr-xr-x 1 stefan users 36 5. Apr 12:18 Readonly
> lrwxrwxrwx 1 stefan users 1 24. Apr 20:32 symlink -> .
> lrwxrwxrwx 1 stefan users 2 24. Apr 20:36 symlink_parent -> ..
> -rw-r--r-- 1 stefan users 1340684 18. Mär 15:19 test2.wav
> -rw-r--r-- 1 stefan users 1340684 18. Mär 15:22 test3.wav
> -rw-r--r-- 1 stefan users 1340684 18. Mär 15:19 test.wav
> -rw-r--r-- 1 stefan users 12 18. Mär 15:08 world.txt
> /home/stefan/Sources/testdata
> Baloo 5.105.0
> 12ccf1f0000002d /home/stefan/Sources/testdata/foo2.txt
> 12ccf010000002d /home/stefan/Sources/testdata/foo.txt
> Elapsed: 0,125005 msecs
Dolphin returns the correct result only when the path of the current directory is its canonical name.
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/baloo/-/merge_requests/126 Git commit c40c6b2594d9b383e11ead53cc56ceaf9d51f62c by Stefan Brüns. Committed on 24/04/2023 at 19:33. Pushed by bruns into branch 'master'. baloosearch: Inform the user when the specified dir is not canonical The path supplied for any queries must use the canonical form. baloosearch already uses the canonical form, but does so silently. Inform the user when the actual used path differs, to aid debugging. M +8 -1 src/tools/baloosearch/main.cpp https://invent.kde.org/frameworks/baloo/commit/c40c6b2594d9b383e11ead53cc56ceaf9d51f62c Git commit d313aa5d0b4122aee26a1a2f7dab6054d7eb5cd1 by Stefan Brüns. Committed on 24/04/2023 at 19:35. Pushed by bruns into branch 'kf5'. baloosearch: Inform the user when the specified dir is not canonical The path supplied for any queries must use the canonical form. baloosearch already uses the canonical form, but does so silently. Inform the user when the actual used path differs, to aid debugging. (cherry picked from commit c40c6b2594d9b383e11ead53cc56ceaf9d51f62c) M +8 -1 src/tools/baloosearch/main.cpp https://invent.kde.org/frameworks/baloo/commit/d313aa5d0b4122aee26a1a2f7dab6054d7eb5cd1 (In reply to Stefan Brüns from comment #12) > Dolphin returns the correct result only when the path of the current directory is its canonical name. Meaning that Dolphin should follow any symlinks before doing a search and (silently) query baloo with the canonical path? Although I'm not sure whether Dolphin should then show the results relative to the symlink or with the canonical path. It makes sense ... ... although it implies that the index *only* ever contains canonical paths. Would also need to be careful that baloosearch and filenamesearch do the same thing. Edge cases? $ balooshow -x path-including-symlink $ balooctl index path-including-symlink $ balooctl clear path-including-symlink and then evil baloofilerc includes such as folders[$e]=$HOME/Desktop/Documents where you've got a symlink on your Desktop to your Documents folder? I think the "balooctl index" (and "balooctl clear") does things properly but I suspect that the evil include does not... (In reply to tagwerk19 from comment #16) > (In reply to Stefan Brüns from comment #12) > > Dolphin returns the correct result only when the path of the current directory is its canonical name. > Meaning that Dolphin should follow any symlinks before doing a search and > (silently) query baloo with the canonical path? Although I'm not sure > whether Dolphin should then show the results relative to the symlink or with > the canonical path. The "Path" column should display the canonical path. After all, that's where the file is actually located. (And in case the symlink started on a different filesystem, also the place where the space is consumed). This is consistent with how directory sizes are calculated, symlinks are not followed, otherwise you may count files several times. > It makes sense ... > > ... although it implies that the index *only* ever contains canonical > paths. > > Would also need to be careful that baloosearch and filenamesearch do the > same thing. > > Edge cases? > > $ balooshow -x path-including-symlink balooshow already handles this correctly, the canonical path is shown in square brackets (if it differs from the specified path): > balooshow -x ~/Sources/testdata/symlink_parent/testdata/hello.txt > 12ccd4a0000002d 45 19713354 /home/stefan/Sources/testdata/symlink_parent/testdata/hello.txt [/home/stefan/Sources/testdata/hello.txt] > $ balooctl index path-including-symlink > $ balooctl clear path-including-symlink > > and then evil baloofilerc includes such as > > folders[$e]=$HOME/Desktop/Documents > > where you've got a symlink on your Desktop to your Documents folder? > > I think the "balooctl index" (and "balooctl clear") does things properly but > I suspect that the evil include does not... In case it is not, this should be trivial to fix. Also, if you break it, you may keep both parts. It would be really great if this could be fixed (especially case 1a) since baloo search feels broken if there are files you know of but nothing is displayed. Doing a "dolphin filenamesearch" as a fallback could be considered as well. Maybe anyone can increase the importance of this bug? (To me this looks like many bugs and having only one bug report could make tracking and prioritizing harder. But I appreciate having this overview.) (In reply to cybea from comment #18) > ... To me this looks like many bugs and having only one bug report could make > tracking and prioritizing harder. But I appreciate having this overview ... I can see that, what was happening though was we had been drowning under a wave of overlapping reports. If there's a new report, we have the choice of flagging it as a duplicate or leaving it and cross-referencing with a "see also". There is, I think, the possibility of creating a "tracking bug" that gets resolved when all the component issues are resolved. I've no experience of these and am not sure whether it would be appropriate here... |