D3987: Use nullptr in all Frameworks (just diff in KIO shown here)

Kevin Funk noreply at phabricator.kde.org
Mon Dec 4 08:53:52 UTC 2017


kfunk added a comment.


  In https://phabricator.kde.org/D3987#174960, @mkoller wrote:
  
  > I just found out that this change introduced wrong replacements.
  
  
  It did not, the changes are correct, though they're probably not what everyone expects.
  
  Please read through the comments in this Diff, this issue has been discussed in length already.
  
  tl;dr: Proposed resolution of this "problem": I'd replace `return nullptr` in your cases with `return {}` or just leave it as-is.
  
  > The changes in frameworks/kimageformats/src/imageformats like the following are incorrect, since the return type is not a pointer but an enum flags type, so it should still be 0, not nullptr.
  > 
  > @@ -337,10 +337,10 @@ QImageIOPlugin::Capabilities EPSPlugin::capabilities(QIODevice *device, const QB
  > 
  >       return Capabilities(CanRead | CanWrite);
  >   }
  >   if (!format.isEmpty()) {
  > 
  > - return 0; +        return nullptr; } if (!device->isOpen()) {
  > - return 0; +        return nullptr; }
  > 
  >   Capabilities cap;

REPOSITORY
  R280 Prison

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

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


More information about the Kde-frameworks-devel mailing list