Merge lp://qastaging/~aacid/dee-qt/behave_better into lp://qastaging/dee-qt

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michal Hruby
Approved revision: 83
Merged at revision: 81
Proposed branch: lp://qastaging/~aacid/dee-qt/behave_better
Merge into: lp://qastaging/dee-qt
Diff against target: 65 lines (+12/-4)
1 file modified
deelistmodel.cpp (+12/-4)
To merge this branch: bzr merge lp://qastaging/~aacid/dee-qt/behave_better
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michal Hruby (community) Approve
Review via email: mp+181258@code.qastaging.launchpad.net

Commit message

Be a better behaved QAbstractListModel

That means:
  * decrement/increment the count between the begin/end calls
  * Add a workaround so that data() ignores the not really removed row after endRemoveRows has been called

We still are not good behaved in the fact that we call beginInsertRows
after the model has been internall modified, but luckily it seems
not much people listens to that signal's data

We also rely on the fact that nothing will call data() between us
resetting m_rowBeingRemoved to -1 at the end of DeeListModelPrivate::onRowRemoved
and the internal dee model actually removing the row

To post a comment you must log in.
82. By Albert Astals Cid

move the if inside the if

83. By Albert Astals Cid

Actually don't need the if

Revision history for this message
Michal Hruby (mhr3) wrote :

Looks reasonable, it certainly isn't ideal, but that's as far as we can go since changes to dee models emit just a single signal, which isn't easy to map to Qt's begin and end change model.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: