D18249: [datamodel] Rework items insert/remove

Anthony Fieroni noreply at phabricator.kde.org
Wed Jan 16 09:34:45 GMT 2019


anthonyfieroni added inline comments.

INLINE COMMENTS

> davidedmundson wrote in datamodel.cpp:379
> I don't understand what you're changing here, can you provide a bit more detail on the exact problem.

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.

> davidedmundson wrote in datamodel.cpp:444
> this isn't equivalent.
> 
> I could have an entry with an empty count
> 
> Now this gets left behind

Got'cha

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/c7345a2f/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list