D11745: databasesanitizer: Use flags for filtering

Stefan BrĂ¼ns noreply at phabricator.kde.org
Fri Apr 13 03:25:30 UTC 2018


bruns requested changes to this revision.
bruns added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> databasesanitizer.cpp:193
> +            } else {
> +                usedDevices.erase(it++);
> +            }

this is definitely wrong, erasing invalidates iterators.

`it = usedDevices.erase(it);`

> databasesanitizer.cpp:195
> +            }
>          }
>          return usedDevices;

you can move the block with the  iteration over usedDevices and filtering into printDevices ...

You filter for IgnoreMounted there anyway.

> databasesanitizer.cpp:271
>      for (const auto& dev : usedDevices) {
> -        if (missingOnly && dev.mounted) {
> +        if ((accessFilter & IgnoreMounted) && dev.mounted) {
>              continue;

Filtering again?

REPOSITORY
  R293 Baloo

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

To: michaelh, #baloo, #frameworks, bruns
Cc: bruns, ngraham, smithjd, ashaposhnikov, michaelh, astippich, spoorun, alexeymin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180413/e8da1f12/attachment.html>


More information about the Kde-frameworks-devel mailing list