<table><tr><td style="">emateli 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/D14631">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/D14631#499038" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D14631#499038</a>, <a href="https://phabricator.kde.org/p/dfaure/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@dfaure</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p>KIO::move (implemented by CopyJob) can move N files to a single destination directory, but they get the same name at that dest.<br />
 KIO::moveAs (implemented by CopyJob too) can move/rename a single file to a specific filename at destination.</p>

<p>What you're suggesting is a new job that can move N files to a destination directory (to make this generic it doesn't have to be in-place renames, right?), but you're providing the filename at destination for each file, right?</p></div>
</blockquote>

<p>More or less but they don't have to be in the same directory. Think of it as a sequence of <tt style="background: #ebebeb; font-size: 13px;">KIO::moveAs</tt> operations. Any N files can be moved anywhere.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I could imagine a KIO::moveAs that takes two QList<QUrl> and then this information is fetched from there rather than using m_dest.<br />
 In fact, if the existing moveAs() method is ported to call the two-QLists one, that will mean less special casing in the code (which wouldn't use m_dest anymore in slotResultStating, when m_asMethod).</p></blockquote>

<p>The two list version could work, but I was thinking of one <tt style="background: #ebebeb; font-size: 13px;">QList<QSomeStruct></tt> that contains src and dest names. Looks less error prone IMO. Also yes, moveAs can be implemented as a special case of this with just one item to move. The option of adapting move to accept a list of dest also involves modifying CopyJobPrivate's dest which will lead to a larger refactoring needed than the proposal below, right?</p>

<hr class="remarkup-hr" />

<p>I was thinking of implementing this as a new subclass of Job where it will create the new Job and add a subjob for each of the files to be moved. In the same fashion that the current <tt style="background: #ebebeb; font-size: 13px;">BatchRenameJob</tt> works. Otherwise if overloading will not break binary compatibility then this can be an overloaded <tt style="background: #ebebeb; font-size: 13px;">KIO::moveAs(QList<SomeStruct>)</tt> which again does the same thing, a series of the current <tt style="background: #ebebeb; font-size: 13px;">moveAs</tt>. It also has to remain as a single job so that it can be undone in one go instead of undoing for each item that was renamed.</p>

<p>e.g:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">auto items = {
        KioRenameItem{QUrl("~/a.doc"), QUrl("~/Documents/a.doc")},
        KioRenameItem{QUrl("~/dir/file"), QUrl("~/Documents/file-2019")},
};</pre></div>

<p>If this looks OK then I'll just get started with this and continue this part of the work in another patch.</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/D14631">https://phabricator.kde.org/D14631</a></div></div><br /><div><strong>To: </strong>emateli, Frameworks, dfaure, mlaurent<br /><strong>Cc: </strong>anthonyfieroni, chinmoyr, mlaurent, asensi, rkflx, dfaure, aacid, ngraham, kde-frameworks-devel, LeGast00n, sbergeron, michaelh, bruns<br /></div>