Apply VLD_MMS LOG about File Path & Size
authorSeunghwan Lee <sh.cat.lee@samsung.com>
Fri, 25 Jan 2013 07:31:42 +0000 (16:31 +0900)
committerSeunghwan Lee <sh.cat.lee@samsung.com>
Fri, 25 Jan 2013 07:31:42 +0000 (16:31 +0900)
plugin/mms_plugin/MmsPluginMessage.cpp
plugin/mms_plugin/MmsPluginStorage.cpp
plugin/mms_plugin/include/MmsPluginMessage.h

index 4d4cd61..3b0e61c 100755 (executable)
@@ -938,6 +938,8 @@ msg_error_t MmsMakePreviewInfo(int msgId, MMS_MESSAGE_DATA_S *pMmsMsg)
        if (pMmsMsg == NULL)
                return MSG_ERR_NULL_POINTER;
 
+       MmsPluginStorage::instance()->removePreviewInfo(msgId); //remove exist previnfo
+
        if (pMmsMsg->pageCnt > 0) {
 
                MmsPluginStorage::instance()->insertPreviewInfo(msgId, MSG_MMS_ITEM_TYPE_PAGE, (char *)"pagecount", pMmsMsg->pageCnt);
@@ -996,3 +998,39 @@ msg_error_t MmsMakePreviewInfo(int msgId, MMS_MESSAGE_DATA_S *pMmsMsg)
 
        return MSG_SUCCESS;
 }
+
+void MmsPrintFileInfoForVLD(MMS_MESSAGE_DATA_S *pMmsMsg)
+{
+       MMS_PAGE_S *pPage = NULL;
+       MMS_MEDIA_S *pMedia = NULL;
+
+       if (pMmsMsg == NULL)
+               return;
+
+       if (pMmsMsg->pageCnt > 0) {
+               for (int i = 0; i < pMmsMsg->pageCnt; i++) {
+
+                       pPage = _MsgMmsGetPage(pMmsMsg, i);
+
+                       if (pPage == NULL)
+                               continue;
+
+                       for (int j = 0; j < pPage->mediaCnt; j++) {
+
+                               pMedia = _MsgMmsGetMedia(pPage, j);
+                               if (pMedia == NULL)
+                                       continue;
+
+                               MSG_MMS_VLD_FILE("[%s], %d", pMedia->szFilePath, MsgGetFileSize(pMedia->szFilePath));
+                       }
+               }
+       }
+
+       int attachCnt = _MsgMmsGetAttachCount(pMmsMsg);
+       if (attachCnt > 0) {
+               for (int i = 0; i < pMmsMsg->pageCnt; i++) {
+               MMS_ATTACH_S *pAttach = _MsgMmsGetAttachment(pMmsMsg, i);
+               MSG_MMS_VLD_FILE("[%s], %d", pAttach->szFilePath, MsgGetFileSize(pAttach->szFilePath));
+               }
+       }
+}
index 271d062..5c42c02 100755 (executable)
@@ -100,6 +100,8 @@ void MmsPluginStorage::addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_I
                        THROW(MsgException::MMS_PLG_ERROR, "MMS Message Compose Error");
                }
 
+               MmsPrintFileInfoForVLD(&mmsMsgData);
+
                char fileName[MSG_FILENAME_LEN_MAX+1] = {0,};
 
                FILE *pFile = NULL;
index db549ec..d7fdc12 100755 (executable)
@@ -42,5 +42,5 @@ bool MmsCheckAdditionalMedia(MMS_MESSAGE_DATA_S *pMsgData, MsgType *partHeader);
 bool MmsRemovePims(MMS_MESSAGE_DATA_S *pMsgData);
 
 msg_error_t MmsMakePreviewInfo(int msgId, MMS_MESSAGE_DATA_S *pMmsMsg);
-
+void MmsPrintFileInfoForVLD(MMS_MESSAGE_DATA_S *pMmsMsg);
 #endif //MMS_PLUGIN_MESSAGE_H