Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit c81205cc authored by Eike Hein's avatar Eike Hein

Do ignore-filtered-siblings properly

Turns out c8358c20 only worked accidentally. We can't do this
via filterModel->mapFromSource, because in a lambda connected to
its source model's rowsInserted signal, the proxy hasn't seen that
row yet.

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent a057edc7
......@@ -239,12 +239,14 @@ QModelIndex TaskFilterProxyModel::mapIfaceToSource(const QModelIndex &index) con
return mapToSource(index);
bool TaskFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
bool TaskFilterProxyModel::acceptsRow(int sourceRow) const
const QModelIndex &sourceIdx = sourceModel()->index(sourceRow, 0);
if (!sourceIdx.isValid()) {
return false;
// Filter tasks that are not to be shown on the task bar.
if (d->filterSkipTaskbar && {
return false;
......@@ -308,4 +310,11 @@ bool TaskFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &so
return true;
bool TaskFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
return acceptsRow(sourceRow);
......@@ -271,6 +271,13 @@ public:
void setDemandingAttentionSkipsFilters(bool skip);
* Returns whether the filter model accepts this source row.
* @param int A row in the source model.
bool acceptsRow(int sourceRow) const;
void virtualDesktopChanged() const;
void screenGeometryChanged() const;
......@@ -626,16 +626,9 @@ void TasksModel::Private::updateManualSortMap()
for (int i = (row - 1); i >= 0; --i) {
const QModelIndex &concatProxyIndex = concatProxyModel->index(, 0);
if (appsMatch(concatProxyIndex, idx)) {
// Our sort map contains row indices prior to any filtering, but we don't
// want to sort new tasks in next to siblings we're filtering out higher up
// in the proxy chain, so check in with the filter model.
const QModelIndex &filterProxyIndex = filterProxyModel->mapFromSource(concatProxyIndex);
if (filterProxyIndex.isValid()) {
if (appsMatch(concatProxyIndex, idx) && filterProxyModel->acceptsRow(concatProxyIndex.row())) {
sortedPreFilterRows.move(row, i + 1);
moved = true;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment