[Thunar-dev] trash empty/full icons

Brian J. Tarricone bjt23 at cornell.edu
Thu Aug 24 20:42:45 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/24/2006 10:43 AM, Benedikt Meurer wrote:
> Brian J. Tarricone wrote:
>>>> If you use the D-Bus interface, you shouldn't use the trash:-module in
>>>> thunar-vfs at all.
>> Why not?  Won't conforming implementations of the trash spec have to do
>> everything the same way anyway?
> 
> Because that way xfdesktop and Thunar are polling the trash, which is
> unnecessary overhead if you're already using the org.xfce.Trash
> interface (well currently xfdesktop will still poll the trash even if
> not using it directly, but that will be fixed when I finish the next
> bunch of patches for the trash implementation).

No, xfdesktop is not polling the trash.  Currently (er, maybe I haven't
committed this stuff yet, but I thought I did) it does QueryTrash *once*
on startup to determine trash state, and then connects to the
TrashChanged D-Bus signal to be notified of changes.

(BTW, TrashChanged seems to behave oddly.  Whenever it fires, I get
*two* invocations of my notification callback, one with the boolean as
the old value, and then another with the new value.  So:

- -> Trash is empty.
- -> Put item in trash.
- -> TrashChanged: full = FALSE
- -> TrashChanged: full = TRUE
- -> Empty the trash.
- -> TrashChanged: full = TRUE
- -> TrashChanged: full = FALSE

It's not a big deal since the end result is correct, but it's kinda
strange.)

> IMHO xfdesktop should behave exactly the same way as the trash panel
> applet, which means letting Thunar do all the trash related stuff and
> displaying only the icon with the appropriate state.

It just seems silly to me to have to special-case the trash's icon since
thunar-vfs provides information about it (albeit often incorrect
information).

I guess part of it is that I don't quite "trust" D-Bus for some reason
(no logical reason).  For example, I'd rather use
thunar_vfs_move_files() with the destination as trash://(filename)
instead of the D-Bus MoveToTrash method.  I feel like if there's a
direct C API to do something and an indirect D-Bus API to do something,
it seems more desirable to use the C API.

	-brian

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)

iD8DBQFE7fMl6XyW6VEeAnsRAn0CAJ9gOynaDhmIbXk5j+XUbMqhPtca0ACdGORU
nVthjOwAmCtiorP6roc4kZk=
=CGGN
-----END PGP SIGNATURE-----



More information about the Thunar-dev mailing list