<table><tr><td style="">dfaure requested changes to this revision.<br />dfaure added a comment.<br />This revision now requires changes to proceed.
</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/D24349">View Revision</a></tr></table><br /><div><div><p>Thanks!</p></div></div><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/D24349#inline-143982">View Inline</a><span style="color: #4b4d51; font-weight: bold;">forwardingslavebase.cpp:91</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(251, 175, 175, .7);">    <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">url</span><span class="p">.</span><span class="n">scheme</span><span class="p">()</span> <span style="color: #aa2211">==</span> <span class="n">q</span><span style="color: #aa2211">-></span><span class="n">mProtocol</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">if</span> <span class="p">(</span><span class="n">url</span><span class="p">.</span><span class="n">scheme</span><span class="p">()</span> <span style="color: #aa2211">==</span> <span class="bright"></span><span class="n"><span class="bright">QString</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">::</span></span><span class="bright"></span><span class="n"><span class="bright">fromLatin1</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="n">q</span><span style="color: #aa2211">-></span><span class="n">mProtocol<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">        <span class="n">result</span> <span style="color: #aa2211">=</span> <span class="n">q</span><span style="color: #aa2211">-></span><span class="n">rewriteUrl</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">newURL</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">QLatin1String is sufficient for comparisons (and cheaper)</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/D24349#inline-143983">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kremoteencoding.cpp:95</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; "><span style="color: #aa4000">const</span> <span style="color: #aa4000">char</span> <span style="color: #aa2211">*</span><span class="n">KRemoteEncoding</span><span style="color: #aa2211">::</span><span class="n">encoding</span><span class="p">()</span> <span style="color: #aa4000">const</span>
</div><div style="padding: 0 8px; margin: 0 4px; "><span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">KF6 TODO: return QByteArray</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/D24349#inline-143984">View Inline</a><span style="color: #4b4d51; font-weight: bold;">slavebase.h:979</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; ">    <span class="n">QByteArray</span> <span class="n">mProtocol</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #304a96">inline</span> <span style="color: #aa4000">const</span> <span class="n">QString</span> <span style="color: #004012">mProtocolToStr</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">return</span> <span class="n">QString</span><span style="color: #aa2211">::</span><span class="n">fromLatin1</span><span class="p">(</span><span class="n">mProtocol</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This method should be const</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/D24349#inline-143985">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ftp.cpp:1232</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; ">    <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #aa2211">!</span><span class="n">isfile</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="n">ftpFolder</span><span class="p">(</span><span class="n">remoteEncoding</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">directory</span><span class="p">(</span><span class="n">url</span><span class="p">),</span> <span style="color: #304a96">false</span><span class="p">);</span>    <span style="color: #74777d">// ignore errors</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">ftpFolder</span><span class="p">(<span class="bright"></span></span><span class="bright"></span><span class="n"><span class="bright">QString</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">::</span></span><span class="bright"></span><span class="n"><span class="bright">fromLocal8Bit</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="n">remoteEncoding</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">directory</span><span class="p">(</span><span class="n">url<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>),</span> <span style="color: #304a96">false</span><span class="p">);</span>    <span style="color: #74777d">// ignore errors</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Should this be remoteEncoding()->decode(...) given that the method will then use q->remoteEncoding()->encode()?</p>

