Expose rowCount as data role in TaskGroupingProxyModel.

Authored by hein on Nov 24 2016, 9:30 AM.

Description

Expose rowCount as data role in TaskGroupingProxyModel.

Summary:
This adds a new data role "ChildCount" to AbstractTasksModel and
implements it in TaskGroupingProxyModel.

The purpose of this data role is as a means of signalling to a Qt
Quick delegate for a top-level row that a property of the item -
namely the number of children it has - has changed. Qt Quick's poor
support for tree models makes the existing way of signaling this
(rowsInserted) prohibitive to use.

The Task Manager applet needs this info because it's in charge of
telling the window manager about the screen coordinates of window
delegates (through support code in this library). When a window is
directly added to an existing group, there is no new delegate
created, nor does the existing delegate change position. An
increase of ChildCount will be used in this case to decide to
publish delegate geo for the new window.

CCBUG:372699

Reviewers: Plasma, davidedmundson

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D3482

Details