Bug 347311 - Search and Replace missing Search in Project option
Summary: Search and Replace missing Search in Project option
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: search (other bugs)
Version First Reported In: 5.0.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-06 13:43 UTC by mokush
Modified: 2019-08-24 20:21 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.54
Sentry Crash Report:


Attachments
Kate doesn't update Search In options after opening project file (458.51 KB, image/gif)
2018-11-29 09:10 UTC, mokush
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mokush 2015-05-06 13:43:34 UTC
After upgrading Kate 5.0.0 to the 15.04.0 Applications release from the Kubuntu Backports ppa for Kubuntu 15.04 (ppa:kubuntu-ppa/backports), the Search in: `Project` option is missing from the Search-In dropdown, in the Search and Replace tool view.

Before the upgrade, the option was available in the dropdown.

The option is missing regardless if a project is loaded automatically by Kate (from Git, etc.), or by manually opening a .kateproject file.

Here's a screenshot showing Kate with a project loaded, and the Search-In dropdown missing the previously-available `Project` option:

https://i.imgur.com/SgJqu6W.png



Reproducible: Always

Steps to Reproduce:
1. Open Kate
2. Enable the Projects plugin
3. Enable the Search and Replace plugin
4. Open a project in Kate (either by opening a .kateproject file or opening a file from a git/hg/svn repo, if the option is enabled in the Projects plugin settings).
5. Open the Search and Replace plugin tool view
6. Open the dropdown for the `Search in:` label on the right-side of the tool view

Actual Results:  
The only options available are `Folder` and `Open Files`.

Expected Results:  
There should be an extra option, called `Projects`.
Comment 1 Christoph Cullmann 2015-10-08 12:56:50 UTC
With 15.08 there should be a "Current Project" and "All Open Projects" Combo-Entry, if the project plugin is loaded. Works for me at least.
Comment 2 mokush 2017-11-20 10:04:05 UTC
With Kate 17.08.3 I'm still only seeing
- In Current Files
- in Open Files
- in Folder

as options in the Search and Replace pane dropdown on the right.
Comment 3 Kåre Särs 2017-11-20 11:29:08 UTC
Hmm.. that is strange because it works here...

Do you get any error messages on the console? 
And the project plugin has a project open?
Comment 4 mokush 2017-11-20 12:08:59 UTC
Found some extra symptoms.

If I open Kate from a terminal and *in a project folder*, the "Current Project" and "All Open Projects" options show up.

So this will work (even if no files are open):
cd ./project
kate

But this will not (with a project file open):
kate project/project.txt

Opening Kate from krunner, a shortcut or from Dolphin (by opening a file) will not show the projects-specific options.

No errors show up in the console.
Comment 5 Kåre Särs 2017-11-20 13:06:35 UTC
That is odd. It does work here on KDE Neon...
Comment 6 mokush 2018-11-29 09:10:57 UTC
Created attachment 116562 [details]
Kate doesn't update Search In options after opening project file

I'm still seeing the same issue with Kate `18.08.3`. This is a quick gif demo.

When starting Kate in a git folder, the Search and Replace panel shows the Search "In Current Project" and "In All Open Projects" options.

When starting Kate from outside the project/git folder (eg. from a taskbar shortcut), then opening a file from a git folder, the Search In options don't update, and don't show the "In Current Project" and "In All Open Projects" options.
Comment 7 Kåre Särs 2018-11-29 10:47:54 UTC
I don't know what to say :(

I tried the same thing with opening in a terminal, but I could not reproduce...
Comment 8 Kåre Särs 2018-12-02 14:17:06 UTC
I wonder if you have the project plugin instantiated before the search plugin?
Comment 9 Kåre Särs 2018-12-03 07:12:04 UTC
Git commit 53dd31b494bb4ade0e588cd4c3403a1fca42ff58 by Kåre Särs, on behalf of loh tar.
Committed on 03/12/2018 at 07:10.
Pushed by sars into branch 'master'.

SearchView: Fix missing signal/slot connection to project plugin

Summary:
...to notice project change after session switch

Without this patch was the project offer in the m_ui.searchPlaceCombo
after a session switch gone

Reviewers: #kate, sars

Reviewed By: #kate, sars

Subscribers: sars, kwrite-devel, #kate

Tags: #kate

Differential Revision: https://phabricator.kde.org/D17296

M  +9    -10   addons/search/plugin_search.cpp

https://commits.kde.org/kate/53dd31b494bb4ade0e588cd4c3403a1fca42ff58
Comment 10 mokush 2019-03-26 09:06:40 UTC
Seeing the same issue with version `18.12.3`. 

If opening Kate directly then opening a project file, the project options are missing from Search and Replace. Same happens when opening the file from Dolphin.

If opening Kate in a terminal *from the project directory* the options show up.
eg.
`cd project/; kate projectfile.txt` - will work
`kate project/projectfile.txt` - will not work
Comment 11 Lothar 2019-03-27 04:58:30 UTC
hm, can't find the related patch there
https://cgit.kde.org/kate.git/log/?h=Applications/18.12
it's only in master.
Comment 12 Christoph Cullmann 2019-08-24 20:21:16 UTC
For me that works in master, yes.
And it should work in 19.x