Author Topic: {thread search] File mask not saved  (Read 1253 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
{thread search] File mask not saved
« 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 *.*

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
Re: {thread search] File mask not saved
« Reply #1 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?

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 74
Re: {thread search] File mask not saved
« Reply #2 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

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 320
Re: {thread search] File mask not saved
« Reply #3 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.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
Re: {thread search] File mask not saved
« Reply #4 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...

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 320
Re: {thread search] File mask not saved
« Reply #5 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.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
Re: {thread search] File mask not saved
« Reply #6 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..

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
Re: {thread search] File mask not saved
« Reply #7 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...)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
Re: {thread search] File mask not saved
« Reply #8 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...
« Last Edit: February 07, 2019, 03:31:18 am by BlueHazzard »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5223
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: {thread search] File mask not saved
« Reply #9 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.
« Last Edit: February 07, 2019, 08:02:39 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
Re: [thread search] File mask not saved
« Reply #10 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?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5223
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [thread search] File mask not saved
« Reply #11 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. :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 320
Re: {thread search] File mask not saved
« Reply #12 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/

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
Re: {thread search] File mask not saved
« Reply #13 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)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2417
Re: {thread search] File mask not saved
« Reply #14 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)