<table><tr><td style="">dfaure added inline comments.
</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/D9103" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D9103#inline-40984" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">chinmoyr</span> wrote in <span style="color: #4b4d51; font-weight: bold;">batchrenamejob.cpp:75</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Here it is searching for exactly one sequence. If more than one sequence are present like $$file$$name$$ then it is considered invalid.</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">But why? Why doesn't this lead to 12file$$name$$?</p>
<p style="padding: 0; margin: 8px;">It's a weird input in the first place, I don't mind if the output is weird, because the benefit of doing it that way is:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">easier documentation (no need to talk about the case of multiple disconnected sequences)</li>
<li class="remarkup-list-item">faster implementation (look for first placeholder, look if repeated, done)</li>
</ul>
<p style="padding: 0; margin: 8px;">OK I see that you solved the latter point in this commit though, it's at least fast now. Then I don't mind as much. You can leave it as is, I just wanted to finish explaining my point ;)</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D9103#inline-40985" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">chinmoyr</span> wrote in <span style="color: #4b4d51; font-weight: bold;">batchrenamejob.cpp:109</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">I just copied whatever there was in Dolphin. Where should I move it to?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">The public header, where people will see it ;)</p>
<p style="padding: 0; margin: 8px;">I see you did that now, thanks.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D9103#inline-41013" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">chinmoyr</span> wrote in <span style="color: #4b4d51; font-weight: bold;">batchrenamejob.cpp:196</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">In dolphin the overwrite dialog pops up. Otherwise the fileRenamed is still emitted and the job continues. Maybe I should make that its emission conditional?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Ah right KIO::moveAs itself pops up the overwrite dialog, but then can it end with KIO::ERR_FILE_ALREADY_EXIST ? At that point the user should overwrite or skip or cancel. Are you really sure this error code can happen in this slot?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D9103#inline-41045" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">batchrenamejob.cpp:76</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">first</span> <span style="color: #aa2211">!=</span> <span style="color: #aa2211">-</span><span style="color: #601200">1</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">while</span> <span class="p">(</span><span class="n">first</span> <span style="color: #aa2211"><</span> <span class="n">newName</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span style="color: #aa2211">&&</span> <span class="n">newName</span><span class="p">.</span><span class="n">at</span><span class="p">(</span><span class="n">first</span><span style="color: #aa2211">++</span><span class="p">)</span> <span style="color: #aa2211">==</span> <span class="n">placeHolder</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">The trailing ';' looks like a mistake, even if it's not.</p>
<p style="padding: 0; margin: 8px;"><tt style="background: #ebebeb; font-size: 13px;">{}</tt> solves this, or moving <tt style="background: #ebebeb; font-size: 13px;">++first</tt> to the body of the while (more readable IMHO).</p>
<p style="padding: 0; margin: 8px;">BTW if it moves forward it shouldn't be called <tt style="background: #ebebeb; font-size: 13px;">first</tt>, it makes the indexOf below very confusing. Maybe just call it <tt style="background: #ebebeb; font-size: 13px;">pos</tt>.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D9103#inline-41042" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">batchrenamejob.h:72</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * the file to "Test 0012.jpg".</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> *</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * @param src The list of items to rename.</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">... and then this should mention the case where no placeholder is present, and 12 gets appended (before the extension, IIUC).</p></div></div></div></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/D9103" rel="noreferrer">https://phabricator.kde.org/D9103</a></div></div><br /><div><strong>To: </strong>chinmoyr, Frameworks, dfaure<br /><strong>Cc: </strong>apol<br /></div>