Author Topic: Threaded File Browser (ShellExtensions plugin)  (Read 6543 times)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Threaded File Browser (ShellExtensions plugin)
« 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
« Last Edit: August 22, 2008, 01:48:09 am by dmoore »

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Threaded File Browser (ShellExtensions plugin)
« Reply #1 on: August 21, 2008, 05:24:51 pm »
Hi Damien !

Do you know this part of Win32 ?
It could avoid the polling on Windows.

Dje

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Threaded File Browser (ShellExtensions plugin)
« Reply #2 on: August 21, 2008, 05:50:57 pm »
Do you know this part 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.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Threaded File Browser (ShellExtensions plugin)
« Reply #3 on: August 23, 2008, 06:09:46 pm »
Does anyone know the equivalent Gnome library that offers File monitoring service? Is it gnome VFS? Are there alternatives?

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Threaded File Browser (ShellExtensions plugin)
« Reply #4 on: August 25, 2008, 09:23:59 am »
SGI's file access monitor: http://oss.sgi.com/projects/fam/

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Threaded File Browser (ShellExtensions plugin)
« Reply #5 on: August 25, 2008, 09:33:30 am »
Gamin the File Alteration Monitor based on "fam" with some changes to make it run per user and not with a system wide server.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Threaded File Browser (ShellExtensions plugin)
« Reply #6 on: August 25, 2008, 07:54:33 pm »
thanks guys. Presumably gnomevfs uses one or the other of these in the back end?