From efcf9c4307aa46c72b73a9c2dcb107af27a00581 Mon Sep 17 00:00:00 2001
From: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
Date: Wed, 26 Apr 2017 10:50:16 -0400
Subject: [PATCH] re-filter PeopleProxy on selected account change

Since the filterAcceptsRow filtering depends on the account
selection we should automatically re-filter when it changes; the
clients shouldn't be responsible for this.

Change-Id: I94dce4eaa5fe77aec1cfa4efa5a6fbc75dce7584
---
 src/recentmodel.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/recentmodel.cpp b/src/recentmodel.cpp
index c9fba445..a5b92f0e 100644
--- a/src/recentmodel.cpp
+++ b/src/recentmodel.cpp
@@ -1140,6 +1140,11 @@ RecentModel::peopleProxy() const
 PeopleProxy::PeopleProxy(RecentModel* sourceModel)
 {
     setSourceModel(sourceModel);
+
+    /* since the filterAcceptsRow depends on the selected account, we need to re-run the filtering
+     * when the selected account changes automatically */
+    connect( AvailableAccountModel::instance().selectionModel(),
+        &QItemSelectionModel::currentChanged, [this]() {this->invalidateFilter();});
 }
 
 bool
-- 
GitLab