<table><tr><td style="">elvisangelaccio requested changes to this revision.<br />elvisangelaccio 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/D3235" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>I just had a quick look, but overall it looks fine :)</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/D3235#inline-12632" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">archiveinterface.cpp:54</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">connect</span><span class="p">(</span><span style="color: #aa4000">this</span><span class="p">,</span> <span style="color: #aa2211">&</span><span class="n">ReadOnlyArchiveInterface</span><span style="color: #aa2211">::</span><span class="n">entry</span><span class="p">,</span> <span style="color: #aa4000">this</span><span class="p">,</span> <span style="color: #aa2211">&</span><span class="n">ReadOnlyArchiveInterface</span><span style="color: #aa2211">::</span><span class="n">onEntry</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">Q_ASSERT</span><span class="p">(</span><span class="n">args</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span style="color: #aa2211">>=</span> <span style="color: #601200">2</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">m_metaData</span> <span style="color: #aa2211">=</span> <span class="n">args</span><span class="p">.</span><span class="n">at</span><span class="p">(</span><span style="color: #601200">1</span><span class="p">).</span><span class="n">value</span><span style="color: #aa2211"><</span><span class="n">KPluginMetaData</span><span style="color: #aa2211">></span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This check should be the first thing in the ctor</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/D3235#inline-12635" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">cliinterface.h:73</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">virtual</span> <span style="color: #aa4000">void</span> <span style="color: #004012">resetParsing</span><span class="p">()</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #ffd0d0;"> <span class="n">virtual</span> <span class="n">Parameter<span class="bright">List</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">p</span>arameter<span class="bright">List</span></span><span class="bright"></span><span class="p"><span class="bright">()</span></span><span class="bright"> </span><span style="color: #aa4000"><span class="bright">const</span></span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">virtual</span> <span class="bright"></span><span style="color: #aa4000"><span class="bright">void</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">setupCli</span>Parameter<span class="bright">s</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">CliP</span>arameter<span class="bright">s</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">params</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">virtual</span> <span style="color: #aa4000">bool</span> <span style="color: #004012">readListLine</span><span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">QString</span> <span style="color: #aa2211">&</span><span class="n">line</span><span class="p">)</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This method in not really necessary. Every plugin could just do the setup in their own constructor (since they have access to <tt style="background: #ebebeb; font-size: 13px;">m_cliParameters</tt>).<br />
This way we can also drop the need for <tt style="background: #ebebeb; font-size: 13px;">cacheParameterList()</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/D3235#inline-12633" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">cliinterface.h:87</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: #d0ffd0;"><span style="color: #74777d"> */</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">virtual</span> <span class="n">QString</span> <span style="color: #004012">escapeFileName</span><span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">QString</span> <span style="color: #aa2211">&</span><span class="n">fileName</span><span class="p">)</span> <span style="color: #aa4000">const</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Why move this from <tt style="background: #ebebeb; font-size: 13px;">private</tt> to <tt style="background: #ebebeb; font-size: 13px;">public</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/D3235#inline-12636" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">cliinterface.h:116</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: #d0ffd0;"> <span class="n">CliParameters</span> <span style="color: #aa2211">*</span><span class="n">m_cliParameters</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Make it protected and add a public getter</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/D3235#inline-12638" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">cliparameters.h:38-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: #d0ffd0;"><span class="n">class</span> <span class="n">KERFUFFLE_EXPORT</span> <span style="color: #a0a000">CliParameters</span><span class="p">:</span> <span class="n">public</span> <span class="n">QObject</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">Q_OBJECT</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;">
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">Q_PROPERTY</span><span class="p">(</span><span class="n">QString</span> <span class="n">addProgram</span> <span class="n">MEMBER</span> <span class="n">m_addProgram</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">Q_PROPERTY</span><span class="p">(</span><span class="n">QString</span> <span class="n">deleteProgram</span> <span class="n">MEMBER</span> <span class="n">m_deleteProgram</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">Q_PROPERTY</span><span class="p">(</span><span class="n">QString</span> <span class="n">extractProgram</span> <span class="n">MEMBER</span> <span class="n">m_extractProgram</span><span class="p">)</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Since this new class is not only about parameters/switches but also other CLI stuff (regexes, etc.) maybe we should find a more descriptive name, though I can't think any at the moment :p</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/D3235#inline-12637" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">cliparameters.h:81</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: #d0ffd0;"> <span style="color: #aa4000">bool</span> <span style="color: #004012">isInitialized</span><span class="p">()</span> <span style="color: #aa4000">const</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Once you drop <tt style="background: #ebebeb; font-size: 13px;">CliInterface::cacheParameterList()</tt> you can probably drop this as well.</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/D3235#inline-12634" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">cliparameters.h:106</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: #d0ffd0;"><span style="color: #a0a000">protected</span><span class="p">:</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">unnecessary keyword</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>rARK Ark</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3235" rel="noreferrer">https://phabricator.kde.org/D3235</a></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>rthomsen, elvisangelaccio<br /><strong>Cc: </strong>kde-utils-devel, tctara<br /></div>