From: Denis Dolzhenko Date: Mon, 12 Sep 2016 07:11:14 +0000 (+0300) Subject: TizenRefApp-7097 remove unused enums from MsgMedia X-Git-Tag: submit/tizen/20160916.133943^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F87928%2F5;p=profile%2Fmobile%2Fapps%2Fnative%2Fmessage.git TizenRefApp-7097 remove unused enums from MsgMedia Change-Id: I906e8012c6dd188a12870fd02388c6d88efda10f Signed-off-by: Denis Dolzhenko --- diff --git a/src/Common/MsgEngine/inc/MsgMedia.h b/src/Common/MsgEngine/inc/MsgMedia.h index d121ade8..10286c20 100644 --- a/src/Common/MsgEngine/inc/MsgMedia.h +++ b/src/Common/MsgEngine/inc/MsgMedia.h @@ -43,8 +43,6 @@ namespace Msg AudioType, /**< Audio file. Can be played with smil-player.*/ VideoType, /**< Video file. Can be played with smil-player.*/ TextType, /**< Text-section of page.*/ - AnimateType, /**< Animated vector graphics or other animated format supported by smil-player. */ - ImageOrVideoType //TODO: I'm unused enum-item, remove me. }; public: diff --git a/src/Common/MsgEngine/src/private/MsgMediaPrivate.cpp b/src/Common/MsgEngine/src/private/MsgMediaPrivate.cpp index db15f073..cd9b9ed5 100644 --- a/src/Common/MsgEngine/src/private/MsgMediaPrivate.cpp +++ b/src/Common/MsgEngine/src/private/MsgMediaPrivate.cpp @@ -65,8 +65,6 @@ void MsgMediaPrivate::setType(Type type) { case ImageType: case VideoType: - case AnimateType: - case ImageOrVideoType: { MsgUtilsPrivate::setStr(m_MsgStruct, MSG_MMS_MEDIA_REGION_ID_STR, imageRegionId); break; diff --git a/src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp b/src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp index 0e2e310f..1797950f 100644 --- a/src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp +++ b/src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp @@ -220,27 +220,38 @@ Message::Type MsgUtilsPrivate::nativeToMessageType(int type) } } -void MsgUtilsPrivate::checkSmilType() -{ - static_assert((int)MMS_SMIL_MEDIA_INVALID == (int)MsgMedia::UnknownType && - (int)MMS_SMIL_MEDIA_IMG == (int)MsgMedia::ImageType && - (int)MMS_SMIL_MEDIA_AUDIO == (int)MsgMedia::AudioType && - (int)MMS_SMIL_MEDIA_VIDEO == (int)MsgMedia::VideoType && - (int)MMS_SMIL_MEDIA_TEXT == (int)MsgMedia::TextType && - (int)MMS_SMIL_MEDIA_ANIMATE == (int)MsgMedia::AnimateType && - (int)MMS_SMIL_MEDIA_IMG_OR_VIDEO == (int)MsgMedia::ImageOrVideoType, ""); -} - MsgMedia::Type MsgUtilsPrivate::nativeToSmilType(int type) { - checkSmilType(); - return (MsgMedia::Type)type; + switch(type) + { + case MMS_SMIL_MEDIA_IMG: + return MsgMedia::ImageType; + case MMS_SMIL_MEDIA_AUDIO: + return MsgMedia::AudioType; + case MMS_SMIL_MEDIA_VIDEO: + return MsgMedia::VideoType; + case MMS_SMIL_MEDIA_TEXT: + return MsgMedia::TextType; + } + return MsgMedia::UnknownType; } int MsgUtilsPrivate::smilTypeToNative(MsgMedia::Type type) { - checkSmilType(); - return (int)type; + switch(type) + { + case MsgMedia::ImageType: + return MMS_SMIL_MEDIA_IMG; + case MsgMedia::AudioType: + return MMS_SMIL_MEDIA_AUDIO; + case MsgMedia::VideoType: + return MMS_SMIL_MEDIA_VIDEO; + case MsgMedia::TextType: + return MMS_SMIL_MEDIA_TEXT; + case MsgMedia::UnknownType: + break; + } + return MMS_SMIL_MEDIA_INVALID; } std::string MsgUtilsPrivate::getStr(msg_struct_t msgStruct, int field, int maxStrLen) diff --git a/src/Common/MsgEngine/src/private/MsgUtilsPrivate.h b/src/Common/MsgEngine/src/private/MsgUtilsPrivate.h index 866a2b83..ed0f42ca 100644 --- a/src/Common/MsgEngine/src/private/MsgUtilsPrivate.h +++ b/src/Common/MsgEngine/src/private/MsgUtilsPrivate.h @@ -52,9 +52,6 @@ namespace Msg static std::string getStr(msg_struct_t msgStruct, int field, int maxStrLen); static int setStr(msg_struct_t msgStruct, int field, const std::string &text); - - private: - static void checkSmilType(); }; }