D17052: Simplify reference counting of FrameData

Vlad Zagorodniy noreply at phabricator.kde.org
Tue Nov 20 16:40:02 GMT 2018


zzag added a comment.


  In gneral, +1 for shared pointers.

INLINE COMMENTS

> framesvg.cpp:375
>  //#define DEBUG_FRAMESVG_CACHE
>  FrameSvgPrivate::~FrameSvgPrivate()
> +{}

= default;

> framesvg.cpp:569
>  
> -QRect FrameSvgPrivate::contentGeometry(FrameData* frame, const QSize& size) const
> +QRect FrameSvgPrivate::contentGeometry(const QSharedPointer<FrameData> &frame, const QSize& size) const
>  {

Do we really need to pass a shared pointer? Wouldn't it better to just pass a raw pointer? We won't do any ownership-related stuff anyway.

> framesvg.cpp:618
> +            // we've found a match, use that one
> +            Q_ASSERT(newKey == newFd.data()->cacheId);
>              frame = newFd;

Just newFd->cacheId.

REPOSITORY
  R242 Plasma Framework (Library)

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

To: apol, #plasma, #frameworks
Cc: zzag, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181120/dbe2c6da/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list