D18249: [datamodel] Rework items insert/remove

Anthony Fieroni noreply at phabricator.kde.org
Wed Jan 16 12:57:26 GMT 2019


anthonyfieroni added inline comments.

INLINE COMMENTS

> anthonyfieroni wrote in datamodel.cpp:379
> Optimization is you have [5, 6, 8] then [5, 6, 8, 9] so it make only 
> beginInsertRows({}, 3, 3);
> full replace (m_items[sourceName] = list.toVector();)
> endInsertRows()
> Same if you [5, 6]
> beginRemoveRows
> full replace (m_items[sourceName] = list.toVector();)
> endRemoveRows
> 
> It does not touch either m_roleNames size, which are changed.
> 
> I try to remove all first, then re-add with m_roleNames changes.

The worst case is when you have different values [5, 6, 8] and [5, 8, 9, 10] it will add only 10 and internally replace other, is QML model expect that? So why i first make full remove, then full insert.

REPOSITORY
  R242 Plasma Framework (Library)

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

To: anthonyfieroni, davidedmundson, broulik, ngraham, mart, #plasma
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190116/013109e6/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list