[Thunar-dev] trash empty/full icons
Benedikt Meurer
benedikt.meurer at unix-ag.uni-siegen.de
Thu Aug 24 21:20:41 CEST 2006
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.)
Hm, that's indeed odd.
>>>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).
You'll have to special case the trash in some way or the other anyway.
BTW: The problem with thunar-vfs reporting incorrect state sometimes
will be fixed soon.
> 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.
That means duplicated code and possibly (slightly) different behaviour
of Thunar and xfdesktop again, which is what should have been avoided by
the use of the D-Bus interface.
> -brian
Benedikt
More information about the Thunar-dev
mailing list