<table><tr><td style="">kfunk requested changes to this revision.<br />kfunk added a reviewer: kfunk.<br />kfunk 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/D3395" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Thanks for working on this David! Much appreciated.</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/D3395#inline-13365" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ghdialog.cpp: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: #ffd0d0;"><span style="color: #aa4000">void</span> <span class="n">Dialog</span><span style="color: #aa2211">::</span><span class="n">authorizeResponse</span><span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">QByteArray</span> <span style="color: #aa2211">&</span><span class="n">id</span><span class="p">,</span> <span style="color: #aa4000">const</span> <span class="n">QByteArray</span> <span style="color: #aa2211">&</span><span class="n">token</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"><span style="color: #aa4000">void</span> <span class="n">Dialog</span><span style="color: #aa2211">::</span><span class="n">authorizeResponse</span><span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">QByteArray</span> <span style="color: #aa2211">&</span><span class="n">id</span><span class="p">,</span> <span style="color: #aa4000">const</span> <span class="n">QByteArray</span> <span style="color: #aa2211">&</span><span class="n">token<span class="bright"></span></span><span class="bright"></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">tokenName</span></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;"><tt style="background: #ebebeb; font-size: 13px;">const QString&</tt> please</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/D3395#inline-13369" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ghdialog.cpp:128</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">m_account</span><span style="color: #aa2211">-></span><span class="n">setName</span><span class="p">(</span><span class="n">QString</span><span class="p">());</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">KMessageBox</span><span style="color: #aa2211">::</span><span class="n">sorry</span><span class="p">(</span><span style="color: #aa4000">this</span><span class="p">,</span> <span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"Authentication failed! Please, "</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #ffd0d0;"> <span style="color: #766510">"try again<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: #d0ffd0;"> <span style="color: #766510">"try again<span class="bright"> "</span></span><span class="bright"> </span><span style="color: #766510"><span class="bright">"couldn't create token: "</span></span><span class="bright"></span><span class="p"><span class="bright">)</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">tokenName</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">+</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"</span></span><span class="bright"></span><span style="color: #bb6622"><span class="bright">\n</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">+</span></span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Would be better to give this dialog a proper caption. There's a multi-QString-arg version of KMessageBox, see here: <a href="https://api.kde.org/frameworks/kwidgetsaddons/html/namespaceKMessageBox.html#a02dfebea27d2b3e28199aa543a4d012c" class="remarkup-link" target="_blank" rel="noreferrer">https://api.kde.org/frameworks/kwidgetsaddons/html/namespaceKMessageBox.html#a02dfebea27d2b3e28199aa543a4d012c</a>.</p>
<p style="padding: 0; margin: 8px;">Set both caption + text. Make sure casing is correct 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/D3395#inline-13366" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ghresource.cpp:65</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">url</span><span class="p">.</span><span class="n">setPath</span><span class="p">(</span><span class="n">url</span><span class="p">.</span><span class="n">path</span><span class="p">()</span> <span style="color: #aa2211">+</span> <span style="color: #766510">'/'</span> <span style="color: #aa2211">+</span> <span style="color: #766510">"/authorizations"</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #ffd0d0;"> <span class="bright"></span><span class="n"><span class="bright">QByteArray</span></span><span class="bright"> </span><span class="n"><span class="bright">data</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span style="color: #766510"><span class="bright">"{ </span></span><span class="bright"></span><span style="color: #bb6622"><span class="bright">\"</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">scopes</span></span><span class="bright"></span><span style="color: #bb6622"><span class="bright">\"</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">: [</span></span><span class="bright"></span><span style="color: #bb6622"><span class="bright">\"</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">repo</span></span><span class="bright"></span><span style="color: #bb6622"><span class="bright">\"</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">], </span></span><span class="bright"></span><span style="color: #bb6622"><span class="bright">\"</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">note</span></span><span class="bright"></span><span style="color: #bb6622"><span class="bright">\"</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">: </span></span><span class="bright"></span><span style="color: #bb6622"><span class="bright">\"</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">KDevelop Github Provider</span></span><span class="bright"></span><span style="color: #bb6622"><span class="bright">\"</span></span><span class="bright"></span><span style="color: #766510"><span class="bright"> }"</span></span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="bright"></span><span class="n"><span class="bright">m_tokenName</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span style="color: #766510"><span class="bright">"KDevelop Github Provider : "</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">QHostInfo</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">localHostName</span></span><span class="bright"></span><span class="p"><span class="bright">()</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">+</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">" - "</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">QDateTime</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">currentDateTimeUtc</span></span><span class="bright"></span><span class="p"><span class="bright">().</span></span><span class="bright"></span><span class="n"><span class="bright">toString</span></span><span class="bright"></span><span class="p"><span class="bright">()</span>;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">QByteArray</span> <span class="n">data</span> <span style="color: #aa2211">=</span> <span style="color: #766510">"{ </span><span style="color: #bb6622">\"</span><span style="color: #766510">scopes</span><span style="color: #bb6622">\"</span><span style="color: #766510">: [</span><span style="color: #bb6622">\"</span><span style="color: #766510">repo</span><span style="color: #bb6622">\"</span><span style="color: #766510">], </span><span style="color: #bb6622">\"</span><span style="color: #766510">note</span><span style="color: #bb6622">\"</span><span style="color: #766510">: </span><span style="color: #bb6622">\"</span><span style="color: #766510">"</span><span style="color: #aa2211">+</span><span class="n">m_tokenName</span><span class="p">.</span><span class="n">toUtf8</span><span class="p">()</span><span style="color: #aa2211">+</span><span style="color: #766510">"</span><span style="color: #bb6622">\"</span><span style="color: #766510"> }"</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Style: <tt style="background: #ebebeb; font-size: 13px;">"" + a + b + ...</tt> (spaces between operator & operands)</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/D3395#inline-13367" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ghresource.cpp:151</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">emit</span> <span style="color: #004012">authenticated</span><span class="p">(</span><span class="n">map</span><span class="p">.</span><span class="n">value</span><span class="p">(</span><span style="color: #766510">"id"</span><span class="p">).</span><span class="n">toByteArray</span><span class="p">(),</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #ffd0d0;"> <span class="n">map</span><span class="p">.</span><span class="n">value</span><span class="p">(</span><span style="color: #766510">"token"</span><span class="p">).</span><span class="n">toByteArray</span><span class="p">());</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">map</span><span class="p">.</span><span class="n">value</span><span class="p">(</span><span style="color: #766510">"token"</span><span class="p">).</span><span class="n">toByteArray</span><span class="p">()<span class="bright">,</span></span><span class="bright"></span><span class="n"><span class="bright">m_tokenName</span></span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="p">}</span> <span style="color: #aa4000">else</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Style: Space after comma</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/D3395#inline-13368" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ghresource.cpp:153</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="p">}</span> <span style="color: #aa4000">else</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #ffd0d0;"> <span class="n">emit</span> <span class="n">authenticated</span><span class="p">(</span><span style="color: #766510">""</span><span class="p">,</span> <span style="color: #766510">""</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">emit</span> <span class="n">authenticated</span><span class="p">(</span><span style="color: #766510">""</span><span class="p">,</span> <span style="color: #766510">""<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">,</span></span><span class="bright"></span><span class="n"><span class="bright">m_tokenName</span></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;">Dito, same in other places</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>rKDEVELOP KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3395" rel="noreferrer">https://phabricator.kde.org/D3395</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>WDavidO, KDevelop, kfunk<br /><strong>Cc: </strong>kfunk, kdevelop-devel, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>