From 09d7cd3a650eb4fc026f7433c882e9ec4a48d925 Mon Sep 17 00:00:00 2001
From: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
Date: Tue, 12 Jan 2016 14:57:58 -0500
Subject: [PATCH] RecentModel: do not clear selection model

If the CallModel has an invalid index selected, do not clear the
selection in the RecentModel.

Change-Id: Ide91bf55d885f06746c9baf7c64fe07978f4dd65
Tuleap: #203
---
 src/recentmodel.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/recentmodel.cpp b/src/recentmodel.cpp
index 8a5bc269..6334908b 100644
--- a/src/recentmodel.cpp
+++ b/src/recentmodel.cpp
@@ -1057,9 +1057,12 @@ RecentModelPrivate::slotCurrentCallChanged(const QModelIndex &current, const QMo
             q_ptr->selectionModel()->setCurrentIndex(callIdx, QItemSelectionModel::ClearAndSelect);
         else
             q_ptr->selectionModel()->setCurrentIndex(callIdx.parent(), QItemSelectionModel::ClearAndSelect);
-    } else {
-        q_ptr->selectionModel()->clearCurrentIndex();
     }
+    /* do not update the selection in the RecentModel if no calls selected in the CallModel;
+     * eg: if a Call was selected in the RecentModel, when its removed, the seleciton will
+     *     change automatically, so no action is needed;
+     *     if a Person was selected and the Call is over, we still want the Person to be selected;
+     */
 }
 
 ///Filter out every data relevant to a person
-- 
GitLab