From 166f4dab97de35efc27323d55ba1766dd901ebc0 Mon Sep 17 00:00:00 2001
From: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
Date: Wed, 13 Jan 2016 11:51:21 -0500
Subject: [PATCH] RecentModel: improve peopleProxy consistency

The dataChanged is now emitted properly when the number of children
change resulting in the peopleProxy correctly showing children when
there is more than one in cases where it did not before.

Change-Id: I46b9a96c35f812f41f9e7dd4af4e26546b99ffb5
Tuleap: #233
---
 src/recentmodel.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/recentmodel.cpp b/src/recentmodel.cpp
index 6334908b..c689765c 100644
--- a/src/recentmodel.cpp
+++ b/src/recentmodel.cpp
@@ -775,8 +775,8 @@ RecentModelPrivate::insertCallNode(RecentViewNode *parent, RecentViewNode* callN
     // emit dataChanged on parent, since number of children has changed
     emit q_ptr->dataChanged(parentIdx, parentIdx);
 
-    if (callNode->m_Index == 2) {
-        // we went from 1 to 2 calls, emit a dataChanged on the first call so that the PeopleProxy
+    if (parent->m_lChildren.size() > 1) {
+        // emit a dataChanged on the first call so that the PeopleProxy
         // now shows the first call (otherwise it will only show the 2nd +)
         auto firstChild = q_ptr->index(0, 0, parentIdx);
         emit q_ptr->dataChanged(firstChild, firstChild);
-- 
GitLab