[Differential] [Commented On] D3987: Use nullptr in all Frameworks (just diff in KIO shown here)

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Wed Jan 18 21:59:22 UTC 2017


kossebau added a comment.


  So seems everyone so far agrees that `{}` is best for the default value.
  
  What about the passed argument case? Let's look at the two respective samples:
  
    NETWinInfo info(QX11Info::connection(), win, QX11Info::appRootWindow(), {}, {});
    QCOMPARE(QStringList(queryUrl.queryItems({}).keys()).join(", "),
  
  vs.
  
    NETWinInfo info(QX11Info::connection(), win, QX11Info::appRootWindow(), NET::Properties(), NET::Properties2());
    QCOMPARE(QStringList(queryUrl.queryItems(KUrl::QueryItemsOptions()).keys()).join(", "),
  
  As said before, here IMO the explicit constructor (`NET::Properties()`, `NET::Properties2()`, `KUrl::QueryItemsOptions()`) call has advantages over `{}`, 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 `QString()` is used in many methods calls.
  More to type, but it helps reading the code a lot (and you should use a proper editor/IDE with auto-completion ;) ).

REPOSITORY
  R280 Prison

REVISION DETAIL
  https://phabricator.kde.org/D3987

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: kfunk, #frameworks, dfaure, kossebau
Cc: skelly, kossebau, dfaure, graesslin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170118/73fd970e/attachment.html>


More information about the Kde-frameworks-devel mailing list