Port StatisticsProxyModel to KExtraColumnsProxyModel.
ClosedPublic

Authored by dfaure on Jul 3 2016, 12:29 PM.

Details

Reviewers
skelly
dvratil
Summary
  • this fixes sibling() - the unittest confirmed Dan's assessment that

sibling() got broken for StatisticsProxyModel with Qt5.
And this finally repairs the browser tab in akonadiconsole, clicking
on a folder lists its contents.

  • this reduces the number of dataChanged signals emitted by the proxy:

instead of dataChanged((row,0) (row,0)) + dataChanged((row,1) (row,3))
the proxy now emits dataChanged((row,0) (row,3)) directly

  • I also removed the code emitting dataChanged for parent indexes,

the reasoning was "so that cumulative totals can be updated", but there
are no cumulative totals anywhere in this proxy (other than the tooltip),
although I now see that the delegate is where cumulative totals happen...

  • the awful model-index-struct-casting hack is no longer necessary,

the code is much simpler, there are now unittests (both here and for
the base class KExtraColumnsProxyModel in kitemmodels)...

Test Plan

unittest + akonadiconsole + kmail
Deleting a mail in akonadiconsole updates the total in the closed parent
folder in kmail's foldertree. So that still works.
I wonder if I'm missing a case where the delegate needs the proxy to
emit dataChanged for parents so that they are refreshed correctly, though.

Diff Detail

Repository
R165 Akonadi
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure updated this revision to Diff 4910.Jul 3 2016, 12:29 PM
dfaure retitled this revision from to Port StatisticsProxyModel to KExtraColumnsProxyModel..
dfaure updated this object.
dfaure edited the test plan for this revision. (Show Details)
dfaure added a reviewer: dvratil.
dfaure added a subscriber: KDE PIM.
Restricted Application added a project: KDE PIM. · View Herald TranscriptJul 3 2016, 12:29 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
dvratil accepted this revision.Jul 4 2016, 10:56 PM
dvratil edited edge metadata.

Looks good to me, thanks a lot for taking time to look into this.

Please close bug 355229 when committing this.

This revision is now accepted and ready to land.Jul 4 2016, 10:56 PM
dfaure closed this revision.Jul 5 2016, 8:38 PM

Pushed to master with 381acbc.