Fixed: recip. entry when contact changed 09/65809/2
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Tue, 12 Apr 2016 14:59:31 +0000 (17:59 +0300)
committerAndrey Klimenko <and.klimenko@samsung.com>
Tue, 12 Apr 2016 15:29:57 +0000 (08:29 -0700)
Change-Id: I921ce8b6f1968356e2a857af72666ab03faff22e
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Conversation/Recipients/Controller/inc/ConvRecipientsPanel.h
src/Conversation/Recipients/Controller/src/ConvRecipientsPanel.cpp

index 14f9071..d322202 100644 (file)
 #include "App.h"
 #include "AppControlUtils.h"
 #include "ContactPicker.h"
+#include "ContactManager.h"
 
 namespace Msg
 {
     class IConvRecipientsPanelListener;
 
     class ConvRecipientsPanel
-        : public ConvRecipientsPanelView,
-          private IContactPickerListener,
-          private IMbeRecipientsListener
+        : public ConvRecipientsPanelView
+        , private IContactPickerListener
+        , private IMbeRecipientsListener
+        , private IContactManagerListener
     {
         public:
             ConvRecipientsPanel(Evas_Object *parent, App &app);
@@ -75,6 +77,9 @@ namespace Msg
             // IContactPickerListener
             virtual void onContactsPicked(const std::list<int> &numberIdList);
 
+            // IContactManagerListener:
+            virtual void onContactChanged();
+
         private:
             App &m_App;
             IConvRecipientsPanelListener *m_pListener;
index ed73e7c..34456ee 100644 (file)
@@ -35,11 +35,13 @@ ConvRecipientsPanel::ConvRecipientsPanel(Evas_Object *parent, App &app)
     m_pMbe->setListener(this);
     m_pMbe->show();
     setMbe(m_pMbe);
+    m_App.getContactManager().addListener(*this);
 }
 
 ConvRecipientsPanel::~ConvRecipientsPanel()
 {
     m_Picker.setListener(nullptr);
+    m_App.getContactManager().removeListener(*this);
 }
 
 void ConvRecipientsPanel::read(Message &msg)
@@ -286,3 +288,10 @@ void ConvRecipientsPanel::onMbeItemClicked(MbeRecipientItem &item)
     if(m_pListener)
         m_pListener->onItemClicked(*this, item);
 }
+
+void ConvRecipientsPanel::onContactChanged()
+{
+    MSG_LOG("");
+    if(!getEntryFocus())
+        updateShortenedRecipients();
+}