D20838: Allow to drop one file or one folder on KDirOperator

Méven Car noreply at phabricator.kde.org
Sun Apr 28 11:34:54 BST 2019


meven added a comment.


  In D20838#456847 <https://phabricator.kde.org/D20838#456847>, @ngraham wrote:
  
  > In D20838#456831 <https://phabricator.kde.org/D20838#456831>, @meven wrote:
  >
  > > I have tested on my side, I don't understand why it does not work.
  > >  From dolphin desktop:/ you can drag'n drop fine but not from the folder view.
  > >  I receive events and desktop:/ urls but the drag is not accepted whatever I do, like always calling event->accept() in the "case QEvent::DragEnter".
  > >  Could it be a because of the folder view filtering where it accepts to get dragged for instance ?
  >
  >
  > Sounds like it. If it works from `desktop:/` in Dolphin, but not from Folder view, I bet the drag isn't being sent the right way.
  >
  > However, testing with a file in `desktop:/`, the drag and drop happens successfully, but the path listed in the filename field is invalid (e.g. `desktop:IMG_0713.JPG` and the file can't actually be opened:
  >
  > F6795316: Screenshot_20190426_111318.png <https://phabricator.kde.org/F6795316>
  >
  > Looks like the protocol is missing a trailing slash before the file path part. Interestingly, I notice that if I drag the same file from `desktop:/<file>` the filename field, the path is listed as `file:///home/dev/Desktop/IMG_0713.JPG` which is different, but also correct. Perhaps the path just needs to be sanitized in the same way when dragged to the file view?
  
  
  I have fixed those two issues :
  
  - the path are now translated from kde url to mostlocal urls (dropping from desktop:/ works fine) (not from trash:/ though, but it currently does not work currently in the filename field either)
  - the drop action moveAction needed to be allowed in the KDirModel for the drop from the folder view to work.
  
  Todo :
  
  - add an automated test
  - check the KDirModel change is sane and does not introduce weird behavior
  - To test: what if the filewidget has a mime filter ?
  - To test: what if the filewidget is in folder mode ?
  
  Thoughts ?

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D20838

To: meven, ngraham
Cc: apol, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190428/b7153598/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list