Author Topic: ThreadSearch plugin 0.6 release  (Read 16758 times)

Offline dje

  • Lives here!
  • ****
  • Posts: 683
ThreadSearch plugin 0.6 release
« on: April 23, 2007, 09:24:29 pm »
Hi all !

I took time but I'm proud to release ThreadSearch plugin 0.6  :D
It runs finally both on Windows AND Linux (I can not test on other OSs but sources are available  :))
Stability is improved a lot.

The "ThreadSearch" plugin offers the following features:
  • multi-threaded "Search in files"
  • preview of the results (left single click on log window)
  • file open (left double click on log window)
  • check boxes instead of radio boxes to allow searches with both project and directories for example.
  • contextual menu "Find occurrences" to start a search in files with the word under cursor (can be activated or not)

Why ?
  • I am working on very big projects (700 Mo of cpp, h files) and text searches take up to 5 minutes. It is very frustrating being blocked because of the search. It is now possible to continue editing code during searches.
  • I do not like leaving the editor position to browse 'Search in files' resuts. There is now the 'Code preview' to do this with possibility to open the file at the right position.

I massively rewrote the code to solve major problems, ie application hanging on cancel, crash and GUI problems on Linux.
I rewrote my own search classes to avoid the use of GUI items in the worker thread and I use a shared queue in the main thread to cancel quickly a search.
@eranif thanks for your proposition, but I had already rewritten the code when you posted it
Hi dje!,

I recently developed a search thread that supports the following:
- match case
- match whole word
- regular expression
- file extensions
- events and easy interface with the main thread

Source code (5 sources + 1 sample):
http://www.eistware.com/st/SearchThread.zip

What's new:
  • Runs on Linux
  • GUI correction on Linux (preview window took more place than available in the notebook page)
  • Bug correction by Jamie : the file was not reloaded in the preview window when externally modified
  • No crash on very long search (form the root of wxWidgets for example)
  • Application does not hang any more on find Cancel
  • Added the possibility to hide/show columns header in list control to spare space
  • Added the possibility to draw lines to separate columns in list control
  • Minor bugs corrections

Limitations :
  • On Windows, I put the full path of the files in a small column because tooltips gives it. It does not work on Linux (no tooltip).
  • For sure, when user choose to hide list control column headers, colums cannot be resized.

Installation :
To build the plugin, extract the source code in src\plugins\contrib\ThreadSearch, open the CodeBlocks project and build it. The .cbplugin is generated in src\plugins\contrib\ThreadSearch and is ready for install.

Thanks to Pecan to inform me on wxListCtrl problems on Linux. Now my code runs on Linux (at least on Ubuntu  :))
Thanks to Jamie for code propositions/corrections.
Thanks to users for suggestions and congratulations. They are really appreciated !
I'll write a status concerning future evolutions.

Dje

« Last Edit: April 24, 2007, 08:28:39 pm by dje »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: ThreadSearch plugin 0.6 release
« Reply #1 on: April 24, 2007, 11:23:22 pm »
Just for the record: Where are the sources again? As usual the binary is not compatible with my version of C::B... :-( I guess I missed something...?!
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #2 on: April 25, 2007, 08:23:50 am »
Oups, I forgot the sources link  :oops:

It still GPLed !
ThreadSearch 0.6 sources

Quote
As usual the binary is not compatible with my version of C::B...
The same problem remains... Binary is provided for latest nightly but does not work with debugging environment.
I began working on it but it is not finished. A new target has appeared in the project for debug.
You have to link with the debug static lib instead of the dlls.

Sorry,

Dje
« Last Edit: April 25, 2007, 08:28:08 am by dje »

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #3 on: April 26, 2007, 01:48:47 pm »
Hi all !

Quote
News: Better no news than bad news   :wink:

No feedback... Does it mean that everything is OK both on Windows and Linux, that this plugin is not interesting or that the weather is too beautiful for developping ?

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: ThreadSearch plugin 0.6 release
« Reply #4 on: April 26, 2007, 02:06:26 pm »
No feedback... Does it mean that everything is OK [...]
Ooops - sorry, I missed that you had posted the sources... compiling now... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: ThreadSearch plugin 0.6 release
« Reply #5 on: April 26, 2007, 10:27:32 pm »
No feedback... Does it mean that everything is OK [...]
Ooops - sorry, I missed that you had posted the sources... compiling now... ;-)
Reporting back. After having used this plugin "the whole day" - at least for all searched I did - I have to say: Seems to work just fine! The only minor issue I had in the beginning was the following:
I had the ThreadSearch-tab open, but not active. Thus when I selected ThreadSearch from the menu it was hidden! If the tab is visible but *not* active (behind e.g. the build tab) then the menu should better just bring it to front instead of making it invisible. It's misleading otherwise.
Besides that thingy - no other bug to report... sorry! ;-)
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #6 on: April 26, 2007, 10:44:24 pm »
I know that point...

