Code::Blocks

User forums => Using Code::Blocks => Topic started by: BlueHazzard on February 06, 2019, 12:47:20 am

Title: {thread search] File mask not saved
Post by: BlueHazzard on February 06, 2019, 12:47:20 am
Hi,
does also someone else experience that the file mask of the thread search plugin is not saved on pressing ok in the options dialog?
OS: windows 7, wx31 latest trunk...
Steps to reproduce:
1) Start codeblocks
2) Enable thread search panel
3) hit the options button.
4) Set the file mask to something like *.cpp;*.h
5) Hit ok
6) Make search. --> The mask is ignored
7) Hit the options button again
8) The mask is reseted back to *.*
Title: Re: {thread search] File mask not saved
Post by: BlueHazzard on February 06, 2019, 01:34:41 am
it seems that the file mask is ignored for project files?
So, either we disable the control on selecting workspace/project or we implement the mask on this, or am i missing something?
Title: Re: {thread search] File mask not saved
Post by: Quiss on February 06, 2019, 06:55:45 am
Yes, it is ignored; it doesn't matter if you search in open files or project files. Also the mask is reset even if you don't make search; after step5, click options button again and you see it's resetted.

11455, wx311, windows10-64
Title: Re: {thread search] File mask not saved
Post by: Miguel Gimenez on February 06, 2019, 11:56:23 am
The mask is saved in default.conf and loaded OK, but the loaded value is lost (either overwritten or ignored) and *.* is used instead. In addition to this the search masks ("*.*" and "*.cpp;*.c;*.h") should appear when opening the combobox but they are also lost.
Title: Re: {thread search] File mask not saved
Post by: BlueHazzard on February 06, 2019, 12:54:55 pm
I know that this worked in the past... A quick search in the svn log did not revealed some changes that mattered... Probably something with wx30 again...
Title: Re: {thread search] File mask not saved
Post by: Miguel Gimenez on February 06, 2019, 02:53:06 pm
This patch solves the *.* issue (don't know if filtering works). The combobox constructor fired a TEXT event who overwrote the searchmask value in finddata.

The empty combobox must be fixed also.
Title: Re: {thread search] File mask not saved
Post by: BlueHazzard on February 06, 2019, 05:04:27 pm
There is no data in the drop down boxes because the panel gets destroyed every time the dialog closes and the items are added only at the beginning once, as far as i can tell..
Title: Re: {thread search] File mask not saved
Post by: BlueHazzard on February 07, 2019, 02:39:29 am
Ok, i come to the conclusion, that in the option dialog it was never implemented to have a populated drop down list.
The drop down list is only implemented in the panel in the "log&others" panel and there it works...
In the settings dialog it seems to never have worked (i remember other, but i may be wrong...)
Title: Re: {thread search] File mask not saved
Post by: BlueHazzard on February 07, 2019, 03:29:33 am
Here is a patch that fixes this. But it introduces some strange UI behavior for resizing the options panel...
I probably will need some help for this...

In a scond patch i will try to add the file mask for project/workspace files...
Title: Re: {thread search] File mask not saved
Post by: ollydbg on February 07, 2019, 07:59:29 am
http://forums.codeblocks.org/index.php/topic,22198.msg151287.html#msg151287

I think I have this issue reported, see the above link and discussion. I found the post by Google.
Title: Re: [thread search] File mask not saved
Post by: BlueHazzard on February 07, 2019, 08:05:59 pm
So there are 3(4) bugs in this plugin?
1) The crash that is original reported in your thread (fixed by updating compiler/wx version? )
2) The value in the mask text control field gets overwritten by "*.*". This happens only on windows with wx>3.0 (or at least not in wx2.8). This is fixed with the patch provided by Miguel Gimenez
3) The drop down boxes in the options dialog (called from the toolbar or from settings->environment->thread search) do not get populated. This should not work on any operating system because it is not implemented as far as i can see. This should be fixed with my patch
(4) The mask is not applied on project and workspace files. I think this is a bug and i will fix this too...

Am i here correct, or do i miss something here?
Title: Re: [thread search] File mask not saved
Post by: ollydbg on February 08, 2019, 02:49:07 am
So there are 3(4) bugs in this plugin?
1) The crash that is original reported in your thread (fixed by updating compiler/wx version? )
Yes, newer GCC version such as GCC 7.2 don't show this crash.
Quote
2) The value in the mask text control field gets overwritten by "*.*". This happens only on windows with wx>3.0 (or at least not in wx2.8). This is fixed with the patch provided by Miguel Gimenez
I will try to apply this patch and see whether it fixed the issue. Thanks.

I don't know the (3) and (4) issue currently. :)
Title: Re: {thread search] File mask not saved
Post by: Miguel Gimenez on February 08, 2019, 09:12:36 am
Quote
So there are 3(4) bugs in this plugin?

There is at least one more bug, a crash when disabling the plugin due to an use-after-free issue. This is described in ticket 777, and I posted there a possible patch.

https://sourceforge.net/p/codeblocks/tickets/777/ (https://sourceforge.net/p/codeblocks/tickets/777/)
Title: Re: {thread search] File mask not saved
Post by: BlueHazzard on February 13, 2019, 09:01:10 pm
Any feedback on this?

If no one is against them i will commit them one by one in the next days (beside the 777, there still seems to be some discussion)
Title: Re: {thread search] File mask not saved
Post by: BlueHazzard on February 13, 2019, 09:45:59 pm
Here is the patch for point 4: apply mask on every search request (files, workspace, project and target)
Title: Re: {thread search] File mask not saved
Post by: BlueHazzard on February 17, 2019, 04:37:49 pm
Ok, i applied the patches about the file masks: points 2 and 4
There is still point 3, where i still have to figure out how the sizer have to be set and the crash reported in ticket 777