From db711904fa679a761effbc761b2777f358ddc285 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 22 Oct 2012 11:16:36 +0100 Subject: [PATCH] Fix Ride List not refreshing A bug was introduced by the new search/filter update causing the ride list to not get refreshed when rides were imported or deleted. This was due to signals from the source model (sql) not being propagated upstream (groupby) in the standard implementation of qsortfilterproxymodel. This patch fixes that. --- src/RideNavigatorProxy.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/RideNavigatorProxy.h b/src/RideNavigatorProxy.h index 7e4e3c7ca..f39f356c9 100644 --- a/src/RideNavigatorProxy.h +++ b/src/RideNavigatorProxy.h @@ -515,6 +515,13 @@ class SearchFilter : public QSortFilterProxyModel fileIndex = i; } } + + // make sure changes are propogated upstream + connect(model, SIGNAL(modelReset()), this, SIGNAL(modelReset())); + connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SIGNAL(modelReset())); + connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(modelReset())); + connect(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SIGNAL(modelReset())); + connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(modelReset())); } bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const {