Fix prevent issue: 48307 Operands don't affect result , 48279 Unchecked return value.
authorSeungWon Lee <lsw2000.lee@samsung.com>
Thu, 4 Apr 2013 07:35:16 +0000 (16:35 +0900)
committerSeungWon Lee <lsw2000.lee@samsung.com>
Thu, 4 Apr 2013 07:35:16 +0000 (16:35 +0900)
Change-Id: Iff0e0915892b99bc6869330f251218392793e4e0
Signed-off-by: SeungWon Lee <lsw2000.lee@samsung.com>
src/core/FShell_NotificationManagerImpl.cpp

index 89c4fad..2f4e6d4 100644 (file)
@@ -701,7 +701,6 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                                for (int i = 0; i < itemCount; i++)
                                {
                                        const String* pThumbnailPath = static_cast<const String*>(pThumbnailList->GetAt(i));
-                                       // TODO: check pThumbnailPath
                                        std::unique_ptr<char[]> filePath(_StringConverter::CopyToCharArrayN(*pThumbnailPath));
                                        r = ConvertNotificationResult(notification_set_image(notiHandle, thumbnailListEnum[i], filePath.get()));
                                        SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set thumnail path  failed.", GetErrorMessage(r));
@@ -710,7 +709,6 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                }
                else
                {
-                       // TODO: Check the valid
                        const IList* pMessageTextList = pRequestImpl->GetMessageTextList();
                        if (pMessageTextList && pMessageTextList->GetCount())
                        {
@@ -749,7 +747,7 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                                {
                                        int matchIndex;
                                        // 2.1: Multiple layout has single line text for 2nd information text.
-                                       if ((layout == NOTIFICATION_LY_NOTI_EVENT_MULTIPLE && E_SUCCESS) == (pText2->IndexOf(L'\t', 0, matchIndex)))
+                                       if ((layout == NOTIFICATION_LY_NOTI_EVENT_MULTIPLE) && (E_SUCCESS == (pText2->IndexOf(L'\t', 0, matchIndex))))
                                        {
                                                // Make two token
                                                String subText;
@@ -757,14 +755,14 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                                                std::unique_ptr<char[]> leftText(_StringConverter::CopyToCharArrayN(subText));
                                                r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_2, leftText.get(),
                                                                                                                                                        NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
-                                               SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info1 Text failed.", GetErrorMessage(r));
+                                               SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info2 Text failed.", GetErrorMessage(r));
                                                subText.Clear();
                                                if (E_SUCCESS == pText2->SubString(matchIndex+1, subText))
                                                {
                                                        std::unique_ptr<char[]> rightText(_StringConverter::CopyToCharArrayN(subText));
                                                        r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_SUB_2, rightText.get(),
                                                                                                                                                                NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
-                                                       SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info1 Sub Text failed.", GetErrorMessage(r));
+                                                       SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info2 Sub Text failed.", GetErrorMessage(r));
                                                }
                                        }
                                        else
@@ -772,7 +770,7 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                                                std::unique_ptr<char[]> leftText(_StringConverter::CopyToCharArrayN(*pText2));
                                                r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_2, leftText.get(),
                                                                                                                                                        NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
-                                               SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info1 Text failed.", GetErrorMessage(r));
+                                               SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Info2 Text failed.", GetErrorMessage(r));
                                        }
                                }
                        }
@@ -875,7 +873,8 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                        layout = NOTIFICATION_LY_ONGOING_PROGRESS;
                }
        }
-       notification_set_layout(notiHandle, layout);
+       r = ConvertNotificationResult(notification_set_layout(notiHandle, layout));
+       SysTryLog(NID_SHELL, !IsFailed(r), "[%s] notification_set_layout failure.", GetErrorMessage(r));
 
        // For ongoing
        if (isOngoing)