From c915e243907c2ec466b7a84c80f7c7050dc2fe3c Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> Date: Mon, 8 Sep 2014 21:47:42 +0200 Subject: [PATCH] [ #54772 ] Limit the number of PlaceHolderContact to 1 per UID --- src/contactmodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/contactmodel.cpp b/src/contactmodel.cpp index 1960a776..4bb1f3a0 100644 --- a/src/contactmodel.cpp +++ b/src/contactmodel.cpp @@ -177,6 +177,11 @@ Contact* ContactModel::getPlaceHolder(const QByteArray& uid ) return ct; } + //Do not re-create if it already exist + ct = m_hPlaceholders[uid]; + if (ct) + return ct; + ContactPlaceHolder* ct2 = new ContactPlaceHolder(uid); m_hPlaceholders[ct2->uid()] = ct2; -- GitLab