D15301: Use std::unique_ptr for two private data members

Tobias Deiminger noreply at phabricator.kde.org
Thu Sep 6 08:38:45 BST 2018


tobiasdeiminger added inline comments.

INLINE COMMENTS

> pageviewannotator.cpp:304
>          Okular::NormalizedPoint point;
> -        QPixmap * pixmap;
> +        std::unique_ptr<QPixmap> pixmap;
>          QString hoverIconName, iconName;

+1 for automatic memory management. But is there a reason to not just say

  QPixmap pixmap;

? From top of my head, QPixmap is already a small handle to implicitly shared COW pixmap data. So, no need to wrap it again.

REPOSITORY
  R223 Okular

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

To: sander, #okular
Cc: tobiasdeiminger, okular-devel, ngraham, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180906/1871384d/attachment-0001.html>


More information about the Okular-devel mailing list