Review Request 125214: Add support for network shares in kio_trash

David Faure faure at kde.org
Sun Sep 13 21:24:10 UTC 2015



> On Sept. 13, 2015, 8:48 p.m., David Faure wrote:
> > Thanks for the patch!
> > 
> > Protecting write access to a file is better done with QLockFile (which I added to Qt 5.0) than with a DBus based mechanism.
> > 
> > (btw I just noticed that KInterProcessLock is now unused in kio_trash, we should delete it, once your patch is in)
> 
> Bartosz Sławianowski wrote:
>     What would be the best path for lock file, QStandardPaths::TempLocation or QStandardPaths::CacheLocation (or something else)?

The best path is "right next to the file you're writing to".
So writableLocation(GenericConfigLocation)+"/trashrc.lock"
But wait, KConfig does this already, at a lower level. Your higher-level lock makes sense (read, increment, write). Just call it something slightly different then.

Something like writableLocation(GenericConfigLocation)+"/trashrc.nextid.lock".


- David


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


On Sept. 13, 2015, 7:59 p.m., Bartosz Sławianowski wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125214/
> -----------------------------------------------------------
> 
> (Updated Sept. 13, 2015, 7:59 p.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Bugs: 177023
>     https://bugs.kde.org/show_bug.cgi?id=177023
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> kio_trash doesn't support network shares, causing "trashed" files to be copied into user's home directory.
> 
> This patch adds support for them by assigning them persistent ID's (because there is no device minor/major ID or any other integer we can use) which are stored in trashrc config file - because we need to share them between possible multiple kio_trash processes.
> 
> Network shares get ID's starting with 6000000 to avoid possible conflicts with block devices.
> 
> NextID is also stored in trashrc file, I guess I could drop it by simply using group.keyList().count() or iterating all entries and finding max ID. Need opinions 
> 
> Thought about using different config file to avoid adding mutable modifier to m_config, need opinions here as well
> 
> Also using KInterProcessLock which already was there instead of adding dependency on KDbusAddons framework
> 
> 
> Diffs
> -----
> 
>   src/ioslaves/trash/trashimpl.h cee9278 
>   src/ioslaves/trash/trashimpl.cpp 300d320 
> 
> Diff: https://git.reviewboard.kde.org/r/125214/diff/
> 
> 
> Testing
> -------
> 
> Arch Linux, few simple localhost NFS shares
> 
> 
> Thanks,
> 
> Bartosz Sławianowski
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150913/95506e3c/attachment.html>


More information about the Kde-frameworks-devel mailing list