ah, desktop icons

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Fri Feb 10 19:22:32 CET 2006


Brian J. Tarricone wrote:
> Hey all,

Hey Brain,

> I just did a bunch of work on the desktop icon support (it's nice when
> I'm in meetings but don't really need to pay full attention).  Anyway,
> if you want to give it a try, update to latest xfdesktop SVN, and select
> it in the combo box in the desktop settings dialog.  Note that you have
> to have thunar installed at compile-time for this to work.
> 
> Things I know don't work but plan on fixing:
> 
> * Files don't remember where they're placed on the desktop between sessions.
> * No 'open with other application' dialog yet (might not implement this).

I don't think it's necessary to duplicate this in xfdesktop. You can
just invoke Thunar here and it'll popup the chooser dialog.

> * Copy/Cut on a file doesn't work (might not implement this).

This is easy. You can just copy the ThunarClipboardManager class and
remove all the paste related stuff. Afterwards, it will not depend on
any Thunar internals.

> * File properties dialog doesn't exist yet (might not implement this).

Should be sufficient to popup the file chooser dialog of the file
manager -> org.xfce.FileManager.DisplayFileProperties().

> Anyway, just letting people know if they want to play with it.  If there
> are things that are actually buggy, please let me know.  If you just
> want to complain that something doesn't work yet or isn't implemented, I
> don't really care ^_^.

I'm going to complain anyway... desktop icons are for wimps! But I'm
really glad that you take care of implementing them. ;-)

One of the things I noticed about your implementation is that you use
ThunarVfsPath's and determine the ThunarVfsInfo on-demand. As said on
thunar-dev, this can cause trouble if the info takes long to load (i.e.
it's a symlink to a slow device or a network share, etc.). Therefore,
unless you receive a change notification, the info should also be
determined asynchronously using thunar_vfs_listdir(). The attached patch
changes XfdesktopFileIcon to use ThunarVfsInfo directly instead of
ThunarVfsPath. There was also a bug in there which caused xfdesktop to
crash when the file name contains non-UTF-8 chars, because you used the
path name directly, instead of using ThunarVfsInfo->display_name, which
is garantied to be UTF-8 (while the path name is always in the local
file system encoding).

I also changed the "Open" action for folders to try
org.xfce.FileManager.Launch() first, prior to falling back to hardcoded
Thunar invocation. This way, things will also work with other file managers.

And for thunar_vfs_info_execute() you passed the path of the executable
as parameter (-> path_list), which was probably not what you wanted
(yeah, I know I should write better documentation), since this will
actually expand to exec("<executable> <executable>"). The path_list
parameter for _execute() gives the paths that should be passed as
parameters to the command.

See the attached patch. You may want to reformat it, though I tried to
keep your coding style.

Other than that, I was really impressed. The context menu looks pretty
close to Thunar's context menu, and one feels right at home. ;-)

You could also implement ThunarxFileInfo in XfdesktopFileIcon, and
you'll be able to use thunar extensions in xfdesktop.

> 	-brian

Thanks,
Benedikt

BTW: Do you plan to make the icon size an option?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xfdesktop-file-icon.patch
Type: text/x-patch
Size: 22727 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20060210/dca0bef1/attachment.bin>


More information about the Xfce4-dev mailing list