Re: How to get trashed file path after "g_file_trash" ?



On Wed, 2008-03-19 at 22:01 +0100, Amos Brocco wrote:
> Hello, 
> I'm porting the undo patch code [1] from gnome-vfs to gio/gvfs.
> I'm facing the following problem: to undo a "move to trash" action I
> need to know where the file has been trashed (and under which name);
> 
> so, is there a way to get the path or am I forced to process every file
> in the trash path and check the "orig_path" attribute?

Hi Amos,
I think the right way to obtain what you need would be implementing
first a g_file_restore_from_trash () API in GIO (see bug #518573 [1]).
This would also bring the chance to have something like
nautilus_file_operations_restore (), and would also solve the
long-standing bug #41850 [2] about restoring from trash.
The trash GVfs backend already stores information about the trashed
files inside ~/.local/share/Trash/info (including the original path
(uri?)), so I think this would have to be implemented there.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=518573
[2] http://bugzilla.gnome.org/show_bug.cgi?id=41850

Cheers,

Cosimo



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