From 6444e8f215471e9c9bc2d8147ecf07a1db777414 Mon Sep 17 00:00:00 2001 From: Oleksander Kostenko Date: Tue, 22 Nov 2016 09:23:00 +0200 Subject: [PATCH] TizenRefApp-7694 MsgThread/* codestyle Change-Id: Idb298af60bf8d70041539c24b2c27d5bcf360555 Signed-off-by: Oleksander Kostenko --- .../Controller/src/BaseThreadListItem.cpp | 20 ++--- src/MsgThread/Controller/src/MsgThread.cpp | 50 +++++------ src/MsgThread/Controller/src/ThreadList.cpp | 88 +++++++++---------- .../Controller/src/ThreadListItem.cpp | 20 ++--- .../Controller/src/ThreadSearchList.cpp | 27 +++--- .../Controller/src/ThreadSearchListItem.cpp | 1 - src/MsgThread/View/inc/MsgThreadLayout.h | 1 - src/MsgThread/View/src/FloatingButton.cpp | 2 +- src/MsgThread/View/src/MsgThreadLayout.cpp | 1 - .../View/src/MsgThreadSearchPanel.cpp | 11 ++- src/MsgThread/View/src/ThreadListViewItem.cpp | 30 +++---- 11 files changed, 110 insertions(+), 141 deletions(-) diff --git a/src/MsgThread/Controller/src/BaseThreadListItem.cpp b/src/MsgThread/Controller/src/BaseThreadListItem.cpp index 2e83e1ee..454d1803 100644 --- a/src/MsgThread/Controller/src/BaseThreadListItem.cpp +++ b/src/MsgThread/Controller/src/BaseThreadListItem.cpp @@ -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); } diff --git a/src/MsgThread/Controller/src/MsgThread.cpp b/src/MsgThread/Controller/src/MsgThread.cpp index 3dbf3d5e..bbc73018 100644 --- a/src/MsgThread/Controller/src/MsgThread.cpp +++ b/src/MsgThread/Controller/src/MsgThread.cpp @@ -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); } diff --git a/src/MsgThread/Controller/src/ThreadList.cpp b/src/MsgThread/Controller/src/ThreadList.cpp index f60b6a6a..dd9775e5 100644 --- a/src/MsgThread/Controller/src/ThreadList.cpp +++ b/src/MsgThread/Controller/src/ThreadList.cpp @@ -83,9 +83,9 @@ bool ThreadList::isDeleteModeEnabled() const void ThreadList::deleteSelectedItems() { auto items = getItems(); - 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(); 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(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(); - 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(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(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(); - 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 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(); - 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(); - 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(); - 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(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 ThreadList::getThreadIdSet(const MsgIdList &idList) { std::set 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(&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(&listItem)) + if (ThreadListItem *it = dynamic_cast(&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(); - for(ThreadListItem *item : items) + for (ThreadListItem *item : items) { item->updateTime(); } diff --git a/src/MsgThread/Controller/src/ThreadListItem.cpp b/src/MsgThread/Controller/src/ThreadListItem.cpp index 1411e74d..f626eb2d 100644 --- a/src/MsgThread/Controller/src/ThreadListItem.cpp +++ b/src/MsgThread/Controller/src/ThreadListItem.cpp @@ -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(); } diff --git a/src/MsgThread/Controller/src/ThreadSearchList.cpp b/src/MsgThread/Controller/src/ThreadSearchList.cpp index 8ea5968b..391bb6a2 100644 --- a/src/MsgThread/Controller/src/ThreadSearchList.cpp +++ b/src/MsgThread/Controller/src/ThreadSearchList.cpp @@ -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(); - 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(&listItem)) + if (auto it = dynamic_cast(&listItem)) m_pListener->onSearchListItemSelected(it->getMsgId(), m_SearchWord); - else if(auto it = dynamic_cast(&listItem)) + else if (auto it = dynamic_cast(&listItem)) m_pListener->onSearchListItemSelected(it->getThreadId()); } } diff --git a/src/MsgThread/Controller/src/ThreadSearchListItem.cpp b/src/MsgThread/Controller/src/ThreadSearchListItem.cpp index d80d4638..2533ed5f 100644 --- a/src/MsgThread/Controller/src/ThreadSearchListItem.cpp +++ b/src/MsgThread/Controller/src/ThreadSearchListItem.cpp @@ -27,7 +27,6 @@ ThreadSearchListItem::ThreadSearchListItem(App &app, const MsgThreadItem &item, ThreadSearchListItem::~ThreadSearchListItem() { - } ThreadId ThreadSearchListItem::getThreadId() const diff --git a/src/MsgThread/View/inc/MsgThreadLayout.h b/src/MsgThread/View/inc/MsgThreadLayout.h index 6c4b04a7..7f526eaa 100644 --- a/src/MsgThread/View/inc/MsgThreadLayout.h +++ b/src/MsgThread/View/inc/MsgThreadLayout.h @@ -41,7 +41,6 @@ namespace Msg private: Evas_Object *m_pLayout; - }; } diff --git a/src/MsgThread/View/src/FloatingButton.cpp b/src/MsgThread/View/src/FloatingButton.cpp index 7702122b..d1fc4316 100644 --- a/src/MsgThread/View/src/FloatingButton.cpp +++ b/src/MsgThread/View/src/FloatingButton.cpp @@ -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(); } diff --git a/src/MsgThread/View/src/MsgThreadLayout.cpp b/src/MsgThread/View/src/MsgThreadLayout.cpp index 3d9527d4..04181b4d 100644 --- a/src/MsgThread/View/src/MsgThreadLayout.cpp +++ b/src/MsgThread/View/src/MsgThreadLayout.cpp @@ -28,7 +28,6 @@ MsgThreadLayout::MsgThreadLayout(Evas_Object *parent) MsgThreadLayout::~MsgThreadLayout() { - } void MsgThreadLayout::create(Evas_Object *parent) diff --git a/src/MsgThread/View/src/MsgThreadSearchPanel.cpp b/src/MsgThread/View/src/MsgThreadSearchPanel.cpp index ca680390..7f313707 100644 --- a/src/MsgThread/View/src/MsgThreadSearchPanel.cpp +++ b/src/MsgThread/View/src/MsgThreadSearchPanel.cpp @@ -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) { - } diff --git a/src/MsgThread/View/src/ThreadListViewItem.cpp b/src/MsgThread/View/src/ThreadListViewItem.cpp index bc9f28ef..d6277ef6 100644 --- a/src/MsgThread/View/src/ThreadListViewItem.cpp +++ b/src/MsgThread/View/src/ThreadListViewItem.cpp @@ -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"); } -- 2.34.1