From ecb758ab68e0aeab7011e8745d686c13c6710ccd Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Fri, 1 Apr 2016 16:21:18 +0300 Subject: [PATCH] TizenRefApp-6043 Message Displayed in Search Results after Deletion Change-Id: Iab9ea5902a95a6bee64b30223717e14ddc815371 Signed-off-by: Denis Dolzhenko --- src/MsgThread/Controller/inc/ThreadSearchList.h | 7 +++++++ src/MsgThread/Controller/src/ThreadSearchList.cpp | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/MsgThread/Controller/inc/ThreadSearchList.h b/src/MsgThread/Controller/inc/ThreadSearchList.h index fdb82c8..1b0aade 100644 --- a/src/MsgThread/Controller/inc/ThreadSearchList.h +++ b/src/MsgThread/Controller/inc/ThreadSearchList.h @@ -21,6 +21,7 @@ #include "ListView.h" #include "App.h" #include "MsgTypes.h" +#include "MsgStorage.h" #include @@ -33,6 +34,7 @@ namespace Msg , private IListViewListener , private IContactManagerListener , private ISystemSettingsManager + , private IMsgStorageListener { public: ThreadSearchList(Evas_Object *parent, App &app); @@ -53,6 +55,11 @@ namespace Msg // ISystemSettingsManager: virtual void onTimeFormatChanged(); + // IMsgStorageListener: + virtual void onMsgStorageUpdate(const MsgIdList &msgIdList); + virtual void onMsgStorageInsert(const MsgIdList &msgIdList); + virtual void onMsgStorageDelete(const MsgIdList &msgIdList); + void search(); private: diff --git a/src/MsgThread/Controller/src/ThreadSearchList.cpp b/src/MsgThread/Controller/src/ThreadSearchList.cpp index 53091a0..060838a 100644 --- a/src/MsgThread/Controller/src/ThreadSearchList.cpp +++ b/src/MsgThread/Controller/src/ThreadSearchList.cpp @@ -35,6 +35,7 @@ ThreadSearchList::ThreadSearchList(Evas_Object *parent, App &app) ListView::setListener(this); m_App.getContactManager().addListener(*this); m_App.getSysSettingsManager().addListener(*this); + m_App.getMsgEngine().getStorage().addListener(*this); } ThreadSearchList::~ThreadSearchList() @@ -42,6 +43,7 @@ ThreadSearchList::~ThreadSearchList() cancelSearch(); m_App.getContactManager().removeListener(*this); m_App.getSysSettingsManager().removeListener(*this); + m_App.getMsgEngine().getStorage().removeListener(*this); } void ThreadSearchList::setListener(IThreadSearchListListener *l) @@ -133,6 +135,25 @@ void ThreadSearchList::onListItemSelected(ListItem &listItem) void ThreadSearchList::onContactChanged() { + MSG_LOG(""); + search(); +} + +void ThreadSearchList::onMsgStorageUpdate(const MsgIdList &msgIdList) +{ + MSG_LOG(""); + search(); +} + +void ThreadSearchList::onMsgStorageInsert(const MsgIdList &msgIdList) +{ + MSG_LOG(""); + search(); +} + +void ThreadSearchList::onMsgStorageDelete(const MsgIdList &msgIdList) +{ + MSG_LOG(""); search(); } -- 2.7.4