Review Request 128666: Change KFileItemModel's createMimeData handling so it supports the upcoming stash:/ ioslave.

arnav dhamija arnav.dhamija at gmail.com
Sat Aug 13 11:16:31 BST 2016



> On Aug. 13, 2016, 8:11 a.m., David Faure wrote:
> > I actually think url() or mostLocalUrl(), but not targetUrl(), should be used in all cases, in this code.
> > 
> > targetUrl() is supposed to be "the URL that opens when clicking on the file". All other KIO operations (copy, move, d-n-d) are supposed to use the item url() or mostLocalUrl().
> > git log points to bug 307336, review 111209, which was about nepomuksearch and tags. I remember those bending the rules a little bit about that stuff. Assuming baloo doesn't need this, I vote for porting this to mostLocalUrl().
> > 
> > But wait, the code already prefers mostLocalUrl(), a bit further down. Doesn't your slave set UDS_LOCAL_PATH ? Please debug what happens in this code.
> > canUseMostLocalUrls should be true, and data->setUrls(mostLocalUrls) should happen, in which case this patch shouldn't be needed.

No, I do not use UDS_LOCAL_PATH. As you mentioned in the email: 

```So, thinking about it again, it's exactly what you want for stash:,
rather than UDS_LOCAL_PATH which is more for kio_desktop (which is really just
a virtual view of a local folder, and deletion should delete the actual file,
etc.). Sorry for the false track.
```
If mostLocalUrl() falls back to the normal item.url() if a local path is not found, it is the best fit for this purpose.


- arnav


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


On Aug. 13, 2016, 8:12 a.m., arnav dhamija wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128666/
> -----------------------------------------------------------
> 
> (Updated Aug. 13, 2016, 8:12 a.m.)
> 
> 
> Review request for Dolphin, David Faure and Emmanuel Pescosta.
> 
> 
> Repository: dolphin
> 
> 
> Description
> -------
> 
> I am writing a new ioslave for Dolphin to make it possible to virtually stage directories without affecting the source. This requires the use of a targetUrl, but creating the mime data using the targetUrl is messing up my c/p operations through the Dolphin GUI as it does not respect the hierarchy of the stash:/ ioslave. Hence, I need createMimeData to use the item's url only for this ioslave. The special handling isn't very neat, but at least this way, it won't break any other existing ioslaves which need the targetUrl.
> 
> 
> Diffs
> -----
> 
>   src/kitemviews/kfileitemmodel.cpp 1f94972 
> 
> Diff: https://git.reviewboard.kde.org/r/128666/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> arnav dhamija
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20160813/e7f645eb/attachment.htm>


More information about the kfm-devel mailing list