D24139: More d-pointerization of the public KDAV API

Daniel Vrátil noreply at phabricator.kde.org
Sun Sep 22 12:30:15 BST 2019


dvratil accepted this revision.
dvratil added a comment.
This revision is now accepted and ready to land.


  Some small nitpicks, but the code is good to go even without those.

INLINE COMMENTS

> davcollectionsmultifetchjob.h:79
> +
> +    std::unique_ptr<DavCollectionsMultiFetchJobPrivate> d;
>  };

I usually mark d-pointers as `const` to prevent accidental re-assigning other than in constructor.

> davmanager.cpp:51
>  {
> -    if (!mSelf) {
> -        mSelf = new DavManager();
> +    static std::unique_ptr<DavManager> sSelf;
> +    if (!sSelf) {

I suppose you could just have static `DavManager` on stack and just return a pointer to it.  The static will get initialized on the first call to `self()` and the initialization is thread-safe.

REPOSITORY
  R490 KDAV Library

BRANCH
  master

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

To: vkrause, dvratil
Cc: dvratil, kde-pim, fbampaloukas, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190922/021d069b/attachment.html>


More information about the kde-pim mailing list