<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/D19887">View Revision</a></tr></table><br /><div><div><p>The use case for this needs to be documented in the constructor. I am not sure I am in favour of this because it breaks mimetype determination from contents, which is part of the shared mime info spec.<br />
But actually if that's the only thing that this breaks, and there's a good use case for it, then the parameter should be SkipMimetypeDetermination. Tell the user of the API what they'll miss, not what internal implementation detail this changes.<br />
Everyone wants to skip a syscall, but they need to realize what this means in terms of feature loss.</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/D19887#inline-111989">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kfileitem.cpp:183</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">     */</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">bool</span> <span style="color: #a0a000">m_bSkipStat</span><span class="p">:</span> <span style="color: #601200">1</span><span class="p">;</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;">move it so it's with the other bits above</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/D19887#inline-111992">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kfileitem.cpp:192</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: #74777d">// stat() local files if needed</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span style="color: #74777d">// TODO: delay this until requested</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">m_fileMode</span> <span style="color: #aa2211">==</span> <span class="n">KFileItem</span><span style="color: #aa2211">::</span><span class="n">Unknown</span> <span style="color: #aa2211">||</span> <span class="n">m_permissions</span> <span style="color: #aa2211">==</span> <span class="n">KFileItem</span><span style="color: #aa2211">::</span><span class="n">Unknown</span> <span style="color: #aa2211">||</span> <span class="n">m_entry</span><span class="p">.</span><span class="n">count</span><span class="p">()</span> <span style="color: #aa2211">==</span> <span style="color: #601200">0</span><span class="p">)</span> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">depending on the use case, wouldn't it be enough to implement this TODO instead?</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/D19887#inline-111990">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kfileitem.cpp:751</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">scheme</span><span class="p">.</span><span class="n">startsWith</span><span class="p">(</span><span class="n">QLatin1String</span><span class="p">(</span><span style="color: #766510">"http"</span><span class="p">))</span> <span style="color: #aa2211">||</span> <span class="n">scheme</span> <span style="color: #aa2211">==</span> <span class="n">QLatin1String</span><span class="p">(</span><span style="color: #766510">"mailto"</span><span class="p">))</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                    <span class="n">d</span><span style="color: #aa2211">-></span><span class="n">m_mimeType</span> <span style="color: #aa2211">=</span> <span class="n">db</span><span class="p">.</span><span class="n">mimeTypeForName</span><span class="p">(</span><span class="n">QLatin1String</span><span class="p">(</span><span style="color: #766510">"application/octet-stream"</span><span class="p">));</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">missing "else" after this line?</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/D19887#inline-111991">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kfileitem.cpp:1529</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 class="n">d</span><span style="color: #aa2211">-></span><span class="n">m_mimeType</span> <span style="color: #aa2211">=</span> <span class="n">db</span><span class="p">.</span><span class="n">mimeTypeForName</span><span class="p">(</span><span class="n">QLatin1String</span><span class="p">(</span><span style="color: #766510">"application/octet-stream"</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="n">d</span><span style="color: #aa2211">-></span><span class="n">m_mimeType</span> <span style="color: #aa2211">=</span> <span class="n">db</span><span class="p">.</span><span class="n">mimeTypeForFile</span><span class="p">(</span><span class="n">url</span><span class="p">.</span><span class="n">path</span><span class="p">(),</span> <span class="n">QMimeDatabase</span><span style="color: #aa2211">::</span><span class="n">MatchMode</span><span style="color: #aa2211">::</span><span class="n">MatchExtension</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">same here -- duplicated code => move to helper function</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/D19887#inline-111988">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kfileitem.h:118</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 class="n">KFileItem</span><span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">QUrl</span> <span style="color: #aa2211">&</span><span class="n">url</span><span class="p">,</span> <span style="color: #aa4000">bool</span> <span class="n">skipStat</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">booleans parameters are bad, please make it an enum.<br />
<a href="https://wiki.qt.io/API_Design_Principles#The_Boolean_Parameter_Trap" class="remarkup-link" target="_blank" rel="noreferrer">https://wiki.qt.io/API_Design_Principles#The_Boolean_Parameter_Trap</a></p>

<p style="padding: 0; margin: 8px;">+ docu missing including <span class="phabricator-remarkup-mention-unknown">@since</span> tag.</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/D19887">https://phabricator.kde.org/D19887</a></div></div><br /><div><strong>To: </strong>hoffmannrobert, dfaure, Frameworks, Dolphin<br /><strong>Cc: </strong>kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>