Fix cache invalidation for TasksModel::launcherCount.

Fixes regression from 6e72674a.

Testers: dfaure
BUG:364378
wilder-5.14
Eike Hein 10 years ago
parent 7ceccde2e0
commit d1f32fb083
  1. 12
      libtaskmanager/tasksmodel.cpp

@ -207,12 +207,6 @@ void TasksModel::Private::initModels()
launcherTasksModel = new LauncherTasksModel(q);
QObject::connect(launcherTasksModel, &LauncherTasksModel::launcherListChanged,
q, &TasksModel::launcherListChanged);
QObject::connect(launcherTasksModel, &QAbstractItemModel::rowsInserted,
q, &TasksModel::updateLauncherCount);
QObject::connect(launcherTasksModel, &QAbstractItemModel::rowsRemoved,
q, &TasksModel::updateLauncherCount);
QObject::connect(launcherTasksModel, &QAbstractItemModel::modelReset,
q, &TasksModel::updateLauncherCount);
concatProxyModel = new ConcatenateTasksProxyModel(q);
@ -429,6 +423,10 @@ void TasksModel::Private::initModels()
abstractTasksSourceModel = groupingProxyModel;
q->setSourceModel(groupingProxyModel);
QObject::connect(q, &QAbstractItemModel::rowsInserted, q, &TasksModel::updateLauncherCount);
QObject::connect(q, &QAbstractItemModel::rowsRemoved, q, &TasksModel::updateLauncherCount);
QObject::connect(q, &QAbstractItemModel::modelReset, q, &TasksModel::updateLauncherCount);
QObject::connect(q, &QAbstractItemModel::rowsInserted, q, &TasksModel::countChanged);
QObject::connect(q, &QAbstractItemModel::rowsRemoved, q, &TasksModel::countChanged);
QObject::connect(q, &QAbstractItemModel::modelReset, q, &TasksModel::countChanged);
@ -1548,8 +1546,6 @@ bool TasksModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent
if ((!appId.isEmpty() && appId == filteredAppId)
|| (launcherUrl.isValid() && launcherUrlsMatch(launcherUrl,
filteredIndex.data(AbstractTasksModel::LauncherUrl).toUrl(), IgnoreQueryItems))) {
// TODO: Do this outside of filterAcceptsRow, based on notification that something changed.
QMetaObject::invokeMethod(const_cast<TasksModel *>(this), "updateLauncherCount", Qt::QueuedConnection);
return false;
}
}

Loading…
Cancel
Save