> On Oct. 13, 2014, 10:59 p.m., Thomas Lübking wrote:
> > kioslave/trash/trashimpl.cpp, line 168
> > <https://git.reviewboard.kde.org/r/120573/diff/3/?file=318241#file318241line168>
> >
> >     nothing actuallly changed here - if this failed, the following 
> > "testDir( trashDir + QString::fromLatin1("/info") )" will fail and init 
> > returns false.
> >     
> >     From the other code, I assume you'd want to chop trashDir here and then 
> > won't require any code in infoPath/filePath ?

oops, hadn't seen this comment.

Your assumption is right, though I prefer to `testdir(trashDir+"/KDE.trash")` 
and then do the `+=` when `!err` (or an `error()` otherwise).
I think it's better to skip only the KDE.trash path component (even if it's 
likely that subsequent subdir creation will fail too) : skipping the 
`KDE.trash` component has no effect on KDE wastebin functionality, skipping the 
other components does. `KDE.trash` is only there so that the user knows where 
those `files` and `info` directories and their contents come from, should s/he 
open the Trash for whatever reason.


- René J.V.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120573/#review68331
-----------------------------------------------------------


On Oct. 13, 2014, 11:09 p.m., René J.V. Bertin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120573/
> -----------------------------------------------------------
> 
> (Updated Oct. 13, 2014, 11:09 p.m.)
> 
> 
> Review request for KDE Software on Mac OS X and KDE Runtime.
> 
> 
> Repository: kde-runtime
> 
> 
> Description
> -------
> 
> KDE on OS X does not handle the desktop session (no "Plasma") nor can it rely 
> on XDG to obtain the proper paths to use for something like the trash. As a 
> result, all applications that propose to move things they manage to the 
> wastebin (Dolphin, but also digiKam) will store those items in a place that 
> has no particular meaning on OS X, and that will thus tend to fill up.
> 
> OS X stores trash in one of several locations. Files trashed from the boot 
> volume (and/or the volume containing $HOME, I don't actually know that) end 
> up in `~/.Trash`. Files deleted from other volumes end up in 
> `/Volumes/volName/.Trashes/uid`, where volName is the volume name (regardless 
> whether it's an external or a remote drive; only mounted NFS shares are 
> handled differently) and uid the numerical user id. Permissions on `.Trashes` 
> are the same as those expected by KDE.
> 
> The kio_trash kioslave appears to support several actual trash directory 
> locations, just like OS X. `TrashImpl::init()` creates a standard trash in 
> `~/.local/share/Trash` (at least under OS X) but also 
> `TrashImpl::trashForMountPoint()` that is used in cases I have not yet 
> encountered.
> 
> On OS X, my modified `TrashImpl::init()` sets the standard trash directory to 
> `~/.Trash/KDE.trash` and will create the `files` and `info` subdirectories as 
> required, because they will of course be deleted when the user empties the OS 
> X trash. `TrashImpl::fileRemoved()` has been modified to call a new function, 
> `deleteEmptyTrashInfraStructure` to delete the KDE trash's internal 
> infrastructure when the wastebin is empty so that OS X also sees the trash as 
> emptied. (Since implementing `deleteEmptyTrashInfraStructure` this feature 
> actually works, as expected as far as I can tell).
> 
> Remains to be done:
> - determine in what cases `trashForMountPoint()` is used, and finish the 
> modifications for it to use `/.Trashes/uid/KDE.trash`
> 
> 
> Diffs
> -----
> 
>   kioslave/trash/trashimpl.h bc68723 
>   kioslave/trash/trashimpl.cpp 30ee05b 
> 
> Diff: https://git.reviewboard.kde.org/r/120573/diff/
> 
> 
> Testing
> -------
> 
> On OS X 10.6.8 with kdelibs and kde-runtime git/4.14, using Dolphin. Tested 
> actions are
> - move items to wastebin from $HOME and a directory on a different volume
> - restore items to both places
> - empty wastebin through Dolphin
> - empty OS X trashcan
> 
> 
> Thanks,
> 
> René J.V. Bertin
> 
>

Reply via email to