I agree with you but I implemented it that way because script console and other are.

The "philosophy" adopted by the view menu seems to be "member of the Messages notebook" and has nothing to do with real visibility of the item.

That is why the item is removed from notebook when not active instead of being activated.

Maybe should I propose two items, one for notebook integration, another one for item activation.
What I don't like is menu overload...

I think there should be a concertation to manage all notebooks pages the same way.

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: ThreadSearch plugin 0.6 release
« Reply #7 on: April 26, 2007, 10:52:13 pm »
Maybe should I propose two items, one for notebook integration, another one for item activation.
What I don't like is menu overload...
Hmmm... I understand and you're right. The only thing that came into my mind was to use a checked menu item as for the other notebook pages instead. Thus it would be directly visible whether it *is* already visible nut not activated or not...?! What do you think? This would also be conform to the other notebook pages that can be toggled in visibility (e.g. script console...)...
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #8 on: April 27, 2007, 12:48:06 am »
I had open a bug on this point :
bug 5358

It is now corrected and I didn't apply the correction to behave the same way.
Shame on me !!  :oops:

It will be fixed on next release.

I am working for now on the evolutions required by wxWidgets 2.8.3 (at least one change).

I'll probably release two binaries for both wxWidgets versions.

Dje

mariocup

  • Guest
Re: ThreadSearch plugin 0.6 release
« Reply #9 on: June 07, 2007, 11:09:22 pm »
Hi dje,

I have tried to build Thread Search from sources with wxWidgets 2.8.4 and get a lot of errors during compilation. Is there a new version available that works with wxWidgets 2.8.4?

Bye,

Mario

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #10 on: June 07, 2007, 11:32:12 pm »
Hi Mario !

I am working on toolbar integration for now with wxWidgets 2.8.3 (didn't you ask for this ?  :wink:).
Next release will integrate it and as soon as it works, I'll probably go on 2.8.4

The only change I did is to replace
Code
bool show = !m_pSizerSearchDirItems->IsShown(m_pSizerSearchDirItems);
by
Code
bool show = !m_pPnlDirParams->IsShown();

But I am quite surprised when you speak about "lots of errors" because there was few problems from 2.6.3 to 2.8.3.

Could you send an informative log ?

Dje

mariocup

  • Guest
Re: ThreadSearch plugin 0.6 release
« Reply #11 on: June 08, 2007, 12:14:10 am »
Hi dje,

I changed the source code as you said and removed the event.cpp file from the project and modified the linker settings for wxwidgets 2.8.4.
Now it works fine.

Thanks.

Bye,

Mario

mariocup

  • Guest
Re: ThreadSearch plugin 0.6 release
« Reply #12 on: June 10, 2007, 12:00:59 am »
Hi dje,

as codeblocks will be used more and more for embedded programming the default search mask should be *.cpp, *.c, *.h.

Thanks,

Mario

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #13 on: June 10, 2007, 12:08:41 am »
Quote
as codeblocks will be used more and more for embedded programming the default search mask should be *.cpp, *.c, *.h.
OK, no problem, that's done (heavy workload :lol:).

For now it is *.cpp;*.h and current (modified) mask is saved in default.conf.

Dje

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: ThreadSearch plugin 0.6 release
« Reply #14 on: June 12, 2007, 01:34:58 pm »
I am working on toolbar integration for now with wxWidgets 2.8.3 (didn't you ask for this ?  :wink:).
Next release will integrate it and as soon as it works, I'll probably go on 2.8.4

The only change I did is to replace
Code
bool show = !m_pSizerSearchDirItems->IsShown(m_pSizerSearchDirItems);
by
Code
bool show = !m_pPnlDirParams->IsShown();


first i did the above change

then i removed the files
\wx\include\wx\event.h
\wx\src\common\event.cpp
from the source files in the project settings
they are obviously not neccessary for building the plugin

finally i could build your fine and useful plugin using wxWidgets 2.8.4

i don't know about any problems with toolbar integration
but it seems basically to work fine.


later on i removed the devel target from the ThreadSearch project,
because i think it isn't necessary

following the rule how all other plugins and CB itself is build,
i think it's better to build the ThreadSearch plugin with debug info (using WX release dll)
and the output tree is stripped off the debug info later on during the update process.

thx for this fine plugin,
brgds tiwag