Commit 0c8f9b87 authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Tasks view no longer resets on everything

parent 3e27867f
Pipeline #92997 passed with stage
in 4 minutes and 23 seconds
......@@ -17,7 +17,7 @@ ListView {
property alias descendantsModel: descendantsModel
property alias expandsByDefault: descendantsModel.expandsByDefault
add: Transition {
/*add: Transition {
// NumberAnimation behaves better than animators here
NumberAnimation {
property: "opacity"
......@@ -26,7 +26,7 @@ ListView {
duration: Kirigami.Units.longDuration
easing.type: Easing.InOutQuad
}
}
}*/
addDisplaced: Transition {
NumberAnimation {
property: "y"
......
......@@ -14,24 +14,19 @@ TodoSortFilterProxyModel::TodoSortFilterProxyModel(QObject *parent)
mRefreshTimer.setSingleShot(true);
auto resetModel = [this] {
auto sortTimer = [this] {
if (!mRefreshTimer.isActive()) {
mRefreshTimer.start(50);
}
};
connect(&mRefreshTimer, &QTimer::timeout, this, [&]() {
beginResetModel();
endResetModel();
sortTodoModel(m_sortColumn, m_sortAscending);
});
connect(m_extraTodoModel, &KExtraColumnsProxyModel::dataChanged, this, resetModel);
connect(m_extraTodoModel, &KExtraColumnsProxyModel::layoutChanged, this, resetModel);
connect(m_extraTodoModel, &KExtraColumnsProxyModel::modelReset, this, resetModel);
connect(m_extraTodoModel, &KExtraColumnsProxyModel::rowsInserted, this, resetModel);
connect(m_extraTodoModel, &KExtraColumnsProxyModel::rowsMoved, this, resetModel);
connect(m_extraTodoModel, &KExtraColumnsProxyModel::rowsRemoved, this, resetModel);
connect(m_extraTodoModel, &KExtraColumnsProxyModel::dataChanged, this, sortTimer);
connect(m_extraTodoModel, &KExtraColumnsProxyModel::rowsInserted, this, sortTimer);
connect(m_extraTodoModel, &KExtraColumnsProxyModel::rowsRemoved, this, sortTimer);
}
bool TodoSortFilterProxyModel::filterAcceptsRow(int row, const QModelIndex &sourceParent) const
......
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