Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: dmoore on August 21, 2008, 05:09:14 pm
-
I've created a branch of my Shell Extensions plugin that refreshes the FileBrowser tree on a background thread. Some testing would be appreciated. Download the sources using:
svn checkout svn://svn.berlios.de/cbilplugin/branches/ShellExtensions-listener
or
svn checkout http://svn.berlios.de/svnroot/repos/cbilplugin/branches/ShellExtensions-listener
You should build the se target against any recent CB nightly. (see note about linux below)
Some limitations/bugs:
* I haven't updated the linux project file yet, but if you want to test on linux you will need to add the files FileListener.cpp and FileListener.h to the se-plugin target linux project file now updated
* I haven't yet written the code to parse VCS states (wxExecute doesn't work on threads -- I have a workaround in mind) Still buggy - crashes on win32 for unknown reason...
* The update can sometimes be a little laggy when switching the root folder
* Although the branch is called "listener", the code actually relies on polling of the file system, which may be a little processor intensive on lightweight systems. This gets ugly when parsing VCS states, so it might be time to look into file system notifications...
cheers
-
Hi Damien !
Do you know this part (http://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx) of Win32 ?
It could avoid the polling on Windows.
Dje
-
Do you know this part (http://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx) of Win32 ?
It could avoid the polling on Windows.
Thanks. I did not know about it (I generally try to avoid the WIN32 API). If I was to use it, I would probably want to submit a new wxFileSystemListener class as a patch to wxWidgets. That would also require learning the equivalent on Linux...
At least on my machine, the polling uses only a small amount of processing power (polling the expanded folders once every few seconds). I'll also tweak it by turning down the thread priority and stop polling if the file browser (or CB) isn't in view.
-
Does anyone know the equivalent Gnome library that offers File monitoring service? Is it gnome VFS? Are there alternatives?
-
SGI's file access monitor: http://oss.sgi.com/projects/fam/
-
Gamin the File Alteration Monitor (http://www.gnome.org/~veillard/gamin/index.html) based on "fam" with some changes to make it run per user and not with a system wide server.
-
thanks guys. Presumably gnomevfs uses one or the other of these in the back end?