TizenRefApp-7694 MsgThread/* codestyle 15/99215/3
authorOleksander Kostenko <o.kostenko@samsung.com>
Tue, 22 Nov 2016 07:23:00 +0000 (09:23 +0200)
committerAndrey Klimenko <and.klimenko@samsung.com>
Tue, 22 Nov 2016 09:42:46 +0000 (01:42 -0800)
Change-Id: Idb298af60bf8d70041539c24b2c27d5bcf360555
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
src/MsgThread/Controller/src/BaseThreadListItem.cpp
src/MsgThread/Controller/src/MsgThread.cpp
src/MsgThread/Controller/src/ThreadList.cpp
src/MsgThread/Controller/src/ThreadListItem.cpp
src/MsgThread/Controller/src/ThreadSearchList.cpp
src/MsgThread/Controller/src/ThreadSearchListItem.cpp
src/MsgThread/View/inc/MsgThreadLayout.h
src/MsgThread/View/src/FloatingButton.cpp
src/MsgThread/View/src/MsgThreadLayout.cpp
src/MsgThread/View/src/MsgThreadSearchPanel.cpp
src/MsgThread/View/src/ThreadListViewItem.cpp

index 2e83e1ee1a32a0ea30989b07388fb6283f19e57d..454d1803107e63d2e1edce29d08dd2b7510c1a66 100644 (file)
@@ -28,12 +28,10 @@ BaseThreadListItem::BaseThreadListItem(App &app)
     , m_ThumbId(m_App.getThumbnailMaker().getThumbId(ThumbnailMaker::SingleThumb))
     , m_RawTime()
 {
-
 }
 
 BaseThreadListItem::~BaseThreadListItem()
 {
-
 }
 
 void BaseThreadListItem::updateMessage(const MsgThreadItem &threadItem)
@@ -49,14 +47,14 @@ void BaseThreadListItem::updateMessage(const std::string &msg)
 void BaseThreadListItem::updateThumbnailAndName(const MsgThreadItem &threadItem, bool decorateName)
 {
     const MsgAddressListRef addressList = m_App.getMsgEngine().getStorage().getAddressList(threadItem.getId());
-    if(addressList)
+    if (addressList)
         updateThumbnailAndName(*addressList, decorateName);
 }
 
 void BaseThreadListItem::updateThumbnailAndName(const MsgAddressList &addressList, bool decorateName)
 {
     int countContact = addressList.getLength();
-    if(countContact <= 0)
+    if (countContact <= 0)
     {
         MSG_LOG_WARN("Msg address list is empty");
         return;
@@ -64,13 +62,11 @@ void BaseThreadListItem::updateThumbnailAndName(const MsgAddressList &addressLis
 
     const MsgAddress &addr = addressList[0];
 
-    if(countContact > 1)
+    if (countContact > 1)
     {
         m_ThumbId = m_App.getThumbnailMaker().getThumbId(ThumbnailMaker::GroupThumb);
         updateName(addr, countContact, decorateName);
-    }
-    else if(countContact == 1)
-    {
+    } else if (countContact == 1) {
         m_ThumbId = m_App.getThumbnailMaker().getThumbId(addr);
         updateName(addr, countContact, decorateName);
     }
@@ -79,7 +75,7 @@ void BaseThreadListItem::updateThumbnailAndName(const MsgAddressList &addressLis
 void BaseThreadListItem::updateName(const MsgAddress &address, int addressesCount, bool decorateName)
 {
     ContactAddressRef contactAddress = m_App.getContactManager().getContactAddress(address.getAddress());
-    if(contactAddress)
+    if (contactAddress)
         updateName(*contactAddress, addressesCount, decorateName);
     else
         updateName(address.getAddress(), addressesCount, decorateName);
@@ -88,7 +84,7 @@ void BaseThreadListItem::updateName(const MsgAddress &address, int addressesCoun
 void BaseThreadListItem::updateName(const ContactAddress &address, int addressesCount, bool decorateName)
 {
     std::string dispName = address.getDispName();
-    if(dispName.empty())
+    if (dispName.empty())
         dispName = address.getAddress();
     updateName(dispName, addressesCount, decorateName);
 }
@@ -97,9 +93,9 @@ void BaseThreadListItem::updateName(const std::string &address, int addressesCou
 {
     m_Name = address;
     --addressesCount;
-    if(addressesCount > 0)
+    if (addressesCount > 0)
         m_Name += " +" + std::to_string(addressesCount);
-    if(decorateName)
+    if (decorateName)
         m_Name = decorateNameText(m_Name);
 }
 
index 3dbf3d5e6997ce8dcd6fd26e929580cab12a6866..bbc730187294c31480962dd13183ed22c9579473 100644 (file)
@@ -55,7 +55,7 @@ MsgThread::~MsgThread()
 
 void MsgThread::prepareSearchPanel()
 {
-    if(!m_pSearchPanel)
+    if (!m_pSearchPanel)
     {
         m_pSearchPanel = new MsgThreadSearchPanel(*m_pLayout);
         m_pSearchPanel->setListener(this);
@@ -65,7 +65,7 @@ void MsgThread::prepareSearchPanel()
 
 void MsgThread::prepareSearchList()
 {
-    if(!m_pSearchList)
+    if (!m_pSearchList)
     {
         m_pSearchList = new ThreadSearchList(*m_pLayout, getApp());
         m_pSearchList->setListener(this);
@@ -76,7 +76,7 @@ void MsgThread::prepareSearchList()
 
 void MsgThread::prepareNoContentLayout()
 {
-    if(!m_pNoContent)
+    if (!m_pNoContent)
     {
         m_pNoContent = new NoContentLayout(*m_pLayout);
         m_pNoContent->show();
@@ -86,7 +86,7 @@ void MsgThread::prepareNoContentLayout()
 
 void MsgThread::prepareThreadList()
 {
-    if(!m_pThreadList)
+    if (!m_pThreadList)
     {
         m_pThreadList = new ThreadList(*m_pLayout, getApp());
         m_pThreadList->setListener(this);
@@ -132,7 +132,7 @@ void MsgThread::navigateToConversation(ThreadId threadId, MsgId msgId, const std
 {
     Conversation *frame = new Conversation(getParent());
     frame->setThreadId(threadId, searchWord.c_str());
-    if(msgId.isValid())
+    if (msgId.isValid())
         frame->navigateTo(msgId);
     else
         frame->navigateToBottom();
@@ -141,14 +141,14 @@ void MsgThread::navigateToConversation(ThreadId threadId, MsgId msgId, const std
 
 void MsgThread::setMode(Mode mode)
 {
-    if(m_Mode == mode)
+    if (m_Mode == mode)
         return;
 
     NaviBar::NaviColorId colorId = mode == SearchMode ? NaviBar::NaviWhiteColorId : NaviBar::NaviBlueColorId;
     getNaviBar().setColor(colorId);
     setNormalMode();
 
-    switch(mode)
+    switch (mode)
     {
         case NormalMode:
             break;
@@ -173,7 +173,7 @@ void MsgThread::setNormalMode()
     MSG_LOG("");
     getNaviBar().clear();
     // Reset previus mode:
-    switch(m_Mode)
+    switch (m_Mode)
     {
         case DeleteMode:
             setDeleteMode(false);
@@ -199,13 +199,13 @@ void MsgThread::setDeleteMode(bool value)
 {
     MSG_LOG("");
 
-    if(value)
+    if (value)
         m_Mode = DeleteMode;
 
     NaviBar &naviBar = getNaviBar();
 
     naviBar.showButton(NaviOkButtonId, value);
-    if(value)
+    if (value)
     {
         m_pLayout->showFloatingButton(false);
         updateSelectItemsTitle();
@@ -221,7 +221,7 @@ void MsgThread::setSearchMode(bool value)
     MSG_LOG("");
 
     getNaviBar().showButton(NaviPrevButtonId, value);
-    if(value)
+    if (value)
     {
         m_pLayout->showFloatingButton(false);
         prepareSearchList();
@@ -232,23 +232,21 @@ void MsgThread::setSearchMode(bool value)
         getNaviBar().showSearch();
         m_pNoContent->setText(msgt("IDS_MSG_NPBODY_NO_RESULTS_FOUND_ABB"));
         m_pNoContent->setHelpText();
-    }
-    else
-    {
-        if(m_pSearchList)
+    } else {
+        if (m_pSearchList)
             m_pSearchList->cancelSearch();
         getNaviBar().hideSearch();
     }
 
     update();
-    if(m_pSearchPanel)
+    if (m_pSearchPanel)
         m_pSearchPanel->setEntryFocus(value);
 }
 
 void MsgThread::update()
 {
     bool searchEnabled = m_Mode == SearchMode;
-    if(searchEnabled)
+    if (searchEnabled)
     {
         bool showSearch = !m_pSearchList->isEmpty();
         bool showThread = !showSearch && !m_pThreadList->isEmpty() && m_pSearchList->getSearchWord().empty();
@@ -258,9 +256,7 @@ void MsgThread::update()
         m_pLayout->showThreadList(showThread);
         m_pLayout->showNoContent(showNoContent);
 
-    }
-    else
-    {
+    } else {
         bool showThread = !m_pThreadList->isEmpty();
         m_pLayout->showThreadList(showThread);
         m_pLayout->showNoContent(!showThread);
@@ -271,10 +267,10 @@ void MsgThread::update()
 
 void MsgThread::updateSelectItemsTitle()
 {
-    if(m_Mode == DeleteMode)
+    if (m_Mode == DeleteMode)
     {
         int checked = m_pThreadList->getThreadsCheckedCount();
-        if(checked > 0)
+        if (checked > 0)
             getNaviBar().setTitle(msgArgs("IDS_MSG_HEADER_PD_SELECTED_ABB3", checked));
         else
             getNaviBar().setTitle(msgt("IDS_MSG_HEADER_SELECT_ITEMS_ABB3"));
@@ -283,14 +279,14 @@ void MsgThread::updateSelectItemsTitle()
 
 void MsgThread::search(const std::string &searchWord)
 {
-    if(m_Mode == SearchMode && m_pSearchList)
+    if (m_Mode == SearchMode && m_pSearchList)
         m_pSearchList->requestSearch(searchWord);
 }
 
 void MsgThread::onHwBackButtonClicked()
 {
     MSG_LOG("");
-    if(m_Mode == SearchMode || m_Mode == DeleteMode)
+    if (m_Mode == SearchMode || m_Mode == DeleteMode)
         setMode(NormalMode);
     else
         pop();
@@ -299,7 +295,7 @@ void MsgThread::onHwBackButtonClicked()
 void MsgThread::onHwMoreButtonClicked()
 {
     MSG_LOG("");
-    if(m_Mode == NormalMode)
+    if (m_Mode == NormalMode)
         showMainPopup();
 }
 
@@ -327,7 +323,7 @@ void MsgThread::onSearchItemPressed(PopupListItem &item)
 void MsgThread::onButtonClicked(NaviFrameItem &item, NaviButtonId buttonId)
 {
     MSG_LOG("NaviButton id:", buttonId);
-    if(buttonId == NaviOkButtonId)
+    if (buttonId == NaviOkButtonId)
         m_pThreadList->deleteSelectedItems();
     setMode(NormalMode);
 }
@@ -366,7 +362,7 @@ void MsgThread::onSearchListItemSelected(MsgId id, const std::string &searchWord
 {
     MSG_LOG("");
     MessageRef msg = getMsgEngine().getStorage().getMessage(id);
-    if(msg)
+    if (msg)
         navigateToConversation(msg->getThreadId(), id, searchWord);
 }
 
index f60b6a6a7f09f12b9bdb2b4ed8725f3147dcf20d..dd9775e58dcaf5efb3f61a6f07ac0d2a496db5a4 100644 (file)
@@ -83,9 +83,9 @@ bool ThreadList::isDeleteModeEnabled() const
 void ThreadList::deleteSelectedItems()
 {
     auto items = getItems<ThreadListItem>();
-    for(ThreadListItem *it : items)
+    for (ThreadListItem *it : items)
     {
-        if(it->getCheckedState())
+        if (it->getCheckedState())
             m_App.getMsgEngine().getStorage().deleteThread(it->getThreadId());
     }
 }
@@ -94,9 +94,9 @@ int ThreadList::getThreadsCheckedCount() const
 {
     auto items = getItems<ThreadListItem>();
     int count = 0;
-    for(ThreadListItem *item : items)
+    for (ThreadListItem *item : items)
     {
-        if(item->isCheckable() && item->getCheckedState())
+        if (item->isCheckable() && item->getCheckedState())
             ++count;
     }
     return count;
@@ -106,20 +106,18 @@ void ThreadList::showSelectAllItem(bool show, bool resetCheck)
 {
     SelectAllListItem *item = dynamic_cast<SelectAllListItem*>(getFirstItem());
 
-    if(show)
+    if (show)
     {
-        if(!item)
+        if (!item)
         {
             item = new SelectAllListItem;
             prependItem(*item);
         }
 
-        if(item && resetCheck)
+        if (item && resetCheck)
             item->setCheckedState(false, true);
-    }
-    else
-    {
-        if(item)
+    } else {
+        if (item)
             item->destroy();
     }
 }
@@ -128,9 +126,9 @@ bool ThreadList::isAllThreadListItemChecked() const
 {
     // Simple impl. but not fast:
     auto items = getItems<ThreadListItem>();
-    for(ThreadListItem *item : items)
+    for (ThreadListItem *item : items)
     {
-        if(item->isCheckable() && !item->getCheckedState())
+        if (item->isCheckable() && !item->getCheckedState())
             return false;
     }
     return true;
@@ -138,12 +136,12 @@ bool ThreadList::isAllThreadListItemChecked() const
 
 void ThreadList::updateSelectAllItem()
 {
-    if(!m_DeleteMode)
+    if (!m_DeleteMode)
         return;
 
     bool allChecked = isAllThreadListItemChecked();
     SelectAllListItem *selectAllItem = dynamic_cast<SelectAllListItem*>(getFirstItem());
-    if(selectAllItem)
+    if (selectAllItem)
         selectAllItem->setCheckedState(allChecked, true);
 }
 
@@ -151,7 +149,7 @@ void ThreadList::checkHandler(SelectAllListItem &item)
 {
     bool checked = item.getCheckedState();
     checkAllItems(checked);
-    if(m_pListener)
+    if (m_pListener)
         m_pListener->onThreadListItemChecked();
 }
 
@@ -160,16 +158,16 @@ void ThreadList::checkHandler(ThreadListItem &item)
     ThreadId threadId = item.getThreadId();
     MSG_LOG("Checked (id : state) = ", threadId, ":", item.getCheckedState());
     updateSelectAllItem();
-    if(m_pListener)
+    if (m_pListener)
         m_pListener->onThreadListItemChecked();
 }
 
 int ThreadList::cmpFunc(const ListItem &item1, const ListItem &item2)
 {
-    if(isSelectAll(&item1))
+    if (isSelectAll(&item1))
         return 0;
 
-    if(isSelectAll(&item2))
+    if (isSelectAll(&item2))
         return 1;
 
     auto &threadItem1 = static_cast<const ThreadListItem&>(item1);
@@ -180,7 +178,7 @@ int ThreadList::cmpFunc(const ListItem &item1, const ListItem &item2)
 void ThreadList::insertItem(ThreadId id)
 {
     MsgThreadItemRef threadItem = m_App.getMsgEngine().getStorage().getThread(id);
-    if(threadItem)
+    if (threadItem)
     {
         auto newItem = new ThreadListItem(*threadItem, m_App);
         ListView::sortedInsertItem(*newItem);
@@ -191,9 +189,9 @@ void ThreadList::insertItem(ThreadId id)
 ThreadListItem *ThreadList::getItem(ThreadId id) const
 {
     auto items = ListView::getItems<ThreadListItem>();
-    for(ThreadListItem *item : items)
+    for (ThreadListItem *item : items)
     {
-        if(item->getThreadId() == id)
+        if (item->getThreadId() == id)
             return item;
     }
     return nullptr;
@@ -202,12 +200,12 @@ ThreadListItem *ThreadList::getItem(ThreadId id) const
 void ThreadList::fillList()
 {
     MsgThreadListRef msgThreadList = m_App.getMsgEngine().getStorage().getThreadList();
-    if(!msgThreadList)
+    if (!msgThreadList)
         return;
 
     int length = msgThreadList->getLength();
 
-    for(int i = 0; i < length; ++i)
+    for (int i = 0; i < length; ++i)
     {
         const MsgThreadItem &msgThreadItem = msgThreadList->at(i);
         ListView::appendItem(*new ThreadListItem(msgThreadItem, m_App));
@@ -217,12 +215,12 @@ void ThreadList::fillList()
 void ThreadList::deleteItems()
 {
     MsgThreadListRef msgThreadList = m_App.getMsgEngine().getStorage().getThreadList();
-    if(!msgThreadList)
+    if (!msgThreadList)
         return;
 
     std::set<ThreadId> threadIdSet;
     int length = msgThreadList->getLength();
-    for(int i = 0; i < length; ++i)
+    for (int i = 0; i < length; ++i)
     {
         const MsgThreadItem &msgThreadItem = msgThreadList->at(i);
         threadIdSet.insert(msgThreadItem.getId());
@@ -230,9 +228,9 @@ void ThreadList::deleteItems()
 
     auto items = ListView::getItems<ThreadListItem>();
 
-    for(ThreadListItem *item : items)
+    for (ThreadListItem *item : items)
     {
-        if(threadIdSet.count(item->getThreadId()) == 0)
+        if (threadIdSet.count(item->getThreadId()) == 0)
             ListView::deleteItem(*item);
     }
 
@@ -249,9 +247,9 @@ void ThreadList::updateItems(const MsgIdList &idList)
     auto threadIdSet = getThreadIdSet(idList);
     auto threadItems = getItems<ThreadListItem>();
 
-    for(ThreadListItem *item: threadItems)
+    for (ThreadListItem *item: threadItems)
     {
-        if(threadIdSet.count(item->getThreadId()))
+        if (threadIdSet.count(item->getThreadId()))
             updateItem(*item);
     }
 }
@@ -259,7 +257,7 @@ void ThreadList::updateItems(const MsgIdList &idList)
 void ThreadList::updateItems()
 {
     auto items = getItems<ThreadListItem>();
-    for(ThreadListItem *item: items)
+    for (ThreadListItem *item: items)
     {
         updateItem(*item);
     }
@@ -268,7 +266,7 @@ void ThreadList::updateItems()
 void ThreadList::updateItem(ThreadListItem &item)
 {
     MsgThreadItemRef msgThread = m_App.getMsgEngine().getStorage().getThread(item.getThreadId());
-    if(!msgThread)
+    if (!msgThread)
     {
         MSG_LOG_ERROR("msgThread is null");
         return;
@@ -278,7 +276,7 @@ void ThreadList::updateItem(ThreadListItem &item)
     ThreadListItem *prev = getPrevItem<ThreadListItem>(item);
     time_t threadTime = msgThread->getTime();
 
-    if((next && threadTime < next->getRawTime()) ||
+    if ((next && threadTime < next->getRawTime()) ||
        (prev && threadTime > prev->getRawTime()))
     {
         auto newItem = new ThreadListItem(*msgThread, m_App);
@@ -286,9 +284,7 @@ void ThreadList::updateItem(ThreadListItem &item)
         item.destroy();
         ListView::sortedInsertItem(*newItem);
         navigateTo(*newItem);
-    }
-    else
-    {
+    } else {
         item.update(*msgThread, true);
         navigateTo(item);
     }
@@ -297,10 +293,10 @@ void ThreadList::updateItem(ThreadListItem &item)
 std::set<ThreadId> ThreadList::getThreadIdSet(const MsgIdList &idList)
 {
     std::set<ThreadId> res;
-    for(MsgId msgId : idList)
+    for (MsgId msgId : idList)
     {
         ThreadId threadId = m_App.getMsgEngine().getStorage().getThreadId(msgId);
-        if(threadId.isValid())
+        if (threadId.isValid())
             res.insert(threadId);
     }
     return res;
@@ -310,16 +306,16 @@ void ThreadList::onListItemSelected(ListItem &listItem)
 {
     MSG_LOG("");
     ThreadListItem *it = dynamic_cast<ThreadListItem*>(&listItem);
-    if(it && m_pListener)
+    if (it && m_pListener)
         m_pListener->onListItemSelected(it->getThreadId());
 }
 
 void ThreadList::onListItemChecked(ListItem &listItem)
 {
     MSG_LOG("");
-    if(ThreadListItem *it = dynamic_cast<ThreadListItem*>(&listItem))
+    if (ThreadListItem *it = dynamic_cast<ThreadListItem*>(&listItem))
         checkHandler(*it);
-    else if(SelectAllListItem *it = isSelectAll(&listItem))
+    else if (SelectAllListItem *it = isSelectAll(&listItem))
         checkHandler(*it);
 }
 
@@ -327,7 +323,7 @@ void ThreadList::onMsgStorageThreadUpdate(const ThreadId &threadId)
 {
     MSG_LOG("");
     auto* item = getItem(threadId);
-    if(item)
+    if (item)
         updateItem(*item);
 }
 
@@ -336,7 +332,7 @@ void ThreadList::onMsgStorageThreadInsert(const ThreadId &threadId)
     MSG_LOG("");
     insertItem(threadId);
     updateSelectAllItem();
-    if(m_pListener)
+    if (m_pListener)
         m_pListener->onThreadListChanged();
 }
 
@@ -344,13 +340,13 @@ void ThreadList::onMsgStorageThreadDelete(const ThreadId &threadId)
 {
     MSG_LOG("");
     auto* thread = getItem(threadId);
-    if(thread)
+    if (thread)
     {
         ListView::deleteItem(*thread);
         updateSelectAllItem();
     }
 
-    if(m_pListener)
+    if (m_pListener)
         m_pListener->onThreadListChanged();
 }
 
@@ -364,7 +360,7 @@ void ThreadList::onTimeFormatChanged()
 {
     MSG_LOG("");
     auto items = ListView::getItems<ThreadListItem>();
-    for(ThreadListItem *item : items)
+    for (ThreadListItem *item : items)
     {
         item->updateTime();
     }
index 1411e74df60ab770a019d9ed775bf63b130f628b..f626eb2dc1cc9aaabe03ee9c6dbc92b2828d12ef 100644 (file)
@@ -60,30 +60,24 @@ void ThreadListItem::update(const MsgThreadItem &threadItem, bool updateUi)
     State state = NormalState;
 
     MsgConversationListRef convList = m_App.getMsgEngine().getStorage().getConversationList(m_ThreadId);
-    if(convList && convList->getLength() > 0)
+    if (convList && convList->getLength() > 0)
     {
         MsgConversationItem &item = convList->at(convList->getLength() - 1);
 
         Message::NetworkStatus status = item.getNetworkStatus();
-        if(status == Message::NS_Sending)
+        if (status == Message::NS_Sending)
         {
             state = StatusState;
             m_Status = decorateSendingText(msg("IDS_MSG_BODY_SENDING_ING_M_STATUS_ABB"));
-        }
-        else if(status == Message::NS_Send_Fail)
-        {
+        } else if (status == Message::NS_Send_Fail) {
             state = StatusState;
             m_Status = decorateFailedText(msg("IDS_MSG_BODY_FAILED_M_STATUS_ABB2"));
-        }
-        else if(item.isDraft())
-        {
+        } else if (item.isDraft()) {
             state = StatusState;
             m_Status = decorateDraftText(msg("IDS_MSG_BODY_DRAFT_M_STATUS_ABB"));
-        }
-        else if(!item.isRead() && item.getDirection() == Message::MD_Received)
-        {
+        } else if (!item.isRead() && item.getDirection() == Message::MD_Received) {
             int count = threadItem.getUnreadCount();
-            if(count > 0)
+            if (count > 0)
             {
                 state = IconState;
                 m_UnreadCount = std::to_string(count);
@@ -96,7 +90,7 @@ void ThreadListItem::update(const MsgThreadItem &threadItem, bool updateUi)
     updateThumbnailAndName(threadItem, true);
     updateTime(threadItem.getTime());
 
-    if(updateUi)
+    if (updateUi)
         ListItem::update();
 }
 
index 8ea5968bfabc534d9450ac802635e8e4cc0453e9..391bb6a2954ea332dafef6eb7ce1a430c8523fcb 100644 (file)
@@ -54,7 +54,7 @@ void ThreadSearchList::setListener(IThreadSearchListListener *l)
 void ThreadSearchList::requestSearch(const std::string &searchWord)
 {
     m_SearchWord = searchWord;
-    if(!m_pIdler)
+    if (!m_pIdler)
     {
         m_pIdler = ecore_idler_add
         (
@@ -65,14 +65,13 @@ void ThreadSearchList::requestSearch(const std::string &searchWord)
                 self->search();
                 return false; // Delete idler
             },
-            this
-        );
+            this);
     }
 }
 
 void ThreadSearchList::cancelSearch()
 {
-    if(m_pIdler)
+    if (m_pIdler)
     {
         ecore_idler_del(m_pIdler);
         m_pIdler = nullptr;
@@ -89,16 +88,16 @@ void ThreadSearchList::search()
     MSG_LOG("Search word: ", m_SearchWord);
     ListView::clear();
 
-    if(!m_SearchWord.empty())
+    if (!m_SearchWord.empty())
     {
         MsgStorage &msgSotrage = m_App.getMsgEngine().getStorage();
 
         // Thread:
         MsgThreadListRef threadList = msgSotrage.searchThread(m_SearchWord);
-        if(threadList)
+        if (threadList)
         {
             int length = threadList->getLength();
-            for(int i = 0; i < length; ++i)
+            for (int i = 0; i < length; ++i)
             {
                 const MsgThreadItem &threadItem = threadList->at(i);
                 ListView::appendItem(*new ThreadSearchListItem(m_App, threadItem, m_SearchWord));
@@ -107,10 +106,10 @@ void ThreadSearchList::search()
 
         // Message:
         MessageListRef msgList = msgSotrage.searchMessage(m_SearchWord);
-        if(msgList)
+        if (msgList)
         {
             int length = msgList->getLength();
-            for(int i = 0; i < length; ++i)
+            for (int i = 0; i < length; ++i)
             {
                 const Message &msg = msgList->at(i);
                 ListView::appendItem(*new MsgSearchListItem(m_App, msg, m_SearchWord));
@@ -118,14 +117,14 @@ void ThreadSearchList::search()
         }
     }
 
-    if(m_pListener)
+    if (m_pListener)
         m_pListener->onSearchListChanged();
 }
 
 void ThreadSearchList::updateTime()
 {
     auto items = ListView::getItems<BaseThreadListItem>();
-    for(BaseThreadListItem *item : items)
+    for (BaseThreadListItem *item : items)
     {
         item->updateTime();
     }
@@ -135,11 +134,11 @@ void ThreadSearchList::updateTime()
 
 void ThreadSearchList::onListItemSelected(ListItem &listItem)
 {
-    if(m_pListener)
+    if (m_pListener)
     {
-        if(auto it = dynamic_cast<MsgSearchListItem*>(&listItem))
+        if (auto it = dynamic_cast<MsgSearchListItem*>(&listItem))
             m_pListener->onSearchListItemSelected(it->getMsgId(), m_SearchWord);
-        else if(auto it = dynamic_cast<ThreadSearchListItem*>(&listItem))
+        else if (auto it = dynamic_cast<ThreadSearchListItem*>(&listItem))
             m_pListener->onSearchListItemSelected(it->getThreadId());
     }
 }
index d80d463801f9a09cfb5b2335b00e004c0beaa6dc..2533ed5fac24a9dcd493942ba695a71c6c640a18 100644 (file)
@@ -27,7 +27,6 @@ ThreadSearchListItem::ThreadSearchListItem(App &app, const MsgThreadItem &item,
 
 ThreadSearchListItem::~ThreadSearchListItem()
 {
-
 }
 
 ThreadId ThreadSearchListItem::getThreadId() const
index 6c4b04a75ef9bdb94a12a886eb759aeb19cfe623..7f526eaa27cee8a5d2948d4a28043ef79bac2097 100644 (file)
@@ -41,7 +41,6 @@ namespace Msg
 
         private:
             Evas_Object *m_pLayout;
-
     };
 }
 
index 7702122be51f13bfb8310b7770daaebe8f44812a..d1fc4316bdbfa7c43fa4c47cad4a1be10f1556d7 100644 (file)
@@ -47,7 +47,7 @@ void FloatingButton::setListener(IFloatingButtonListener* pListener)
 
 void FloatingButton::pressed(Evas_Object *obj, void *event_info)
 {
-    if(m_pListener)
+    if (m_pListener)
     {
         m_pListener->onFloatingButtonPressed();
     }
index 3d9527d43c531d3b2702a5f247d97e853dda4d09..04181b4d94fbbed15683c3eb6fe4571aeff6c2c9 100644 (file)
@@ -28,7 +28,6 @@ MsgThreadLayout::MsgThreadLayout(Evas_Object *parent)
 
 MsgThreadLayout::~MsgThreadLayout()
 {
-
 }
 
 void MsgThreadLayout::create(Evas_Object *parent)
index ca6803905f0055f7cd44820e9a8b8aaf29707fbf..7f313707596a7b18901d2dab05f0bc40a584c75a 100644 (file)
@@ -35,7 +35,7 @@ MsgThreadSearchPanel::MsgThreadSearchPanel(Evas_Object *parent)
 
 MsgThreadSearchPanel::~MsgThreadSearchPanel()
 {
-    if(m_pEntryJob)
+    if (m_pEntryJob)
     {
         ecore_job_del(m_pEntryJob);
         m_pEntryJob = nullptr;
@@ -111,10 +111,10 @@ std::string MsgThreadSearchPanel::getEntryText() const
     std::string res;
     const char *plainText = elm_entry_entry_get(m_pEntry);
 
-    if(plainText)
+    if (plainText)
     {
         char *text = elm_entry_markup_to_utf8(elm_entry_entry_get(m_pEntry));
-        if(text)
+        if (text)
         {
             res.assign(text);
             free(text);
@@ -133,7 +133,7 @@ void MsgThreadSearchPanel::onPostponedEntryFocus(void *data)
 void MsgThreadSearchPanel::setEntryFocus(bool focus)
 {
     m_EntryFocus = focus;
-    if(!m_pEntryJob)
+    if (!m_pEntryJob)
         m_pEntryJob = ecore_job_add(onPostponedEntryFocus, this);
 }
 
@@ -151,7 +151,7 @@ void MsgThreadSearchPanel::showClearButton(bool visible)
 void MsgThreadSearchPanel::onEntryChanged(Evas_Object *obj, void *eventInfo)
 {
     showClearButton(!isEmpty());
-    if(m_pListener)
+    if (m_pListener)
         m_pListener->onEntryChanged(*this);
 }
 
@@ -162,5 +162,4 @@ void MsgThreadSearchPanel::onClearButtonClicked(Evas_Object *obj, void *eventInf
 
 void MsgThreadSearchPanel::onKeyDown(Evas_Object *obj, void *eventInfo)
 {
-
 }
index bc9f28ef4d8104def3700096120f8606a5271fdc..d6277ef6dd676ad472bf218e11ee78b92ffd8abb 100644 (file)
@@ -57,21 +57,15 @@ ThreadListViewItem::~ThreadListViewItem()
 
 std::string ThreadListViewItem::getText(ListItem &item, const char *part)
 {
-    if(!strcmp(part, messagePart))
+    if (!strcmp(part, messagePart))
     {
         return getMessage();
-    }
-    else if(!strcmp(part, namePart))
-    {
+    } else if (!strcmp(part, namePart)) {
         return getName();
-    }
-    else if(!strcmp(part, timePart))
-    {
+    } else if (!strcmp(part, timePart)) {
         return getTime();
-    }
-    else if(!strcmp(part, statusPart))
-    {
-        if(m_State == StatusState)
+    } else if (!strcmp(part, statusPart)) {
+        if (m_State == StatusState)
             return getStatus();
     }
 
@@ -82,13 +76,11 @@ Evas_Object *ThreadListViewItem::getContent(ListItem &item, const char *part)
 {
     Evas_Object *content = nullptr;
 
-    if(!strcmp(part, thumbnailPart))
+    if (!strcmp(part, thumbnailPart))
     {
         content = getThumbnail();
-    }
-    else if(!strcmp(part, iconPart))
-    {
-        if(m_State == IconState)
+    } else if (!strcmp(part, iconPart)) {
+        if (m_State == IconState)
         {
             content = getIcon();
         }
@@ -105,7 +97,7 @@ const char *ThreadListViewItem::getCheckPart(ListItem &item)
 void ThreadListViewItem::setState(State state, bool updateUi)
 {
     m_State = state;
-    if(updateUi)
+    if (updateUi)
     {
         updateFields(iconPart, ELM_GENLIST_ITEM_FIELD_CONTENT);
         updateFields(statusPart, ELM_GENLIST_ITEM_FIELD_TEXT);
@@ -119,7 +111,7 @@ ThreadListViewItem::State ThreadListViewItem::getState() const
 
 Evas_Object *ThreadListViewItem::makeUnreadIcon(const std::string &text) const
 {
-    if(text.empty())
+    if (text.empty())
         return nullptr;
     Evas_Object *icon = View::addLayout(*getOwner(), ICONS_EDJ_PATH, "badge");
     elm_object_part_text_set(icon,  "elm.text.count", text.c_str());
@@ -172,7 +164,7 @@ std::string ThreadListViewItem::decorateDraftText(const std::string &text) const
 
 void ThreadListViewItem::resetCheckMode(ListView &listView)
 {
-    for(ListItem *item: listView.getRealizedItems())
+    for (ListItem *item: listView.getRealizedItems())
     {
         item->emitSignal("elm,state,reset_check", "elm");
     }