D25991: [KFilePlacesModel] Fix supported scheme check for devices

Stefan BrĂ¼ns noreply at phabricator.kde.org
Sat Dec 14 16:32:19 GMT 2019


bruns added inline comments.

INLINE COMMENTS

> kfileplacesmodel.cpp:758
> +                KFilePlacesItem *item = nullptr;
> +                if (deviceAvailable) {
> +                    item = new KFilePlacesItem(bookmarkManager, bookmark.address(), udi);

you have dropped the `allowedHere` check. Probably just `if (!allowedHere) continue`.

And for reasons unknown to me, `tags:` is not filtered per app - move the allowedHere check to the very beginning of the `while(...)` loop.

> kfileplacesmodel.cpp:759
> +                if (deviceAvailable) {
> +                    item = new KFilePlacesItem(bookmarkManager, bookmark.address(), udi);
> +                    if (!item->hasSupportedScheme(supportedSchemes)) {

Does KFilePlacesItem have a move constructor? You can do the heap allocation then only if necessary.

REPOSITORY
  R120 Plasma Workspace

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

To: broulik, #frameworks, dfaure, ngraham
Cc: bruns, ngraham, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191214/abddc7fd/attachment.html>


More information about the Plasma-devel mailing list