<table><tr><td style="">kossebau added a comment.
</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/D3987" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>So seems everyone so far agrees that <tt style="background: #ebebeb; font-size: 13px;">{}</tt> is best for the default value.</p>
<p>What about the passed argument case? Let's look at the two respective samples:</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);">NETWinInfo info(QX11Info::connection(), win, QX11Info::appRootWindow(), {}, {});
QCOMPARE(QStringList(queryUrl.queryItems({}).keys()).join(", "),</pre></div>
<p>vs.</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);">NETWinInfo info(QX11Info::connection(), win, QX11Info::appRootWindow(), NET::Properties(), NET::Properties2());
QCOMPARE(QStringList(queryUrl.queryItems(KUrl::QueryItemsOptions()).keys()).join(", "),</pre></div>
<p>As said before, here IMO the explicit constructor (<tt style="background: #ebebeb; font-size: 13px;">NET::Properties()</tt>, <tt style="background: #ebebeb; font-size: 13px;">NET::Properties2()</tt>, <tt style="background: #ebebeb; font-size: 13px;">KUrl::QueryItemsOptions()</tt>) call has advantages over <tt style="background: #ebebeb; font-size: 13px;">{}</tt>, as it make it clear to the reader what is passed. Would also help against ambiguity on overloads. It would be consistent how e..g <tt style="background: #ebebeb; font-size: 13px;">QString()</tt> is used in many methods calls.<br />
More to type, but it helps reading the code a lot (and you should use a proper editor/IDE with auto-completion ;) ).</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R280 Prison</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3987" rel="noreferrer">https://phabricator.kde.org/D3987</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>kfunk, Frameworks, dfaure, kossebau<br /><strong>Cc: </strong>skelly, kossebau, dfaure, graesslin<br /></div>