D11529: Balooctl: Deindex unfound files with check command.

Stefan BrĂ¼ns noreply at phabricator.kde.org
Fri Aug 24 21:54:27 BST 2018


bruns added inline comments.

INLINE COMMENTS

> smithjd wrote in indexcleaner.cpp:76
> This example will also detach with or without a const intermediate.
> 
> > ...returning a copy from a method means that the copy is shared and has negative side-effects when used with range-based loops. - https://www.dvratil.cz/2015/06/qt-containers-and-c11-range-based-loops

No, if done correctly, it will not detach.
For iterating, you need a readonly copy of the container. Using `const auto` gurantees you will not modify the container. Calling begin() on a const Qt container will not detach.

Try to understand the linked article.

REPOSITORY
  R293 Baloo

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

To: smithjd, #baloo, vhanda, michaelh, broulik, bruns
Cc: bruns, kde-frameworks-devel, mgallien, ashaposhnikov, michaelh, astippich, spoorun, ngraham, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180824/c446d6ac/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list