<table><tr><td style="">meven added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D20838">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
color: #6B748C;
font-style: italic;
margin: 4px 0 12px 0;
padding: 8px 12px;
background-color: #F8F9FC;">
<div style="font-style: normal;
padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D20838#456847" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D20838#456847</a>, <a href="https://phabricator.kde.org/p/ngraham/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@ngraham</a> wrote:</div>
<div style="margin: 0;
padding: 0;
border: 0;
color: rgb(107, 116, 140);"><blockquote style="border-left: 3px solid #8C98B8;
color: #6B748C;
font-style: italic;
margin: 4px 0 12px 0;
padding: 8px 12px;
background-color: #F8F9FC;">
<div style="font-style: normal;
padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D20838#456831" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D20838#456831</a>, <a href="https://phabricator.kde.org/p/meven/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@meven</a> wrote:</div>
<div style="margin: 0;
padding: 0;
border: 0;
color: rgb(107, 116, 140);"><p>I have tested on my side, I don't understand why it does not work.<br />
From dolphin desktop:/ you can drag'n drop fine but not from the folder view.<br />
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".<br />
Could it be a because of the folder view filtering where it accepts to get dragged for instance ?</p></div>
</blockquote>
<p>Sounds like it. If it works from <tt style="background: #ebebeb; font-size: 13px;">desktop:/</tt> in Dolphin, but not from Folder view, I bet the drag isn't being sent the right way.</p>
<p>However, testing with a file in <tt style="background: #ebebeb; font-size: 13px;">desktop:/</tt>, the drag and drop happens successfully, but the path listed in the filename field is invalid (e.g. <tt style="background: #ebebeb; font-size: 13px;">desktop:IMG_0713.JPG</tt> and the file can't actually be opened:</p>
<p><a href="https://phabricator.kde.org/F6795316" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">F6795316: Screenshot_20190426_111318.png</a></p>
<p>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 <tt style="background: #ebebeb; font-size: 13px;">desktop:/<file></tt> the filename field, the path is listed as <tt style="background: #ebebeb; font-size: 13px;">file:///home/dev/Desktop/IMG_0713.JPG</tt> which is different, but also correct. Perhaps the path just needs to be sanitized in the same way when dragged to the file view?</p></div>
</blockquote>
<p>I have fixed those two issues :</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">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)</li>
<li class="remarkup-list-item">the drop action moveAction needed to be allowed in the KDirModel for the drop from the folder view to work.</li>
</ul>
<p>Todo :</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">add an automated test</li>
<li class="remarkup-list-item">check the KDirModel change is sane and does not introduce weird behavior</li>
<li class="remarkup-list-item">To test: what if the filewidget has a mime filter ?</li>
<li class="remarkup-list-item">To test: what if the filewidget is in folder mode ?</li>
</ul>
<p>Thoughts ?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D20838">https://phabricator.kde.org/D20838</a></div></div><br /><div><strong>To: </strong>meven, ngraham<br /><strong>Cc: </strong>apol, kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>