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



On Thu, 2008-03-20 at 13:30 +0100, Amos Brocco wrote:
> Il giorno gio, 20/03/2008 alle 11.30 +0100, Alexander Larsson ha
> scritto:
> > On Thu, 2008-03-20 at 10:18 +0100, Amos Brocco wrote:
> > > >  Not sure what would happen
> > > > if you trashed two files of the same name from the same directory
> > > > though, having to deal with the edge cases of the "_filename.2",
> > > > "_filename.3" with the same original path if you're thinking about
> > > > going that way though. 
> > > 
> > > By having GFile updating the uri/path information after g_file_trash it
> > > wouldn't be difficult. For the undo I keep track of the "old uri", "new
> > > uri" and the operation (copy, move, trash, etc.); if g_file_get_uri
> > > returns the updated path (in the trash) I could just use the "orig-path"
> > > attribute to get the original file.
> > 
> > GFiles are immutable identifies, similare to a pathname string. This
> > proposal is similar to having trash_file(char *filename) change the
> > value of filename to the new location. It just doesn't work.
> > 
> 
> Ok, I understand. What about g_file_trash returning the actual URI
> (trash://...) instead of a boolean value (NULL if trashing failed)?

That would work fine... except we're now totally API/ABI frozen....
Kinda sucks.





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