Re: Empty trash action



3. Since it's a destructive action it should have a negative adjust by
our policy (rank_adjust = -1, see MoveToTrash)

What makes this -1 and MoveToTrash -10? Is it just relative to what other actions there may be, and Trash has no other negative ones, while a file may?

4. self._trash_uri is not needed, just use yield EmptyTrash()

And what, just use TRASH_URI?  I was going by what TrashFile does.

5. Since it's a very important action we should handle exceptions from
.delete() and show a user-visible error (raise OperationError with
message from the GLib exception's message).

The documentation says delete() just returns True or False - I have no idea how to force it into failing to test this, but could I then assume it won't raise an exception? If so, I don't really have an error message to display; if not, how do I find out what exceptions it might raise?

6. the icon name can be "user-trash-full" (which is in the icon naming
spec) or maybe simply the default action icon (gearwheels) to avoid
repetition.

I'll use the former - I'd probably go for the latter for the reason you give, but then you get the 'no image' icon in preferences. (Shouldn't this be using the same gears-type icon as well when none is specified?)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]