Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: oBFusCATed on February 16, 2010, 10:12:42 pm

Title: ThreadSearch - sort in the list control
Post by: oBFusCATed on February 16, 2010, 10:12:42 pm
Hello,

I have a little feature request for this great plugin:
Sort the list control, when the user clicks on the header (the 'buttons' for Directory, File, Line, Text).
Is that possible? I've read part of the source and I think it will require knowledge of the internals.
Can someone do it or give me some hint how to do it efficiently?
Title: Re: ThreadSearch - sort in the list control
Post by: MortenMacFly on February 17, 2010, 06:42:14 am
Can someone do it or give me some hint how to do it efficiently?
Have a look at e.g. the symbols tables plugin where the entries are sortable. Basically you'll need to provide (fast!) search sort methods. Doing it the same way for ThreadSearch shouldn't be a problem.
Title: Re: ThreadSearch - sort in the list control
Post by: oBFusCATed on February 17, 2010, 08:10:26 am
I've looked at the TODO plugin, but the thing is that in the ThreadSearch, there is no user data in the items, so I need to introduce one.

p.s. how do one test changes in a contrib plugin?
Title: Re: ThreadSearch - sort in the list control
Post by: MortenMacFly on February 17, 2010, 09:22:49 am
I've looked at the TODO plugin, but the thing is that in the ThreadSearch, there is no user data in the items, so I need to introduce one.
True.

p.s. how do one test changes in a contrib plugin?
Not sure what you mean... provide a patch and... erm... test?!
Title: Re: ThreadSearch - sort in the list control
Post by: oBFusCATed on February 17, 2010, 12:24:22 pm
True.
Any suggestions how to do it best?

Not sure what you mean... provide a patch and... erm... test?!
To test C::B one needs to open the project file and hit run.
What do I need to do to test changes in a contrib plugin?
I must open the Contrib-unix.workspace, choose the plugin I want to modify and hit run?
Title: Re: ThreadSearch - sort in the list control
Post by: MortenMacFly on February 17, 2010, 01:28:44 pm
Any suggestions how to do it best?
Look at te symbol tables plugin. this is done quite efficient.

What do I need to do to test changes in a contrib plugin?
I've made myself a new workspace which is basically C::B project + contrib workspace. Then you can just run the C::B project which will also run the contrib plugin.
Title: Re: ThreadSearch - sort in the list control
Post by: Jenna on February 17, 2010, 10:32:38 pm
Any suggestions how to do it best?
Look at te symbol tables plugin. this is done quite efficient.

What do I need to do to test changes in a contrib plugin?
I've made myself a new workspace which is basically C::B project + contrib workspace. Then you can just run the C::B project which will also run the contrib plugin.

If the host program and the projects execution working directory are setup correctly, this will also work without opening the C::B project.
But in fact some of the projetcs have to be fixed, to work directly and with the debugger.

I will check the projects and do the fixes for linux and windows the next days.
Title: Re: ThreadSearch - sort in the list control
Post by: oBFusCATed on February 18, 2010, 12:30:55 am
Jens: Does debugging wxSmith work for you?

For me it doesn't - cb r6112 debugger branch amd64
Code
LD_LIBRARY_PATH=.:/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/devel:/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/base/tinyxml:/usr/lib64:/usr/lib64:
Command-line: /usr/bin/gdb -nx -fullname  -quiet -args ./codeblocks
Working dir : /home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/plugins/contrib/wxSmith/
warning: Can not parse XML syscalls information; XML support was disabled at compile time.
./codeblocks: There is no such file or directory.

If it does work, might be a problem that I have introduced in the branch.
Title: Re: ThreadSearch - sort in the list control
Post by: Jenna on February 18, 2010, 10:47:07 am
Jens: Does debugging wxSmith work for you?

For me it doesn't - cb r6112 debugger branch amd64
Code
LD_LIBRARY_PATH=.:/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/devel:/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/base/tinyxml:/usr/lib64:/usr/lib64:
Command-line: /usr/bin/gdb -nx -fullname  -quiet -args ./codeblocks
Working dir : /home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/plugins/contrib/wxSmith/
warning: Can not parse XML syscalls information; XML support was disabled at compile time.
./codeblocks: There is no such file or directory.

If it does work, might be a problem that I have introduced in the branch.

Not out of the box.

If you change the execution working dir (in projects properties) to "." and the host-application in "Project -> Set program's arguments" for "wxSmith" to "../../../devel/codeblocks" (on linux), it should work with debugger and if you start with the run-button.
Title: Re: ThreadSearch - sort in the list control
Post by: oBFusCATed on March 07, 2010, 01:46:57 pm
I've submitted the patch for this feature: 002944

Comments are welcome :)
Title: Re: ThreadSearch - sort in the list control
Post by: Jenna on March 07, 2010, 04:54:17 pm
I've submitted the patch for this feature: 002944

Comments are welcome :)
I assigned it to me and will look into it (most likely no commen ts before next weekend, because I'm without internet from monday to friday).
Title: Re: ThreadSearch - sort in the list control
Post by: dje on March 07, 2010, 11:36:10 pm
Hello!

I didn't try the patch but I have one question...

It is possible to keep the results of successive searches in the log window (tree or list ctrl).
In my opinion, the patch should sort the results by search not mixing several different searches results.

Is it the case?

Dje
Title: Re: ThreadSearch - sort in the list control
Post by: oBFusCATed on March 08, 2010, 09:10:02 am
How can I keep the results from the previous search? There is an option?

The patch probably sorts both searches as one...
Title: Re: ThreadSearch - sort in the list control
Post by: ollydbg on March 08, 2010, 09:40:28 am
It is possible to keep the results of successive searches in the log window (tree or list ctrl).
A good feature request.
I would like to have this feature in the thread search plugin too. :D
Title: Re: ThreadSearch - sort in the list control
Post by: oBFusCATed on March 08, 2010, 09:55:27 am
Olly: I think he means this feature is present :)
Title: Re: ThreadSearch - sort in the list control
Post by: dje on March 08, 2010, 10:16:09 am
Yes, there is a check box "Delete previous results at search begin" in the options panel.
If false, log results are kept.

Dje
Title: Re: ThreadSearch - sort in the list control
Post by: ollydbg on March 08, 2010, 10:38:28 am
Thanks dje and obf.
I am sorry for the noise.
Yes, there is a check box "Delete previous results at search begin" in the options panel.
If false, log results are kept.

Dje
Title: Re: ThreadSearch - sort in the list control
Post by: oBFusCATed on April 03, 2010, 03:43:38 am
I've updated the patch, now it should work if the checkbox "Delete previous results at search begin" is unchecked and there are multiple searches.
Title: Re: ThreadSearch - sort in the list control
Post by: Jenna on April 10, 2010, 12:55:29 pm
I've updated the patch, now it should work if the checkbox "Delete previous results at search begin" is unchecked and there are multiple searches.

Looks good so far (works as expected, at least on linux, no test on windows yet, but this will follow).

I did not look into the (changed) source-code, but I think the patch will be accepted (after the release).

Please remind me, if I should forget it (I am quite busy at the moment).