Bug 474461 - Search in files in folder: support ~ (tilde)
Summary: Search in files in folder: support ~ (tilde)
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: search (show other bugs)
Version: 23.08.0
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-12 20:10 UTC by Grósz Dániel
Modified: 2024-11-17 08:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grósz Dániel 2023-09-12 20:10:01 UTC
SUMMARY
In the Search plugin in In Folder mode, the Folder field should support ~ and ~username to specify the current or another user's home directory.

It's especially confusing that it's currently unsupported because text completion in the field does show subdirectories of directories specified with ~ or ~username.

It would also be a good idea to show an error (e.g. make the field red) if the starting path doesn't exist or is invalid.

STEPS TO REPRODUCE
1. Open the Search sidebar.
2. Set the mode to In Folder.
3. Specify ~, or a path starting with ~.
4. Click Search.

OBSERVED RESULT
The search result will be empty.

EXPECTED RESULT
Search in the path specified inside the home directory.

Alternatively, don't have completion complete paths as if ~ is interpreted as the home directory, and show an error if the search path doesn't exist.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20230910
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
Kernel Version: 6.4.11-1-default (64-bit)
Graphics Platform: X11
Comment 1 Christoph Cullmann 2024-11-02 19:59:33 UTC
Git commit 57eafc84a711b9c0011aca1089c79fced63d2c57 by Christoph Cullmann.
Committed on 02/11/2024 at 19:59.
Pushed by cullmann into branch 'master'.

use ->url() and not ->text() to resolve ~ and Co.

only allow existing dirs, only that works

M  +2    -2    addons/search/SearchPlugin.cpp

https://invent.kde.org/utilities/kate/-/commit/57eafc84a711b9c0011aca1089c79fced63d2c57
Comment 2 Christoph Cullmann 2024-11-16 15:31:24 UTC
Git commit c1e55817d61ac2dface562ad5e503b5f6c5a5006 by Christoph Cullmann.
Committed on 16/11/2024 at 15:31.
Pushed by cullmann into branch 'master'.

try to properly use toLocalFile for local files
Related: bug 496293

M  +1    -11   addons/search/MatchModel.cpp
M  +1    -1    addons/search/SearchPlugin.cpp

https://invent.kde.org/utilities/kate/-/commit/c1e55817d61ac2dface562ad5e503b5f6c5a5006
Comment 3 Waqar Ahmed 2024-11-17 08:13:41 UTC
Git commit 243168b47089a824b42d94d20284992e405bf2ff by Waqar Ahmed, on behalf of Christoph Cullmann.
Committed on 17/11/2024 at 08:06.
Pushed by waqar into branch 'release/24.12'.

try to properly use toLocalFile for local files
Related: bug 496293
(cherry picked from commit c1e55817d61ac2dface562ad5e503b5f6c5a5006)

M  +1    -11   addons/search/MatchModel.cpp
M  +1    -1    addons/search/SearchPlugin.cpp

https://invent.kde.org/utilities/kate/-/commit/243168b47089a824b42d94d20284992e405bf2ff