Bug 489581 - Search & Replace silently fails on non-existent folders
Summary: Search & Replace silently fails on non-existent folders
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: search (show other bugs)
Version: 24.05.1
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-02 03:58 UTC by Andrew M
Modified: 2025-02-03 09:52 UTC (History)
1 user (show)

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 Andrew M 2024-07-02 03:58:34 UTC
SUMMARY
Running a find in files search fails silent when using a non-existent folder.

STEPS TO REPRODUCE
1. Open the Search & Replace plug-in's tab (Ctrl+Shift+F)
2. Set the search scope to "In Folder"
3. Set Folder to "/doesntexist/"
4. Search for "foo"

OBSERVED RESULT
Search shows an empty result pane immediately.

EXPECTED RESULT
Some kind of error about the folder not existing.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.9.7-arch1-1
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Comment 1 Christoph Cullmann 2024-07-05 18:20:40 UTC
void FolderFilesList::checkNextItem(DirectoryWithResults &handleOnFolder) const
{
    /**
     * IMPORTANT: this member function is called by MULTIPLE THREADS
     * => it is const, it shall only modify handleOnFolder
     */

    if (m_cancelSearch) {
        return;
    }

    QDir currentDir(handleOnFolder.directory);
    if (!currentDir.isReadable()) {
        // qDebug() << currentDir.absolutePath() << "Not readable";
        return;
    }

atm we just skip that, perhaps we should add some kind of dummy entry for such cases to the results
Comment 2 Bug Janitor Service 2025-02-01 19:18:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1710
Comment 3 Christoph Cullmann 2025-02-03 09:52:43 UTC
Git commit 00f512e62184039cec5e2b75dc0ac7ccb2fa0003 by Christoph Cullmann.
Committed on 03/02/2025 at 09:24.
Pushed by cullmann into branch 'master'.

abort search with error if the base dir is not there

M  +14   -0    addons/search/SearchPlugin.cpp

https://invent.kde.org/utilities/kate/-/commit/00f512e62184039cec5e2b75dc0ac7ccb2fa0003