Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/tasksmodel.cpp
Show First 20 Lines • Show All 620 Lines • ▼ Show 20 Line(s) | 593 | const QModelIndex &idx = concatProxyModel->index(sortedPreFilterRows.at(row), 0); | |||
---|---|---|---|---|---|
621 | bool moved = false; | 621 | bool moved = false; | ||
622 | 622 | | |||
623 | // Try to move the task up to its right-most app sibling, unless this | 623 | // Try to move the task up to its right-most app sibling, unless this | ||
624 | // is us sorting in a launcher list for the first time. | 624 | // is us sorting in a launcher list for the first time. | ||
625 | if (launchersEverSet && !idx.data(AbstractTasksModel::IsLauncher).toBool()) { | 625 | if (launchersEverSet && !idx.data(AbstractTasksModel::IsLauncher).toBool()) { | ||
626 | for (int i = (row - 1); i >= 0; --i) { | 626 | for (int i = (row - 1); i >= 0; --i) { | ||
627 | const QModelIndex &concatProxyIndex = concatProxyModel->index(sortedPreFilterRows.at(i), 0); | 627 | const QModelIndex &concatProxyIndex = concatProxyModel->index(sortedPreFilterRows.at(i), 0); | ||
628 | 628 | | |||
629 | if (appsMatch(concatProxyIndex, idx)) { | 629 | if (appsMatch(concatProxyIndex, idx) && filterProxyModel->acceptsRow(concatProxyIndex.row())) { | ||
630 | // Our sort map contains row indices prior to any filtering, but we don't | | |||
631 | // want to sort new tasks in next to siblings we're filtering out higher up | | |||
632 | // in the proxy chain, so check in with the filter model. | | |||
633 | const QModelIndex &filterProxyIndex = filterProxyModel->mapFromSource(concatProxyIndex); | | |||
634 | | ||||
635 | if (filterProxyIndex.isValid()) { | | |||
636 | sortedPreFilterRows.move(row, i + 1); | 630 | sortedPreFilterRows.move(row, i + 1); | ||
637 | moved = true; | 631 | moved = true; | ||
638 | } | | |||
639 | 632 | | |||
640 | break; | 633 | break; | ||
641 | } | 634 | } | ||
642 | } | 635 | } | ||
643 | } | 636 | } | ||
644 | 637 | | |||
645 | int insertPos = 0; | 638 | int insertPos = 0; | ||
646 | 639 | | |||
▲ Show 20 Lines • Show All 1235 Lines • Show Last 20 Lines |