Fix TasksModel.anyTaskDemandsAttention not updating on window closure.

Authored by hein on Mar 31 2017, 10:15 AM.

Description

Fix TasksModel.anyTaskDemandsAttention not updating on window closure.

Summary:
Previously we updated the prop after checking for
AbstractTasksModel::IsDemandingAttention on window closure, but
as the window is gone, we can't actually get state for it anymore,
so we always need to update.

To make up for it, this patch also optimizes the prop updates to occur
only once per insert/remove batch - this is a bit academic because
the source models currently only insert single rows at a time, but
it's good hygiene.

BUG:378254

Reviewers: Plasma, mart

Subscribers: plasma-devel

Tags: Plasma

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