<table><tr><td style="">mwolff retitled this revision from "WIP: position files at drop target position in folder" to "FolderView: position files at drop event target position".<br />mwolff edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-azzqdzhcffbhqt6/" rel="noreferrer">(Show Details)</a>
</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/D8598" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    </span>Remember the drop<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> event</span> target position and move the items once<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> they</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"><br />
    they become available. This requires us to allow moving while no<br />
    drag image is being shown. Otherwise, we listen to the<br />
    copy job signals, which gets created by the drop job. This allows<br />
    us to map target URLs in their final form, i.e. after the user</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">become available.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    potentially renamed the files to handle conflicts,</span> <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">This requires us to allow moving while no</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">to some desired</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">drag image is being shown.<br />
<br />
TODO:</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    visual position. To stay on the safe side, we also periodically<br />
    cleanup the mapping after an idle timeout of 10s. This ensures we</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">- h</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    don't gr</span>ow t<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">o handle the scenario,</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">he mapping with stale items.</span> <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">where a file gets renamed due to</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">This is required to handle</span><br />
  <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">a conflict resolution?</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">  errors in the file lister,</span> <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">the drop target map would be wrong</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">or situations like overwriting an existing</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">- similarly, skipped files</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    file which</span> would <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">remain in the hash and never</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">not trigger a rowAdded signal.</span><br />
  <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">be cleaned up...<br />
<br />
In principle</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">  <br />
    Overall, I'm quite happy with this approach. It seems to be quite<br />
    stable and requires minimal invasive changes only. That said</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">it would also be way better if we could somehow create</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">in</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">placeholder items for dropped files</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    the long term we could, and should</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">which then get updated based</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">cleanup this code to move</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">on</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    more of</span> the <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">drop job..</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">visual representation into the Positioner</span>. <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">This would also allow us to give the user some</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">That is a big</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">nice visual feedback of what's going on.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    change though,</span> <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">But that would require</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">due to the way the Positioner is currently written.</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">creating items in one of the proxy models</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    Most notably</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">and also tighter</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">that one reacts on rowsAboutToBeInserted which makes</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">integration with the dropjob, or so I think. I'll have to investigate</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    it impossible to query for any data of the row that gets inserted...</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">more.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">    <br />
    Differential Revision: https://phabricator.kde.org/D8598</span></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8598" rel="noreferrer">https://phabricator.kde.org/D8598</a></div></div><br /><div><strong>To: </strong>mwolff, hein, amantia<br /><strong>Cc: </strong>plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>