D27061: replace samba module with data that works

David Edmundson noreply at phabricator.kde.org
Fri Feb 7 14:11:59 GMT 2020


davidedmundson added inline comments.

INLINE COMMENTS

> smbmountmodel.cpp:73
> +        case ColumnRole::Share:
> +            return devices().at(index.row()).as<Solid::NetworkShare>()->url();
> +        case ColumnRole::Path:

This looks dangerous.

You always add row indexes to the end, but you're taking an index of map.values() for the source.

Qmap::values retains order within entires, but the whole list is not ordered by global insertion time.

i.e If you call addDevice it could insert in the middle of what .values returns even though from a model pov you've said it's at the end. This will break a UI.

REPOSITORY
  R102 KInfoCenter

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

To: sitter, #localization, #plasma, #vdg
Cc: davidedmundson, ltoscano, yurchor, ngraham, alexde, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, 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/20200207/f1ba4ae4/attachment-0001.html>


More information about the Plasma-devel mailing list