<p style="padding: 0; margin: 8px;">(I'm a bit confused with kremoteencoding, I could be wrong)</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/D24349#inline-143986">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kcookiespolicies.cpp:367</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(251, 175, 175, .7);">    <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">mUi</span><span class="p">.</span><span class="n">rbPolicyAccept</span><span style="color: #aa2211">-></span><span class="n">isChecked</span><span class="p">())</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="n">advice</span> <span style="color: #aa2211">=</span> <span class="n">KCookieAdvice</span><span style="color: #aa2211">::</span><span class="n">adviceToStr<span class="bright"></span></span><span class="bright"> </span><span class="p">(</span><span class="n">KCookieAdvice</span><span style="color: #aa2211">::</span><span class="n">Accept</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span style="color: #aa4000">else</span> <span style="color: #004012">if</span> <span class="p">(</span><span class="n">mUi</span><span class="p">.</span><span class="n">rbPolicyAcceptForSession</span><span style="color: #aa2211">-></span><span class="n">isChecked</span><span class="p">())</span>
</div><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">mUi</span><span class="p">.</span><span class="n">rbPolicyAccept</span><span style="color: #aa2211">-></span><span class="n">isChecked</span><span class="p">())<span class="bright"></span></span><span class="bright"> </span><span class="p"><span class="bright">{</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">advice</span> <span style="color: #aa2211">=</span> <span class="bright"></span><span class="n"><span class="bright">QString</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">::</span></span><span class="bright"></span><span class="n"><span class="bright">fromLocal8Bit</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="n">KCookieAdvice</span><span style="color: #aa2211">::</span><span class="n">adviceToStr</span><span class="p">(</span><span class="n">KCookieAdvice</span><span style="color: #aa2211">::</span><span class="n">Accept<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="bright"></span><span class="p"><span class="bright">}</span></span><span class="bright"> </span><span style="color: #aa4000">else</span> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">mUi</span><span class="p">.</span><span class="n">rbPolicyAcceptForSession</span><span style="color: #aa2211">-></span><span class="n">isChecked</span><span class="p">())<span class="bright"></span></span><span class="bright"> </span><span class="p"><span class="bright">{</span></span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">fromLatin1 is enough for adviceToStr, like you did on line 177 (so it's inconsistent)</p>

<p style="padding: 0; margin: 8px;">(repeats 3 more times)</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/D24349#inline-143987">View Inline</a><span style="color: #4b4d51; font-weight: bold;">smbrodlg.cpp:122</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; ">      <span style="color: #aa4000">unsigned</span> <span style="color: #aa4000">int</span> <span class="n">num</span> <span style="color: #aa2211">=</span> <span class="p">((</span><span class="n">a1</span> <span style="color: #aa2211">&</span> <span style="color: #601200">0x3F</span><span class="p">)</span> <span style="color: #aa2211"><<</span> <span style="color: #601200">10</span><span class="p">)</span> <span style="color: #aa2211">|</span> <span class="p">((</span><span class="n">a2</span><span style="color: #aa2211">&</span> <span style="color: #601200">0x1F</span><span class="p">)</span> <span style="color: #aa2211"><<</span> <span style="color: #601200">5</span><span class="p">)</span> <span style="color: #aa2211">|</span> <span class="p">(</span><span class="n">a3</span> <span style="color: #aa2211">&</span> <span style="color: #601200">0x1F</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">      <span class="n">password</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span style="color: #aa2211">=</span> <span class="n">QChar</span><span class="p">(<span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">uchar</span></span><span class="bright"></span><span class="p"><span class="bright">)</span>((</span><span class="n">num</span> <span style="color: #aa2211">-</span> <span style="color: #601200">17</span><span class="p">)</span> <span style="color: #aa2211">^</span> <span style="color: #601200">173</span><span class="p">));</span> <span style="color: #74777d">// restore</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">      <span class="n">password</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span style="color: #aa2211">=</span> <span class="n">QChar</span><span class="p">(<span class="bright"></span></span><span class="bright"></span><span class="n"><span class="bright">QLatin1Char</span></span><span class="p">((</span><span class="n">num</span> <span style="color: #aa2211">-</span> <span style="color: #601200">17</span><span class="p">)</span> <span style="color: #aa2211">^</span> <span style="color: #601200">173</span><span class="p">));</span> <span style="color: #74777d">// restore</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">   <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">You could remove the QChar() around I guess.</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/D24349#inline-143988">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.cpp:199</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; ">    <span style="color: #aa4000">for</span> <span class="p">(;</span> <span class="n">it</span> <span style="color: #aa2211">!=</span> <span class="n">fileList</span><span class="p">.</span><span class="n">end</span><span class="p">()</span> <span class="p">;</span> <span style="color: #aa2211">++</span><span class="n">it</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="n">QFileInfo</span> <span class="n">info</span><span class="p">(</span><span class="n">QFile</span><span style="color: #aa2211">::</span><span class="n">encodeName</span><span class="p">(</span><span class="n">it</span><span style="color: #aa2211">-></span><span class="n">path</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">QFileInfo</span> <span class="n">info</span><span class="p">(</span><span class="n">Q<span class="bright">String</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">::</span></span><span class="bright"></span><span class="n"><span class="bright">fromLocal8Bit</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">Q</span>File</span><span style="color: #aa2211">::</span><span class="n">encodeName</span><span class="p">(</span><span class="n">it</span><span style="color: #aa2211">-></span><span class="n">path<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>));</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">        <span class="n">it</span><span style="color: #aa2211">-></span><span class="n">time</span> <span style="color: #aa2211">=</span> <span class="n">info</span><span class="p">.</span><span class="n">lastModified</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Ouch.</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);">QFileInfo info(it->path)</pre></div>

<p style="padding: 0; margin: 8px;">should be enough.</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/D24349#inline-143989">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.cpp:262</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; ">            <span class="n">qDebug</span><span class="p">()</span> <span style="color: #aa2211"><<</span> <span class="n">sleepSecs</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"seconds have passed, deleting"</span> <span style="color: #aa2211"><<</span> <span class="n">info</span><span class="p">.</span><span class="n">filePath</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">            <span class="n">QFile</span><span class="p">(</span><span class="n">QFile</span><span style="color: #aa2211">::</span><span class="n">encodeName</span><span class="p">(</span><span class="n">src</span><span class="p">)).</span><span class="n">remove</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">QFile</span><span class="p">(</span><span class="n">Q<span class="bright">String</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">::</span></span><span class="bright"></span><span class="n"><span class="bright">fromLocal8Bit</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">Q</span>File</span><span style="color: #aa2211">::</span><span class="n">encodeName</span><span class="p">(</span><span class="n">src<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>)).</span><span class="n">remove</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #74777d">// NOTE: this is not necessarily a temporary directory.</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Same here</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/D24349">https://phabricator.kde.org/D24349</a></div></div><br /><div><strong>To: </strong>ahmadsamir, dfaure, Frameworks<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns<br /></div>