Apply ASSERT 16/36816/1 accepted/tizen/tv/20150316.053553 accepted/tizen/tv/20150316.053609 submit/tizen_tv/20150316.010239 submit/tizen_tv/20150316.020823
authorKim Tae Soo <taesoo46.kim@samsung.com>
Mon, 16 Mar 2015 01:01:38 +0000 (10:01 +0900)
committerKim Tae Soo <taesoo46.kim@samsung.com>
Mon, 16 Mar 2015 01:01:38 +0000 (10:01 +0900)
Change-Id: Ia5d5f8921037f840a42178fbaaea5935305c7443
Signed-off-by: Kim Tae Soo <taesoo46.kim@samsung.com>
src/data/album_info.cpp
src/data/category_info.cpp
src/data/folder_info.cpp
src/data/song_info.cpp
src/views/base-view.cpp

index a131b6e..255f001 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <AppCommon.h>
 #include "dbg.h"
 #include "i18n.h"
 #include "album_info.h"
@@ -35,8 +36,7 @@ struct SAlbumInfo {
 
 bool CAlbumInfo::Create()
 {
-       if (m)
-               return false;
+       ASSERT(!m);
 
        m = new SAlbumInfo();
        if (!m) {
@@ -56,8 +56,7 @@ bool CAlbumInfo::Create()
 
 void CAlbumInfo::Destroy()
 {
-       if (!m)
-               return;
+       ASSERT(m);
 
        CExtNameInfo::Destroy();
 
@@ -70,8 +69,7 @@ void CAlbumInfo::Destroy()
 
 char *CAlbumInfo::Artist()
 {
-       if (!m)
-               return NULL;
+       ASSERT(m);
 
        return m->artist;
 }
@@ -79,8 +77,7 @@ char *CAlbumInfo::Artist()
 
 char *CAlbumInfo::Genre()
 {
-       if (!m)
-               return NULL;
+       ASSERT(m);
 
        return m->genre;
 }
@@ -88,8 +85,7 @@ char *CAlbumInfo::Genre()
 
 int CAlbumInfo::SongCount()
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->songCount;
 }
@@ -97,8 +93,7 @@ int CAlbumInfo::SongCount()
 
 int CAlbumInfo::AlbumId()
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->albumId;
 }
@@ -106,8 +101,7 @@ int CAlbumInfo::AlbumId()
 
 bool CAlbumInfo::SetArtist(const char *artist)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        delete[] m->artist;
        m->artist = NULL;
@@ -124,8 +118,7 @@ bool CAlbumInfo::SetArtist(const char *artist)
 
 bool CAlbumInfo::SetGenre(const char *genre)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        delete[] m->genre;
        m->genre = NULL;
@@ -142,8 +135,7 @@ bool CAlbumInfo::SetGenre(const char *genre)
 
 bool CAlbumInfo::SetSongCount(int songCount)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->songCount = songCount;
 
@@ -153,8 +145,7 @@ bool CAlbumInfo::SetSongCount(int songCount)
 
 bool CAlbumInfo::SetAlbumId(int albumId)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->albumId = albumId;
 
@@ -164,8 +155,7 @@ bool CAlbumInfo::SetAlbumId(int albumId)
 
 bool CAlbumInfo::Duplicate(CNameInfo *obj)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        CAlbumInfo* dst = (CAlbumInfo*)obj;
 
index 5f74381..979adeb 100644 (file)
@@ -17,6 +17,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <Eina.h>
+#include <AppCommon.h>
 #include "dbg.h"
 #include "i18n.h"
 #include "define.h"
@@ -59,8 +60,7 @@ CCategoryInfo::CListMember *CCategoryInfo::m_MemberDuplicate(CListMember *member
 
 bool CCategoryInfo::Create(void)
 {
-       if (m)
-               return false;
+       ASSERT(!m);
 
        m = new SCategoryInfo();
        if (!m) {
@@ -80,12 +80,11 @@ bool CCategoryInfo::Create(void)
 
 void CCategoryInfo::Destroy(void)
 {
+       ASSERT(m);
+
        CListMember *item;
        void *obj;
 
-       if (!m)
-               return;
-
        CExtNameInfo::Destroy();
 
        eina_list_free(m->albumList);
@@ -107,8 +106,7 @@ void CCategoryInfo::Destroy(void)
 
 int CCategoryInfo::CategoryId(void)
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->categoryId;
 }
@@ -116,8 +114,7 @@ int CCategoryInfo::CategoryId(void)
 
 int CCategoryInfo::AlbumCount(void)
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->albumCount;
 }
@@ -125,8 +122,7 @@ int CCategoryInfo::AlbumCount(void)
 
 int CCategoryInfo::SongCount(void)
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->songCount;
 }
@@ -134,8 +130,7 @@ int CCategoryInfo::SongCount(void)
 
 Eina_List *CCategoryInfo::AlbumList(void)
 {
-       if (!m)
-               return NULL;
+       ASSERT(m);
 
        return m->albumList;
 }
@@ -143,8 +138,7 @@ Eina_List *CCategoryInfo::AlbumList(void)
 
 Eina_List *CCategoryInfo::MemberList(void)
 {
-       if (!m)
-               return NULL;
+       ASSERT(m);
 
        return m->memberList;
 }
@@ -152,8 +146,7 @@ Eina_List *CCategoryInfo::MemberList(void)
 
 bool CCategoryInfo::SetCategoryId(int categoryId)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->categoryId = categoryId;
 
@@ -163,8 +156,7 @@ bool CCategoryInfo::SetCategoryId(int categoryId)
 
 bool CCategoryInfo::SetAlbumCount(int albumCount)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->albumCount = albumCount;
 
@@ -174,8 +166,7 @@ bool CCategoryInfo::SetAlbumCount(int albumCount)
 
 bool CCategoryInfo::SetSongCount(int songCount)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->songCount = songCount;
 
@@ -185,8 +176,7 @@ bool CCategoryInfo::SetSongCount(int songCount)
 
 bool CCategoryInfo::SetAlbumInfo(CAlbumInfo *albumInfo)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->albumList = eina_list_append(m->albumList, albumInfo);
 
@@ -196,8 +186,7 @@ bool CCategoryInfo::SetAlbumInfo(CAlbumInfo *albumInfo)
 
 bool CCategoryInfo::SetMember(CListMember *member)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->memberList = eina_list_append(m->memberList, member);
 
@@ -207,8 +196,7 @@ bool CCategoryInfo::SetMember(CListMember *member)
 
 bool CCategoryInfo::Duplicate(CNameInfo *obj)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        CCategoryInfo* dst = (CCategoryInfo*)obj;
 
index 652e29a..b7742cf 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <AppCommon.h>
 #include "dbg.h"
 #include "i18n.h"
 #include <NameInfo.h>
@@ -34,8 +35,7 @@ struct SFolderInfo {
 
 bool CFolderInfo::Create(void)
 {
-       if (m)
-               return false;
+       ASSERT(!m);
 
        m = new SFolderInfo();
        if (!m) {
@@ -55,8 +55,7 @@ bool CFolderInfo::Create(void)
 
 void CFolderInfo::Destroy(void)
 {
-       if (!m)
-               return;
+       ASSERT(m);
 
        CNameInfo::Destroy();
        delete m;
@@ -66,8 +65,7 @@ void CFolderInfo::Destroy(void)
 
 int CFolderInfo::Count(void)
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->count;
 }
@@ -75,8 +73,7 @@ int CFolderInfo::Count(void)
 
 int CFolderInfo::Duration(void)
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->duration;
 }
@@ -84,8 +81,7 @@ int CFolderInfo::Duration(void)
 
 bool CFolderInfo::SetCount(int count)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->count = count;
 
@@ -95,8 +91,7 @@ bool CFolderInfo::SetCount(int count)
 
 bool CFolderInfo::SetDuration(int duration)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->duration = duration;
 
@@ -106,8 +101,7 @@ bool CFolderInfo::SetDuration(int duration)
 
 bool CFolderInfo::Duplicate(CNameInfo *obj)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        CFolderInfo* dst = (CFolderInfo*)obj;
 
index 8dc4b91..481b4bb 100644 (file)
@@ -40,8 +40,7 @@ struct SSongInfo {
 
 bool CSongInfo::Create(void)
 {
-       if (m)
-               return false;
+       ASSERT(!m);
 
        m = new SSongInfo();
        if (!m) {
@@ -61,8 +60,7 @@ bool CSongInfo::Create(void)
 
 void CSongInfo::Destroy(void)
 {
-       if (!m)
-               return;
+       ASSERT(m);
 
        CExtNameInfo::Destroy();
 
@@ -79,8 +77,7 @@ void CSongInfo::Destroy(void)
 
 int CSongInfo::MemberId(void)
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->memberId;
 }
@@ -88,8 +85,7 @@ int CSongInfo::MemberId(void)
 
 char *CSongInfo::Artist(void)
 {
-       if (!m)
-               return NULL;
+       ASSERT(m);
 
        return m->artist;
 }
@@ -97,8 +93,7 @@ char *CSongInfo::Artist(void)
 
 char *CSongInfo::Genre(void)
 {
-       if (!m)
-               return NULL;
+       ASSERT(m);
 
        return m->genre;
 }
@@ -106,8 +101,7 @@ char *CSongInfo::Genre(void)
 
 char *CSongInfo::Album(void)
 {
-       if (!m)
-               return NULL;
+       ASSERT(m);
 
        return m->album;
 }
@@ -115,8 +109,7 @@ char *CSongInfo::Album(void)
 
 char *CSongInfo::Composer(void)
 {
-       if (!m)
-               return NULL;
+       ASSERT(m);
 
        return m->composer;
 }
@@ -124,8 +117,7 @@ char *CSongInfo::Composer(void)
 
 int CSongInfo::Type(void)
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->type;
 }
@@ -133,8 +125,7 @@ int CSongInfo::Type(void)
 
 int CSongInfo::Duration(void)
 {
-       if (!m)
-               return 0;
+       ASSERT(m);
 
        return m->duration;
 }
@@ -142,8 +133,7 @@ int CSongInfo::Duration(void)
 
 bool CSongInfo::SetMemberId(int memberId)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->memberId = memberId;
 
@@ -153,8 +143,7 @@ bool CSongInfo::SetMemberId(int memberId)
 
 bool CSongInfo::SetArtist(const char *artist)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        delete[] m->artist;
        m->artist = NULL;
@@ -171,8 +160,7 @@ bool CSongInfo::SetArtist(const char *artist)
 
 bool CSongInfo::SetGenre(const char *genre)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        delete[] m->genre;
        m->genre = NULL;
@@ -189,8 +177,7 @@ bool CSongInfo::SetGenre(const char *genre)
 
 bool CSongInfo::SetAlbum(const char *album)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        delete[] m->album;
        m->album = NULL;
@@ -207,8 +194,7 @@ bool CSongInfo::SetAlbum(const char *album)
 
 bool CSongInfo::SetComposer(const char *composer)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        delete[] m->composer;
        m->composer = NULL;
@@ -225,8 +211,7 @@ bool CSongInfo::SetComposer(const char *composer)
 
 bool CSongInfo::SetType(int type)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->type = type;
 
@@ -236,8 +221,7 @@ bool CSongInfo::SetType(int type)
 
 bool CSongInfo::SetDuration(int duration)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        m->duration = duration;
 
@@ -247,8 +231,7 @@ bool CSongInfo::SetDuration(int duration)
 
 bool CSongInfo::Duplicate(CNameInfo *obj)
 {
-       if (!m)
-               return false;
+       ASSERT(m);
 
        CSongInfo* dst = (CSongInfo*)obj;
 
index e92bf0e..e519921 100644 (file)
@@ -148,7 +148,8 @@ struct SMusicBaseView {
        Evas_Object *group_btn[TOTAL_GROUP_BTNS];
        Evas_Object *srcbtn;
        Evas_Object *sortbtn;
-       CCtxPopup *ctxpopup;
+       CSortCtxPopup *sortCtxPopup;
+       CSourceCtxPopup *srcCtxPopup;
        Evas_Object *popup;
        Elm_Transit *transit;
        Evas_Object *c_grpbtn;
@@ -325,7 +326,6 @@ void CMusicBaseView::m_GotoPlayback(void)
 
 void CMusicBaseView::m_CreateCtxPopup(int btnType)
 {
-       CCtxPopup *ctxPopup = NULL;
        const char *layout_id = NULL;
        CCtxPopup::SCallback cb;
        cb.onSelected = sm_CbCtxPopupBtnSelected;
@@ -336,7 +336,8 @@ void CMusicBaseView::m_CreateCtxPopup(int btnType)
                m->btntype = btnType;
                srcCtxPopup = new CSourceCtxPopup;
                srcCtxPopup->Create(m->base, &cb);
-               ctxPopup = srcCtxPopup;
+
+               m->srcCtxPopup = srcCtxPopup;
        }
        else if (btnType == BTN_SORT) {
                CSortCtxPopup *sortCtxPopup = NULL;
@@ -366,28 +367,29 @@ void CMusicBaseView::m_CreateCtxPopup(int btnType)
                }
 
                sortCtxPopup->Create(m->base, &cb, sortBtnType);
-               ctxPopup = sortCtxPopup;
+               m->sortCtxPopup = sortCtxPopup;
        }
        else {
                _ERR("MUST NOT BE HERE!!");
                ASSERT(0);
                return;
        }
-
-       m->ctxpopup = ctxPopup;
 }
 
 
 void CMusicBaseView::m_DestroyCtxPopup(void)
 {
-       if (!m->ctxpopup)
-               return;
+       if (m->sortCtxPopup && m->sortCtxPopup->FlagCreate())
+               m->sortCtxPopup->Destroy();
+
+       delete m->sortCtxPopup;
+       m->sortCtxPopup = NULL;
 
-       if (m->ctxpopup->FlagCreate())
-               m->ctxpopup->Destroy();
+       if (m->srcCtxPopup && m->srcCtxPopup->FlagCreate())
+               m->srcCtxPopup->Destroy();
 
-       delete m->ctxpopup;
-       m->ctxpopup = NULL;
+       delete m->srcCtxPopup;
+       m->srcCtxPopup = NULL;
 }