<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/D25010">View Revision</a></tr></table><br /><div><div><p>About granularity: I think it's fine. I was about to say that the use case of a recursive listing to calculate directory size only needs type and size, but it actually needs name too (for dirs), in order to recurse into subdirs.</p>
<p>So overall, I think Name is always useful, and should always be provided, whether or not the Basic flag is set.</p>
<p>Access, type and size aren't always needed, but they come at zero cost (copying a few ints), while name implies string conversions (8bit->unicode). So I don't think it makes sense to make access, type and size optional.</p>
<p>Hmm, with this reasoning, linkDest should be separated out. But that means going through all users of StatBasic and finding out if they look at UDS_LINK_DEST.</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/D25010#inline-143491">View Inline</a><span style="color: #4b4d51; font-weight: bold;">statjob.h: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; "><span style="color: #74777d"> */</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">KIOCORE_DEPRECATED_VERSION</span><span class="p">(</span><span style="color: #601200">5</span><span class="p">,</span> <span style="color: #601200">65</span><span class="p">,</span> <span style="color: #766510">"Use setDetails(KIO::statDetails)"</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">void</span> <span class="n">setDetails</span><span class="p">(</span><span style="color: #aa4000">short</span> <span style="color: #aa4000">int</span> <span class="n">details</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Typo: s/stat/Stat/</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/D25010#inline-143494">View Inline</a><span style="color: #4b4d51; font-weight: bold;">statjob.h:189</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"> * @param details selects the level of details we want.</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * You can fine grain the detail level you want.</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * @param flags Can be HideProgressInfo here</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Not sure what this specific sentence adds to the previous one. It's a parameter, obviously that means we can choose what to pass to it... Maybe more useful to mention that this is for performance reasons, less details implies more speed.</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/D25010#inline-143493">View Inline</a><span style="color: #4b4d51; font-weight: bold;">statjob.h:226</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"> */</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="n">KIOCORE_DEPRECATED_VERSION</span><span class="p">(</span><span style="color: #601200">5</span><span class="p">,</span> <span style="color: #601200">65</span><span class="p">,</span> <span style="color: #766510">"Use KIO::stat(const QUrl &, KIO::StatSide, KIO::StatDetails int, JobFlags)"</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; "><span class="n">KIOCORE_EXPORT</span> <span class="n">StatJob</span> <span style="color: #aa2211">*</span><span class="n">stat</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 class="n">KIO</span><span style="color: #aa2211">::</span><span class="n">StatJob</span><span style="color: #aa2211">::</span><span class="n">StatSide</span> <span class="n">side</span><span class="p">,</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Why does this say "int" after "StatDetails"?</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/D25010#inline-143583">View Inline</a><span style="color: #4b4d51; font-weight: bold;">statjob.h:234</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"> * @since 5.65</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * @deprecated since 5.65, use direcly KIO::StatDetails</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> */</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Typo: direcly -> directly (happens again two lines down)</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/D25010#inline-143495">View Inline</a><span style="color: #4b4d51; font-weight: bold;">statjob.h:236</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 class="n">KIOCORE_DEPRECATED_VERSION</span><span class="p">(</span><span style="color: #601200">5</span><span class="p">,</span> <span style="color: #601200">65</span><span class="p">,</span> <span style="color: #766510">"Use direcly KIO::StatDetails"</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="n">KIOCORE_EXPORT</span> <span class="n">KIO</span><span style="color: #aa2211">::</span><span class="n">StatDetails</span> <span class="n">detailsToStatDetails</span><span class="p">(</span><span style="color: #aa4000">int</span> <span class="n">details</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">missing the same #if as the above methods, no?<br />
In a "clean" build it should disappear.</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/D25010#inline-143496">View Inline</a><span style="color: #4b4d51; font-weight: bold;">kdiroperator.cpp:748</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">KJobWidgets</span><span style="color: #aa2211">::</span><span class="n">setWindow</span><span class="p">(</span><span class="n">job</span><span class="p">,</span> <span style="color: #aa4000">this</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="n">job</span><span style="color: #aa2211">-></span><span class="n">setDetails</span><span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #601200"><span class="bright">0</span></span><span class="p">);</span> <span style="color: #74777d">//We only want to know if it exists<span class="bright">, 0 == that.</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">job</span><span style="color: #aa2211">-></span><span class="n">setDetails</span><span class="p">(<span class="bright"></span></span><span class="bright"></span><span class="n"><span class="bright">KIO</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">StatBasic</span></span><span class="p">);</span> <span style="color: #74777d">//We only want to know if it exists</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">job</span><span style="color: #aa2211">-></span><span class="n">setSide</span><span class="p">(</span><span class="n">KIO</span><span style="color: #aa2211">::</span><span class="n">StatJob</span><span style="color: #aa2211">::</span><span class="n">DestinationSide</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This would actually be a use case for an even more basic level, "NoDetails"...</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/D25010#inline-143497">View Inline</a><span style="color: #4b4d51; font-weight: bold;">file.h:123</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">QFile</span> <span style="color: #aa2211">*</span><span class="n">mFile</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">KIO</span><span style="color: #aa2211">::</span><span class="n">StatDetails</span> <span class="n">getStatDetails</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;">Please move it up with the other private methods. This last section is member variables only.</p>
<p style="padding: 0; margin: 8px;">Also, it could be marked as <tt style="background: #ebebeb; font-size: 13px;">const</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/D25010#inline-143584">View Inline</a><span style="color: #4b4d51; font-weight: bold;">file_unix.cpp:542</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">const</span> <span class="bright"></span><span class="n"><span class="bright">QString</span></span><span class="bright"> </span><span class="n"><span class="bright">sD</span>etails</span> <span style="color: #aa2211">=</span> <span class="bright"></span><span class="n"><span class="bright">metaData</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">QStringLiteral</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"d</span>etails<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(251, 175, 175, .7);"> <span style="color: #aa4000">const</span> <span style="color: #aa4000">int</span> <span class="n">details</span> <span style="color: #aa2211">=</span> <span class="n">sDetails</span><span class="p">.</span><span class="n">isEmpty</span><span class="p">()</span> <span style="color: #aa2211">?</span> <span style="color: #601200">2</span> <span style="color: #aa2211">:</span> <span class="n">sDetails</span><span class="p">.</span><span class="n">toInt</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">const</span> <span class="bright"></span><span class="n"><span class="bright">KIO</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">StatDetails</span></span><span class="bright"> </span><span class="n"><span class="bright">d</span>etails</span> <span style="color: #aa2211">=</span> <span class="bright"></span><span class="n"><span class="bright">getStatD</span>etails<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 style="color: #74777d">//qDebug() << "========= LIST " << url << "details=" << details << " =========";</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">file_win.cpp needs to be ported the same way.</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/D25010#inline-143585">View Inline</a><span style="color: #4b4d51; font-weight: bold;">file_unix.cpp:830</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">KIO</span><span style="color: #aa2211">::</span><span class="n">StatDetails</span> <span class="n">FileProtocol</span><span style="color: #aa2211">::</span><span class="n">getStatDetails</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;">This should go to file.cpp so that it's available on Windows too, it's not Unix specific.</p>
<p style="padding: 0; margin: 8px;">OK, right now it's not really implemented on Windows, but let's make it easy for the future developer who will implement it ;)</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/D25010">https://phabricator.kde.org/D25010</a></div></div><br /><div><strong>To: </strong>meven, Frameworks, dfaure, kossebau<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns<br /></div>