[MusicPlayer] Fixed disp error when ArtistContentListForm eidt and clean up createite...
authorMyunkyu <mk70.kang@partner.samsung.com>
Fri, 5 Apr 2013 10:37:59 +0000 (19:37 +0900)
committerMyunkyu <mk70.kang@partner.samsung.com>
Fri, 5 Apr 2013 10:37:59 +0000 (19:37 +0900)
Change-Id: Ia476d6ae74eaaa46f1d85b4d6f21d569276e5c50

43 files changed:
inc/MpCommonUtil.h
inc/MpFolderListEditorPanel.h
inc/MpFolderListPanel.h
inc/MpMiniPlayer.h
inc/MpPlaylistEditorPresentationModel.h [changed mode: 0755->0644]
inc/MpPlaylistListEditorPanel.h
src/MpAlbumListPanel.cpp
src/MpAlbumListPresentationModel.cpp
src/MpAllListPanel.cpp
src/MpAllListPresentationModel.cpp
src/MpArtistAlbumListForm.cpp
src/MpArtistContentListForm.cpp
src/MpArtistListEditorPanel.cpp
src/MpArtistListPanel.cpp
src/MpArtistListPresentationModel.cpp
src/MpCommonUtil.cpp
src/MpComposerListPanel.cpp
src/MpComposerPickerPanel.cpp
src/MpContentListPanel.cpp
src/MpFolderContentListForm.cpp
src/MpFolderListEditorPanel.cpp
src/MpFolderListPanel.cpp
src/MpFolderListPresentationModel.cpp
src/MpGenreListPanel.cpp
src/MpGenrePickerPanel.cpp
src/MpMiniPlayer.cpp
src/MpMusicPlayerForm.cpp
src/MpMusicPlayerPresentationModel.cpp
src/MpPlaylistContentListForm.cpp
src/MpPlaylistCreatorForm.cpp
src/MpPlaylistEditorPresentationModel.cpp
src/MpPlaylistListEditorPanel.cpp
src/MpPlaylistListPanel.cpp
src/MpPlaylistListPresentationModel.cpp
src/MpPlaylistPickerPopup.cpp
src/MpSearchForm.cpp
src/MpSearchPresentationModel.cpp
src/MpSetAsPopup.cpp
src/MpSettingForm.cpp
src/MpSharePopup.cpp
src/MpUserPlaylistContentListForm.cpp
src/MpYearListPanel.cpp
src/MpYearPickerPanel.cpp

index 51b46e6..e97e427 100644 (file)
@@ -67,7 +67,6 @@ public:
        static void SetAllCheckState(bool state, Tizen::Ui::Controls::TableView& tableView, int totalCount);
 
        static result SetFastScrollIndex(Tizen::Ui::Controls::TableView& tableview);
-       static void SetLayoutFitToForm(const Tizen::Ui::Controls::Form& form, Tizen::Ui::Control& childControl);
        static void SetLayoutFitToContainer(const Tizen::Ui::Container& container, Tizen::Ui::Control& childControl);
        static void SetFooterItemEnabled(Tizen::Ui::Controls::Footer& pFooter, bool enable);
 
@@ -97,20 +96,10 @@ public:
        static void SetNoContentImage(Tizen::Ui::Controls::Label& source, Tizen::Base::String& resourceName, Tizen::Base::String& text);
        //-->fixed
 
-
-//     static void SetButtonItemIcon(Tizen::Ui::Controls::ButtonItem& buttonItem, Tizen::Base::String normalIDB, Tizen::Base::String pressedIDB, Tizen::Base::String disableIDB);
-//     static void SetButtonItemBackgroundBitmap(Tizen::Ui::Controls::ButtonItem& buttonItem, Tizen::Base::String normalIDB, Tizen::Base::String pressedIDB, Tizen::Base::String disableIDB);
-//     static void SetHeaderItemBackgroundBitmap(Tizen::Ui::Controls::HeaderItem& headerItem, Tizen::Base::String normalIDB
-//                                                                                                                     , Tizen::Base::String pressedIDB, Tizen::Base::String disableIDB, Tizen::Base::String selectedIDB);
-       //-->fixed
-
        static Tizen::Ui::Controls::Popup* CreateContentDeletePopup(Tizen::Ui::IActionEventListener& listener, int deleteActionId, int cancelActionId);
        static Tizen::Ui::Controls::Panel* CreateFlickMenuN(Tizen::Ui::IActionEventListener& listener, FlickMenuStyle menuStyle);
        static Tizen::Ui::Controls::TableViewContextItem* CreateTableViewContextItemN(Tizen::Ui::IActionEventListener& listener, int itemWidth, FlickMenuStyle menuStyle);
-       static void SetTextItemSelectedBalloonPopup(Tizen::Ui::Controls::Label& itemSelectedBalloonPopup, int itemCount); //removable
        static Tizen::Base::String GetStringItemSelectd(int itemCount);
-//     static result SetShowStateItemSelectedBalloonPopup(Tizen::Ui::Controls::Label& itemSelectedBalloonPopup, bool isShow);
-
 
        static Tizen::Ui::Controls::Footer* CreateContentListFooter(const Tizen::Ui::Controls::Form& form);
        static Tizen::Ui::Controls::Footer* CreatePlaylistEditFooter(const Tizen::Ui::Controls::Form& form);
@@ -151,7 +140,6 @@ public:
        static void SetButtonEnabled(const Tizen::Ui::Controls::Form& form, int checkedItemCount, int actionId);
        static void SetButtonEnabled(const Tizen::Ui::Controls::Form& form, int checkedItemCount);
 
-       static void ShowNoContentImage(int total, Tizen::Ui::Controls::TableView& contentTableView, Tizen::Ui::Controls::Label& contentImageLabel, Tizen::Ui::Controls::Label& contentTextLabel);
        static Tizen::Graphics::Bitmap* GetColorizedBitmapN(const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Color& color);
 };
 
index 8b4e771..53d81f9 100644 (file)
@@ -77,7 +77,7 @@ protected:
        virtual int GetCheckedItemCount(void);
 
 private:
-       result CreateTableViewItem(Tizen::Ui::Container& parent, const ContentInformation& contentInfo);
+       result CreateTableViewItem(Tizen::Ui::Container& parent, const Tizen::Base::String& contentPath, int contentCount);
 
        void UpdateContentList(void);
        void SetEditHeaderStyle(void);
index 2f28190..53e8b82 100644 (file)
@@ -63,6 +63,8 @@ public:
        virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
 
 private:
+       result CreateTableViewItem(Tizen::Ui::Container& parent, const Tizen::Base::String& contentPath, int contentCount);
+
        void UpdateContentList(void);
        virtual bool IsEmptyContentList(void);
 
index 21e08ad..bf63d31 100644 (file)
@@ -50,7 +50,7 @@ public:
        void RemoveMoreContextMenuActionEventListner(Tizen::Ui::IActionEventListener& listener);\r
        void RemoveBackActionEventListner(Tizen::Ui::IActionEventListener& listener, int actionId);\r
 \r
-       void MiniPlayerActivate(void);\r
+       result MiniPlayerActivate(void);\r
        void MiniPlayerDeactivate(void);\r
 \r
 protected:\r
old mode 100755 (executable)
new mode 100644 (file)
index 83c01ef..9783b3b
@@ -36,7 +36,7 @@ public:
        int GetPlayListItemCount(Tizen::Base::String& playlist);
        int GetAllPlayListCount(void);
        Tizen::Base::Collection::IList* GetAllPlayListNameN(void);
-       Tizen::Base::String* GetPlayListNameN(int playlistIndex);
+       Tizen::Base::String GetPlayListName(int playlistIndex);
        Tizen::Graphics::Bitmap* GetPlayListItemBitmap(Tizen::Base::String& playlist);
        Tizen::Content::ContentId GetPlayListItemContentId(Tizen::Base::String& playlist);
        result SetPlayListName(const Tizen::Base::String& oldPlayListName, const Tizen::Base::String& newPlayListName);
index ff2551d..2303dce 100644 (file)
@@ -40,8 +40,6 @@ class PlaylistEditorPresentationModel;
 class PlaylistListEditorPanel
        : public ContentEditPanel
        , public ThumbnailBase
-//     , public Tizen::Ui::IActionEventListener
-//     , public Tizen::Ui::Scenes::ISceneEventListener
 {
 public:
        PlaylistListEditorPanel(void);
@@ -74,6 +72,8 @@ protected:
        virtual int GetCheckedItemCount(void);
 
 private:
+       result CreateTableViewItem(Tizen::Ui::Controls::TableViewItem& parent, const Tizen::Base::String& title, int itemIndex);
+
        void UpdateContentList(void);
        void SetEditHeaderStyle(void);
        void SetTabHeaderStyle(void);
index 0329f9c..5ce6c07 100644 (file)
@@ -208,13 +208,7 @@ AlbumListPanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentScen
                                                                        const Tizen::Ui::Scenes::SceneId& nextSceneId)
 {
        AppLogDebug("ENTER");
-       Form* pForm = dynamic_cast<Form*>(GetParent());
-       AppAssert(pForm);
-
-       Footer* pFooter = pForm->GetFooter();
-       pFooter->RemoveAllButtons();
-       pFooter->RemoveAllItems();
-       pFooter->RemoveActionEventListener(*this);
+       ContentLibaryPanel::OnSceneDeactivated(currentSceneId, nextSceneId);
        CancelAllThumbnailRequest();
        AppLogDebug("EXIT");
 }
index df12f30..e972ada 100644 (file)
@@ -58,6 +58,7 @@ AlbumListPresentationModel::GetContentCount(int albumIndex)
 
        if (__pAlbumList == null)
        {
+               AppLogDebug("EXIT");
                return INIT_VALUE;
        }
 
@@ -67,8 +68,14 @@ AlbumListPresentationModel::GetContentCount(int albumIndex)
        }
        else
        {
-               IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
-                                                                                       *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+               String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+               if (pContentFileName == null)
+               {
+                       AppLogDebug("EXIT(pContentFileName is null");
+                       return INIT_VALUE;
+               }
+
+               IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
                if (pContentSearchResultList == null)
                {
                        AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
@@ -144,8 +151,14 @@ AlbumListPresentationModel::GetAlbumInfoN(int albumIndex)
                return null;
        }
 
-       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
-                                                                                               *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+       String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return null;
+       }
+
+       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
        if (pContentSearchResultList == null)
        {
                AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
@@ -170,6 +183,12 @@ ContentInformation*
 AlbumListPresentationModel::GetContentInfoN(int contentIndex)
 {
        AppLogDebug("ENTER");
+       if (__pContentList == null || contentIndex < INIT_VALUE)
+       {
+               AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pContentList is null)", contentIndex);
+               return null;
+       }
+
        ContentInformation* pContentInformation = null;
        ContentSearchResult* pResult = static_cast<ContentSearchResult*>(__pContentList->GetAt(contentIndex));
        if (pResult->GetContentType() == CONTENT_TYPE_AUDIO)
@@ -195,10 +214,18 @@ AlbumListPresentationModel::RemoveAlbumList(int albumIndex)
 
        if (__pAlbumList == null)
        {
+               AppLogDebug("EXIT");
                return ;
        }
-       pRemoveAlbumList = CommonUtil::ContentSearchResultListN(
-                                                                       *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+
+       String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return;
+       }
+
+       pRemoveAlbumList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
        totalCount = pRemoveAlbumList->GetCount();
 
        for (int iCount = 0; iCount < totalCount; iCount++)
@@ -240,11 +267,20 @@ AlbumListPresentationModel::InitializeContentList(int albumIndex)
        if (__pContentList != null)
        {
                __pContentList->RemoveAll(true);
+               delete __pContentList;
+               __pContentList = null;
        }
 
        __currentAlbumIndex = albumIndex;
-       __pContentList = CommonUtil::ContentSearchResultListN(
-                                                               *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+
+       String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return;
+       }
+
+       __pContentList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
        AppLogDebug("EXIT");
 }
 
@@ -254,11 +290,18 @@ AlbumListPresentationModel::GetContentPathListN(int albumIndex)
        AppLogDebug("ENTER");
        if (__pAlbumList == null)
        {
+               AppLogDebug("EXIT");
+               return null;
+       }
+
+       String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
                return null;
        }
 
-       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
-                                                                                               *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
        if (pContentSearchResultList == null)
        {
                AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
@@ -289,10 +332,17 @@ AlbumListPresentationModel::RefreshContentList(int albumIndex)
        {
                __pContentList->RemoveAll(true);
                delete __pContentList;
+               __pContentList = null;
+       }
+
+       String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return;
        }
 
-        __pContentList = CommonUtil::ContentSearchResultListN(
-                                                                                               *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+        __pContentList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
        if (__pContentList != null && __pContentList->GetCount() == INIT_VALUE)
        {
                delete __pContentList;
index d5ee8ec..5f195ea 100644 (file)
@@ -126,15 +126,47 @@ AllListPanel::OnAppControlCompleteResponseReceived(const AppId& appId,
                AppLogDebug("EXIT");
                return;
        }
-
        AppLogDebug("%ls, %ls", appId.GetPointer(), operationId.GetPointer());
+
        if (appId.Equals(String(PROVIDER_ID_CONTACT))/* && operationId.Equals(String(OPERATION_ID_PICK))*/)
        {
                if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
                {
-                       const String* pResultString = static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID)));
+                       int contactId = -1;
+                       String* pKey = null;
+                       ArrayList* pArrayListValue = null;
+                       String* pResultString = null;
+                       if (pExtraData != null)
+                       {
+                               IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
+                               while (pEnum->MoveNext() == E_SUCCESS)
+                               {
+                                       pKey = static_cast<String*>(pEnum->GetKey());
+                                       if (pKey->Equals(APPCONTROL_KEY_SOCIAL_ITEM_ID, true))
+                                       {
+                                               pArrayListValue = static_cast<ArrayList*>(pEnum->GetValue());
+                                               pResultString = static_cast<String*>(pArrayListValue->GetAt(0));
+                                               AppLogDebug("extraData : %ls:%ls", pKey->GetPointer(), pResultString->GetPointer());
+                                               Integer::Parse(*pResultString, contactId);
+                                               break;
+                                       }
+                               }
+                               delete pEnum;
+
+                               if (contactId < 0)
+                               {
+                                       AppLogDebug("pKey is invaild");
+                                       return;
+                               }
+                       }
+                       else
+                       {
+                               AppLogDebug("pExtraData is null");
+                               return;
+                       }
 
-                       AppLogDebug("%ls", pResultString->GetPointer());
+                       AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
+                       Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
 
                        ContentInformation* pContentInfoStruct = __pPresentationModel->GetContentInfoN(__itemIndex);
                        if (pContentInfoStruct == null)
@@ -142,12 +174,6 @@ AllListPanel::OnAppControlCompleteResponseReceived(const AppId& appId,
                                return;
                        }
 
-                       int contactId;
-                       Integer::Parse(*pResultString, contactId);
-
-                       AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
-                       Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
-
                        Contact* pContact = pAddressbook->GetContactN(contactId);
                        pContact->Tizen::Social::Contact::SetValue(CONTACT_PROPERTY_ID_RINGTONE, pContentInfoStruct->ContentFilePath);
                        result r = pAddressbook->UpdateContact(*pContact);
index 29a20b3..d49f05f 100644 (file)
@@ -98,14 +98,13 @@ CATCH:
 int AllListPresentationModel::GetTotalCount(void)
 {
        AppLogDebug("ENTER");
-
        if (__pContentList == null)
        {
+               AppLogDebug("EXIT");
                return INIT_VALUE;
        }
 
        AppLogDebug("EXIT");
-
        return __pContentList->GetCount();
 }
 
@@ -113,6 +112,12 @@ ContentInformation*
 AllListPresentationModel::GetContentInfoN(int index)
 {
        AppLogDebug("ENTER");
+       if (__pContentList == null || index < INIT_VALUE)
+       {
+               AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pContentList is null)", index);
+               return null;
+       }
+
        ContentInformation* pContentInformation = null;
        ContentSearchResult* pResult = static_cast<ContentSearchResult*>(__pContentList->GetAt(index));
        if (pResult != null && pResult->GetContentType() == CONTENT_TYPE_AUDIO)
@@ -218,15 +223,15 @@ void
 AllListPresentationModel::AddContent(String path, int playlistIndex)
 {
        AppLogDebug("ENTER");
-       ContentInformation* pContentInfoStruct = GetContentInfoN(playlistIndex);
+       ContentInformation* pContentInfo = GetContentInfoN(playlistIndex);
        PlayList* pPlayList = PlayListManager::GetInstance()->GetPlayListN(path);
-       pPlayList->AddItem(pContentInfoStruct->contentId);
-
-       delete pContentInfoStruct;
-       pContentInfoStruct = null;
+       if (pContentInfo != null && pPlayList != null)
+       {
+               pPlayList->AddItem(pContentInfo->contentId);
+       }
 
+       delete pContentInfo;
        delete pPlayList;
-       pPlayList = null;
        AppLogDebug("EXIT");
 }
 
index 3950fda..b167f0e 100644 (file)
@@ -223,7 +223,7 @@ ArtistAlbumListForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previou
 
                if (__pPresentationModel->GetArtistAlbumListCount() == 0)
                {
-                       CommonUtil::ShowNoContentImage(__pPresentationModel->GetArtistAlbumListCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+//                     CommonUtil::ShowNoContentImage(__pPresentationModel->GetArtistAlbumListCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
                        CommonUtil::SetButtonEnabled(*this, __pPresentationModel->GetArtistAlbumListCount());
                        pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
                        pFooter->SetItemEnabled(INDEX_ADDTOPLAYLIST_FOOTER_ADDTOPLAYLIST, false);
index 19bed45..8f1df9b 100644 (file)
@@ -254,6 +254,7 @@ ArtistContentListForm::OnActionPerformed(const Tizen::Ui::Control& source, int a
                        {
                                RemoveContentAt(pContentInfo->contentId);
                                __pPresentationModel->InitializeArtistAlbumList(__headerTitle);
+                               __pPresentationModel->InitializeContentList(INIT_VALUE);
 
                                SetItemCheckedAll(false);
                                __pContentGroupedTableView->RefreshItem(__activatedStateContextItem.__groupIndex, __activatedStateContextItem.__itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE);;
@@ -305,9 +306,6 @@ ArtistContentListForm::OnActionPerformed(const Tizen::Ui::Control& source, int a
        case IDA_FOOTER_BUTTON_DELETE:
                {
                        RemoveConentCheckedAll();
-                       __pPresentationModel->InitializeArtistAlbumList(__headerTitle);
-
-                       SetItemCheckedAll(false);
                        UpdateScreenState();
                        UpdateTableView();
                }
@@ -478,35 +476,35 @@ ArtistContentListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        RelativeLayout layout;
        layout.Construct();
 
-       TableViewItem* pItem = new (std::nothrow) TableViewItem();
        TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
        if (GetScreenState() != SCREEN_STATE_NORMAL)
        {
                tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
        }
 
-       if (IsFailed(pItem->Construct(layout, Dimension(itemWidth, H_TABLEVIEW_IITEM), tableViewAnnexStyle)))
-       {
-               AppLogDebug("Construct(Dimension(itemWidth, ITEM_HEIGHT) failed(%s)", GetErrorMessage(GetLastResult()));
-               delete pItem;
-               return null;
-       }
+       TableViewItem* pItem = new (std::nothrow) TableViewItem();
+       ContentInformation* pContentInfo = __pPresentationModel->GetArtistAlbumContentInfoN(itemIndex);
+
+       result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+       TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
 
        if (__pPresentationModel->GetCurrentArtistAlbumIndex() != groupIndex)
        {
                __pPresentationModel->InitializeContentList(groupIndex);
        }
 
-//     ContentInformation* pContentInfo = __pPresentationModel->GetArtistContentInfoN(callCount);
-       ContentInformation* pContentInfo = __pPresentationModel->GetArtistAlbumContentInfoN(itemIndex);
-       if (pContentInfo != null)
-       {
-               CreateTableViewItem(*pItem, *pContentInfo);
-               delete pContentInfo;
-       }
+       r = CreateTableViewItem(*pItem, *pContentInfo);
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+       delete pContentInfo;
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       delete pContentInfo;
+       return null;
 }
 
 bool
@@ -731,11 +729,38 @@ ArtistContentListForm::OnAppControlCompleteResponseReceived(const AppId& appId,
        {
                if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
                {
-                       const String* pResultString = static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID)));
-
-                       AppLogDebug("%ls", pResultString->GetPointer());
-                       int contactId;
-                       Integer::Parse(*pResultString, contactId);
+                       int contactId = -1;
+                       String* pKey = null;
+                       ArrayList* pArrayListValue = null;
+                       String* pResultString = null;
+                       if (pExtraData != null)
+                       {
+                               IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
+                               while (pEnum->MoveNext() == E_SUCCESS)
+                               {
+                                       pKey = static_cast<String*>(pEnum->GetKey());
+                                       if (pKey->Equals(APPCONTROL_KEY_SOCIAL_ITEM_ID, true))
+                                       {
+                                               pArrayListValue = static_cast<ArrayList*>(pEnum->GetValue());
+                                               pResultString = static_cast<String*>(pArrayListValue->GetAt(0));
+                                               AppLogDebug("extraData : %ls:%ls", pKey->GetPointer(), pResultString->GetPointer());
+                                               Integer::Parse(*pResultString, contactId);
+                                               break;
+                                       }
+                               }
+                               delete pEnum;
+
+                               if (contactId < 0)
+                               {
+                                       AppLogDebug("pKey is invaild");
+                                       return;
+                               }
+                       }
+                       else
+                       {
+                               AppLogDebug("pExtraData is null");
+                               return;
+                       }
 
                        AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
                        Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
@@ -858,20 +883,23 @@ void
 ArtistContentListForm::SetItemCheckedAt(int groupIndex, bool check)
 {
        AppLogDebug("ENTER");
-       int groupItemCount = 0;
+       int groupItemCount = __pContentGroupedTableView->GetItemCountAt(groupIndex);
        if (check == true)
        {
                groupItemCount = __pContentGroupedTableView->GetItemCountAt(groupIndex);
+               for (int iCount= 0; iCount < groupItemCount; iCount++)
+               {
+                       __pContentGroupedTableView->SetItemChecked(groupIndex, iCount, check);
+                       SetItemChecked(groupIndex, iCount, check);
+               }
        }
        else
        {
-               __pCheckedItemCountMultiHashMap->GetCount(groupIndex, groupItemCount);
-       }
-
-       for (int iCount= 0; iCount < groupItemCount; iCount++)
-       {
-               __pContentGroupedTableView->SetItemChecked(groupIndex, iCount, check);
-               SetItemChecked(groupIndex, iCount, check);
+               __pCheckedItemCountMultiHashMap->Remove(groupIndex);
+               for (int iCount= 0; iCount < groupItemCount; iCount++)
+               {
+                       __pContentGroupedTableView->SetItemChecked(groupIndex, iCount, check);
+               }
        }
        AppLogDebug("EXIT");
 }
@@ -975,7 +1003,7 @@ result
 ArtistContentListForm::EventHandlerContextMenuItemMessageEmail(ContentInformation& contentInfo, Tizen::Base::String providerId)
 {
        AppLogDebug("ENTER");
-       if (!providerId.Equals(PROVIDER_ID_EMAIL, false) || !providerId.Equals(PROVIDER_ID_MESSAGE, false))
+       if (!providerId.Equals(PROVIDER_ID_EMAIL, false) && !providerId.Equals(PROVIDER_ID_MESSAGE, false))
        {
                AppLogDebug("worng providerId(%s)", providerId.GetPointer());
                return E_FAILURE;
@@ -1036,6 +1064,11 @@ ArtistContentListForm::RemoveConentCheckedAll(void)
        }
        delete pMapEnum;
 
+       SetItemCheckedAll(false);
+
+       __pPresentationModel->InitializeArtistAlbumList(__headerTitle);
+       __pPresentationModel->InitializeContentList(INIT_VALUE);
+
        AppLogDebug("EXIT");
        return E_SUCCESS;
 }
index a4a4744..75e8c11 100644 (file)
@@ -246,24 +246,29 @@ Tizen::Ui::Controls::TableViewItem*
 ArtistListEditorPanel::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
-       ContentInformation* pContentInfo = __pPresentationModel->GetArtistnIfoN(itemIndex);
-       if (pContentInfo == null)
-       {
-               return null;
-       }
-
        RelativeLayout layout;
        layout.Construct();
 
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+       ContentInformation* pContentInfo = __pPresentationModel->GetArtistnIfoN(itemIndex);
+
+       result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+       TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
+
+       r = CreateTableViewItem(*pItem, *pContentInfo);
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
-       CreateTableViewItem(*pItem, *pContentInfo);
        RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
        delete pContentInfo;
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       delete pContentInfo;
+       return null;
 }
 
 void
index 358aaf2..542f5ad 100644 (file)
@@ -207,14 +207,8 @@ ArtistListPanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSce
                                                                const Tizen::Ui::Scenes::SceneId& nextSceneId)
 {
        AppLogDebug("ENTER");
-       Form* pForm = dynamic_cast<Form*>(GetParent());
-       AppAssert(pForm);
-
-       Footer* pFooter = pForm->GetFooter();
-       pFooter->RemoveAllButtons();
-       pFooter->RemoveAllItems();
-       pFooter->RemoveActionEventListener(*this);
        CancelAllThumbnailRequest();
+       ContentLibaryPanel::OnSceneDeactivated(currentSceneId, nextSceneId);
        AppLogDebug("EXIT");
 }
 
@@ -234,27 +228,30 @@ Tizen::Ui::Controls::TableViewItem*
 ArtistListPanel::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
-       ContentInformation* pContentInfo = __pPresentationModel->GetArtistnIfoN(itemIndex);
-       if (pContentInfo == null)
-       {
-               AppLogDebug("EXIT");
-               return null;
-       }
-
        RelativeLayout layout;
        layout.Construct();
 
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       ContentInformation* pContentInfo = __pPresentationModel->GetArtistnIfoN(itemIndex);
 
-       CreateTableViewItem(*pItem, *pContentInfo, __pPresentationModel->GetArtistContentCount(itemIndex));
-       pItem->SetContextItem(__pContextItem);
+       result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+       TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
+
+       r = CreateTableViewItem(*pItem, *pContentInfo, __pPresentationModel->GetArtistContentCount(itemIndex));
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
+       pItem->SetContextItem(__pContextItem);
        RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
        delete pContentInfo;
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       delete pContentInfo;
+       return null;
 }
 
 void
index 12bedcb..122b888 100644 (file)
@@ -82,16 +82,24 @@ ArtistListPresentationModel::GetArtistContentCount(int artistIndex)
        AppLogDebug("ENTER");
        if (__pArtistList == null)
        {
+               AppLogDebug("EXIT");
                return INIT_VALUE;
        }
 
        if (__pArtistList->GetCount() == 0)
        {
+               AppLogDebug("EXIT");
                return INIT_VALUE;
        }
 
-       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
-                                                                               *(static_cast<String*>(__pArtistList->GetAt(artistIndex))), STRING_SORT_ARTIST, STRING_SORT_TITLE);
+       String* pContentFileName = static_cast<String*>(__pArtistList->GetAt(artistIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return INIT_VALUE;
+       }
+
+       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ARTIST, STRING_SORT_TITLE);
        if (pContentSearchResultList == null)
        {
                AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
@@ -113,6 +121,7 @@ ArtistListPresentationModel::GetArtistAlbumContentCount(int albumIndex)
        AppLogDebug("ENTER");
        if (__pArtistAlbumList == null)
        {
+               AppLogDebug("EXIT");
                return INIT_VALUE;
        }
 /*
@@ -123,8 +132,15 @@ ArtistListPresentationModel::GetArtistAlbumContentCount(int albumIndex)
        }
        else
 */
-       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
-                                                                               *(static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+
+       String* pContentFileName = static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return INIT_VALUE;
+       }
+
+       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
        if (pContentSearchResultList == null)
        {
                AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
@@ -176,8 +192,14 @@ ArtistListPresentationModel::GetArtistnIfoN(const int artistIndex)
                return null;
        }
 
-       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
-                                                                               *(static_cast<String*>(__pArtistList->GetAt(artistIndex))), STRING_SORT_ARTIST, STRING_SORT_TITLE);
+       String* pContentFileName = static_cast<String*>(__pArtistList->GetAt(artistIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return null;
+       }
+
+       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ARTIST, STRING_SORT_TITLE);
        if (pContentSearchResultList == null)
        {
                AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
@@ -208,8 +230,14 @@ ArtistListPresentationModel::GetArtistAlbumInfoN(const int albumIndex)
                return null;
        }
 
-       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
-                                                                               *(static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+       String* pContentFileName = static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return null;
+       }
+
+       IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
        if (pContentSearchResultList == null)
        {
                AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
@@ -331,10 +359,18 @@ ArtistListPresentationModel::InitializeContentList(int albumIndex)
        if (__pArtistAlbumContentList != null)
        {
                __pArtistAlbumContentList->RemoveAll(true);
+               delete __pArtistAlbumContentList;
+               __pArtistAlbumContentList = null;
+       }
+
+       String* pContentFileName = static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return;
        }
 
-       __pArtistAlbumContentList = CommonUtil::ContentSearchResultListN(
-                                                               *(static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+       __pArtistAlbumContentList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
        __currentArtistAlbumIndex = albumIndex;
        AppLogDebug("EXIT");
 }
@@ -369,10 +405,24 @@ ArtistListPresentationModel::RemoveArtistList(int artistIndex)
 
        if (__pArtistList == null)
        {
+               AppLogDebug("EXIT");
                return;
        }
-       pRemoveArtistList = CommonUtil::ContentSearchResultListN(
-                                                                       *(static_cast<String*>(__pArtistList->GetAt(artistIndex))), STRING_SORT_ARTIST, STRING_SORT_TITLE);
+
+       String* pContentFileName = static_cast<String*>(__pArtistList->GetAt(artistIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return;
+       }
+
+       pRemoveArtistList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ARTIST, STRING_SORT_TITLE);
+       if (pRemoveArtistList == null)
+       {
+               AppLogDebug("EXIT(pRemoveArtistList is null");
+               return;
+       }
+
        totalCount = pRemoveArtistList->GetCount();
        for (int iCount = 0; iCount < totalCount; iCount++)
        {
@@ -381,9 +431,7 @@ ArtistListPresentationModel::RemoveArtistList(int artistIndex)
                {
                        pContentInformation = CommonUtil::GetContentInformationN(*static_cast<AudioContentInfo*>(pResult->GetContentInfo()));
                        contentManager.DeleteContent(pContentInformation->contentId);
-
                        delete pContentInformation;
-                       pContentInformation = null;
                }
        }
 
@@ -398,6 +446,7 @@ ArtistListPresentationModel::GetArtistName(int artistIndex)
        AppLogDebug("ENTER");
        if (__pArtistList == null)
        {
+               AppLogDebug("EXIT");
                return null;
        }
 
@@ -412,6 +461,14 @@ ArtistListPresentationModel::GetContentPathListN(int index, SearchMode mode)
 
        if (__pArtistList == null)
        {
+               AppLogDebug("EXIT");
+               return null;
+       }
+
+       String* pContentFileName = static_cast<String*>(__pArtistList->GetAt(index));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
                return null;
        }
 
@@ -420,15 +477,13 @@ ArtistListPresentationModel::GetContentPathListN(int index, SearchMode mode)
        {
        case SEARCH_MODE_ARTIST:
                {
-                       pContentSearchResultList = CommonUtil::ContentSearchResultListN(
-                                       *(static_cast<String*>(__pArtistList->GetAt(index))), STRING_SORT_ARTIST, STRING_SORT_TITLE);
+                       pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ARTIST, STRING_SORT_TITLE);
                }
                break;
 
        case SEARCH_MODE_ARTIST_ALBUM:
                {
-                       pContentSearchResultList = CommonUtil::ContentSearchResultListN(
-                                       *(static_cast<String*>(__pArtistAlbumList->GetAt(index))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+                       pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
                }
                break;
 
@@ -493,19 +548,26 @@ ArtistListPresentationModel::RefreshContentList(int albumIndex)
        {
                __pArtistAlbumContentList->RemoveAll(true);
                delete __pArtistAlbumContentList;
+               __pArtistAlbumContentList = null;
        }
 
-       __pArtistAlbumContentList = CommonUtil::ContentSearchResultListN(
-                                                                               *(static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+       __currentArtistAlbumIndex = albumIndex;
+
+       String* pContentFileName = static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex));
+       if (pContentFileName == null)
+       {
+               AppLogDebug("EXIT(pContentFileName is null");
+               return;
+       }
 
+       __pArtistAlbumContentList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
        if (__pArtistAlbumContentList != null && __pArtistAlbumContentList->GetCount() == INIT_VALUE)
        {
                __pArtistAlbumContentList->RemoveAll(true);
                delete __pArtistAlbumContentList;
                __pArtistAlbumContentList = null;
-               AppLogDebug(" __pArtistAlbumContentList->GetCount() is zero");
+               AppLogDebug("__pArtistAlbumContentList->GetCount() is zero");
        }
-       __currentArtistAlbumIndex = albumIndex;
        AppLogDebug("EXIT");
 }
 
index 555aa2a..025bb95 100644 (file)
@@ -563,22 +563,6 @@ CommonUtil::SetFastScrollIndex(Tizen::Ui::Controls::TableView& tableview)
 }
 
 void
-CommonUtil::SetLayoutFitToForm(const Tizen::Ui::Controls::Form& form, Tizen::Ui::Control& childControl)
-{
-       AppLogDebug("ENTER");
-       RelativeLayout* pLayout = dynamic_cast<RelativeLayout*>(form.GetPortraitLayoutN());
-       pLayout->SetHorizontalFitPolicy(childControl, FIT_POLICY_PARENT);
-       pLayout->SetVerticalFitPolicy(childControl, FIT_POLICY_PARENT);
-       delete pLayout;
-
-       pLayout = dynamic_cast<RelativeLayout*>(form.GetLandscapeLayoutN());
-       pLayout->SetHorizontalFitPolicy(childControl, FIT_POLICY_PARENT);
-       pLayout->SetVerticalFitPolicy(childControl, FIT_POLICY_PARENT);
-       delete pLayout;
-       AppLogDebug("EXIT");
-}
-
-void
 CommonUtil::SetLayoutFitToContainer(const Tizen::Ui::Container& container, Tizen::Ui::Control& childControl)
 {
        AppLogDebug("ENTER");
@@ -879,30 +863,6 @@ CommonUtil::CreateFlickMenuN(Tizen::Ui::IActionEventListener& listener, FlickMen
        return pFlickMenuPanel;
 }
 
-void
-CommonUtil::SetTextItemSelectedBalloonPopup(Tizen::Ui::Controls::Label& itemSelectedBalloonPopup, int itemCount)
-{
-       AppLogDebug("ENTER");
-       String StrSelectStr = null;
-
-       if (itemCount > INIT_VALUE)
-       {
-               String ResSelect = ResourceManager::GetString("IDS_COM_BODY_SELECTED");
-               ResSelect.Append(L"(%d)");
-
-               StrSelectStr.Format(STRING_LENGTH, ResSelect.GetPointer(), itemCount);
-       }
-       else
-       {
-               StrSelectStr.Format(STRING_LENGTH,L"Select <Noun>s");//NEED STRING
-       }
-
-       itemSelectedBalloonPopup.SetText(StrSelectStr);
-       itemSelectedBalloonPopup.SetTextHorizontalAlignment(ALIGNMENT_LEFT);
-       itemSelectedBalloonPopup.Invalidate(true);
-       AppLogDebug("EXIT");
-}
-
 Tizen::Base::String
 CommonUtil::GetStringItemSelectd(int itemCount)
 {
@@ -1985,29 +1945,6 @@ CommonUtil::SetButtonEnabled(const Tizen::Ui::Controls::Form& form, int checkedI
        AppLogDebug("EXIT");
 }
 
-void
-CommonUtil::ShowNoContentImage(int contentTotal, Tizen::Ui::Controls::TableView& contentTableView, Tizen::Ui::Controls::Label& contentImageLabel, Tizen::Ui::Controls::Label& contentTextLabel)
-{
-       AppLogDebug("ENTER");
-       if (contentTotal == 0)
-       {
-               contentTableView.SetShowState(false);
-               contentImageLabel.SetShowState(true);
-               contentTextLabel.SetShowState(true);
-       }
-       else
-       {
-               contentTableView.SetShowState(true);
-               contentImageLabel.SetShowState(false);
-               contentTextLabel.SetShowState(false);
-       }
-
-       contentTableView.Invalidate(true);
-       contentImageLabel.Invalidate(true);
-       contentTextLabel.Invalidate(true);
-       AppLogDebug("EXIT");
-}
-
 Bitmap*
 CommonUtil::GetColorizedBitmapN(const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Color& color)
 {
index 08e46b6..09bb4be 100644 (file)
@@ -220,7 +220,7 @@ ComposerListPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousS
                int totalComposerCount = __pPresentationModel->GetAllComposerCount();
                CommonUtil::SetButtonEnabled(*pForm, totalComposerCount, IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
 
-               CommonUtil::ShowNoContentImage(totalComposerCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+//             CommonUtil::ShowNoContentImage(totalComposerCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
        }
        AppLogDebug("EXIT");
 }
index f900ab7..dc24709 100644 (file)
@@ -60,7 +60,7 @@ ComposerPickerPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previou
        __pPresentationModel->UpdateComposerList();
        if (__pPresentationModel != null)
        {
-               CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllComposerCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+//             CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllComposerCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
        }
 
        if (pSceneManager->IsSceneAlive(IDSCN_PLAYER))
index 56773ef..0dce5c3 100644 (file)
@@ -181,11 +181,18 @@ ContentLibaryPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previous
        if (IsExistMiniPlayer() == true)\r
        {\r
                MiniPlayer* pMiniPlayer = static_cast<MiniPlayer*>(__pMiniPlayerRegisterBar->GetControl(IDL_MINI_PLYAER_PANEL));\r
-               pMiniPlayer->MiniPlayerActivate();\r
-               SetShowStateFooter(false);\r
+               if (IsFailed(pMiniPlayer->MiniPlayerActivate()))\r
+               {\r
+                       RemoveMiniPlayer();\r
+               }\r
+               else\r
+               {\r
+                       SetShowStateFooter(false);\r
+               }\r
        }\r
+\r
        UpdateContentLibaryScreenState();\r
-       AppLogDebug("EXIT");\r
+       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));\r
 }\r
 \r
 void\r
index 0eb426f..283106e 100644 (file)
@@ -374,30 +374,33 @@ FolderContentListForm::CreateItem(const int itemIndex, int itemWidth)
        AppLogDebug("ENTER");
        RelativeLayout layout;
        layout.Construct();
-       TableViewItem* pItem = new (std::nothrow) TableViewItem();
 
-       TableViewAnnexStyle tableViewAnnexStyle  = TABLE_VIEW_ANNEX_STYLE_NORMAL;
+       TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
        if (GetScreenState() != SCREEN_STATE_NORMAL)
        {
                tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
        }
 
-       if (IsFailed(pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle)))
-       {
-               AppLogDebug("Construct(Dimension(itemWidth, ITEM_HEIGHT) failed(%s)", GetErrorMessage(GetLastResult()));
-               return null;
-       }
-
+       TableViewItem* pItem = new (std::nothrow) TableViewItem();
        ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
-       if (pContentInfo != null)
-       {
-               CreateTableViewItem(*pItem, *pContentInfo);
-               RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
-               delete pContentInfo;
-       }
+
+       result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+       TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
+
+       r = CreateTableViewItem(*pItem, *pContentInfo);
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
+       RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
+       delete pContentInfo;
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       delete pContentInfo;
+       return null;
 }
 
 void
@@ -599,11 +602,38 @@ FolderContentListForm::OnAppControlCompleteResponseReceived(const AppId& appId,
        {
                if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
                {
-                       const String* pResultString = static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID)));
+                       int contactId = -1;
+                       String* pKey = null;
+                       ArrayList* pArrayListValue = null;
+                       String* pResultString = null;
+                       if (pExtraData != null)
+                       {
+                               IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
+                               while (pEnum->MoveNext() == E_SUCCESS)
+                               {
+                                       pKey = static_cast<String*>(pEnum->GetKey());
+                                       if (pKey->Equals(APPCONTROL_KEY_SOCIAL_ITEM_ID, true))
+                                       {
+                                               pArrayListValue = static_cast<ArrayList*>(pEnum->GetValue());
+                                               pResultString = static_cast<String*>(pArrayListValue->GetAt(0));
+                                               AppLogDebug("extraData : %ls:%ls", pKey->GetPointer(), pResultString->GetPointer());
+                                               Integer::Parse(*pResultString, contactId);
+                                               break;
+                                       }
+                               }
+                               delete pEnum;
 
-                       AppLogDebug("%ls", pResultString->GetPointer());
-                       int contactId;
-                       Integer::Parse(*pResultString, contactId);
+                               if (contactId < 0)
+                               {
+                                       AppLogDebug("pKey is invaild");
+                                       return;
+                               }
+                       }
+                       else
+                       {
+                               AppLogDebug("pExtraData is null");
+                               return;
+                       }
 
                        AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
                        Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
index d4aa8f9..e74a4bd 100644 (file)
@@ -247,64 +247,22 @@ Tizen::Ui::Controls::TableViewItem*
 FolderListEditorPanel::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
-       String* pContentPath = __pPresentationModel->GetFolderPath(itemIndex);
-       Bitmap* StorageIconBitmap = null;
-       String strFolderName = null;
-
-       int folderNamePosition = 0;
-       pContentPath->LastIndexOf(IDS_SEPARATOR_SLASH, pContentPath->GetLength() - 1, folderNamePosition);
-       pContentPath->SubString(folderNamePosition + 1, strFolderName);
-
-       if (pContentPath->Contains(IDS_STORAGE_PHONE_PATH))
-       {
-               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
-       }
-       else if (pContentPath->Contains(IDS_STORAGE_SDCARD_PATH))
-       {
-               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_SDCARD);
-       }
-       else if (pContentPath->Contains(IDS_STORAGE_EXTERNAL_PATH))
-       {
-               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_EXTERNAL);
-       }
-       else
-       {
-               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
-       }
-
-       Panel* pTableViewItem = new (std::nothrow) Panel();
-       if (IsFailed(pTableViewItem->Construct(IDL_CONTENT_LIBARY_FOLDER_EDITOR_ITEM_PANEL)))
-       {
-               AppLogDebug("Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
-               return null;
-       }
-
-       Label* pStorageIcon = static_cast<Label*>(pTableViewItem->GetControl(IDC_STORAGE_TYPE_ICON));
-       pStorageIcon->SetBackgroundBitmap(*StorageIconBitmap);
-       delete StorageIconBitmap;
-
-       Label* pFolderPath = static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_PATH));
-       String fullContentPath;
-       pContentPath->SubString(INIT_VALUE, folderNamePosition, fullContentPath);
-       pFolderPath->SetText(CommonUtil::SetHighDepthToEllipsisPath(fullContentPath));
-
-       Label* pFolderName = static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_NAME));
-       pFolderName->SetText(strFolderName);
-
-       Label* pFolderItemCount = static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_ITEM_COUNT));
-       pFolderItemCount->SetText(CommonUtil::SetSongsString(__pPresentationModel->GetContentCount(itemIndex)));
-
        RelativeLayout layout;
        layout.Construct();
+
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+       result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
 
-       pItem->AddControl(*pTableViewItem);
-       pItem->SetIndividualSelectionEnabled(pTableViewItem, true);
-       CommonUtil::SetLayoutFitToContainer(*pItem, *pTableViewItem);
+       r = CreateTableViewItem(*pItem, *__pPresentationModel->GetFolderPath(itemIndex), __pPresentationModel->GetContentCount(itemIndex));
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       return null;
 }
 
 bool
@@ -510,4 +468,56 @@ FolderListEditorPanel::SetDisableIconAllCheckButton(void)
        pHeader->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);
        pHeader->Invalidate(true);
        AppLogDebug("EXIT");
+}
+
+result
+FolderListEditorPanel::CreateTableViewItem(Tizen::Ui::Container& parent, const Tizen::Base::String& contentPath, int contentCount)
+{
+       AppLogDebug("ENTER");
+       Bitmap* StorageIconBitmap = null;
+       String strFolderName = null;
+
+       int folderNamePosition = 0;
+       contentPath.LastIndexOf(IDS_SEPARATOR_SLASH, contentPath.GetLength() - 1, folderNamePosition);
+       contentPath.SubString(folderNamePosition + 1, strFolderName);
+
+       if (contentPath.Contains(IDS_STORAGE_PHONE_PATH))
+       {
+               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
+       }
+       else if (contentPath.Contains(IDS_STORAGE_SDCARD_PATH))
+       {
+               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_SDCARD);
+       }
+       else if (contentPath.Contains(IDS_STORAGE_EXTERNAL_PATH))
+       {
+               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_EXTERNAL);
+       }
+       else
+       {
+               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
+       }
+
+       Panel* pTableViewItem = new (std::nothrow) Panel();
+       if (IsFailed(pTableViewItem->Construct(IDL_CONTENT_LIBARY_FOLDER_EDITOR_ITEM_PANEL)))
+       {
+               AppLogDebug("Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
+               return null;
+       }
+
+       static_cast<Label*>(pTableViewItem->GetControl(IDC_STORAGE_TYPE_ICON))->SetBackgroundBitmap(*StorageIconBitmap);
+       delete StorageIconBitmap;
+
+       String fullContentPath;
+       contentPath.SubString(INIT_VALUE, folderNamePosition, fullContentPath);
+       static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_PATH))->SetText(CommonUtil::SetHighDepthToEllipsisPath(fullContentPath));
+
+       static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_NAME))->SetText(strFolderName);
+       static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_ITEM_COUNT))->SetText(CommonUtil::SetSongsString(contentCount));
+
+       parent.AddControl(*pTableViewItem);
+       CommonUtil::SetLayoutFitToContainer(parent, *pTableViewItem);
+
+       AppLogDebug("EXIT");
+       return E_SUCCESS;
 }
\ No newline at end of file
index f94e2d0..248a38f 100644 (file)
@@ -200,60 +200,23 @@ Tizen::Ui::Controls::TableViewItem*
 FolderListPanel::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
-       String* pContentPath = __pPresentationModel->GetFolderPath(itemIndex);
-       Bitmap* StorageIconBitmap = null;
-       String strFolderName = null;
-
-       int folderNamePosition = 0;
-       pContentPath->LastIndexOf(IDS_SEPARATOR_SLASH, pContentPath->GetLength() - 1, folderNamePosition);
-       pContentPath->SubString(folderNamePosition + 1, strFolderName);
-
-       if (pContentPath->Contains(IDS_STORAGE_PHONE_PATH))
-       {
-               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
-       }
-       else if (pContentPath->Contains(IDS_STORAGE_SDCARD_PATH))
-       {
-               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_SDCARD);
-       }
-       else if (pContentPath->Contains(IDS_STORAGE_EXTERNAL_PATH))
-       {
-               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_EXTERNAL);
-       }
-       else
-       {
-               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
-       }
-
-       Panel* pTableViewItem = new (std::nothrow) Panel();
-       if (IsFailed(pTableViewItem->Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL)))
-       {
-               AppLogDebug("Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
-               return null;
-       }
-
-       static_cast<Label*>(pTableViewItem->GetControl(IDC_STORAGE_TYPE_ICON))->SetBackgroundBitmap(*StorageIconBitmap);
-       delete StorageIconBitmap;
-
-       String fullContentPath;
-       pContentPath->SubString(INIT_VALUE, folderNamePosition, fullContentPath);
-       static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_PATH))->SetText(CommonUtil::SetHighDepthToEllipsisPath(fullContentPath));
-
-       static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_NAME))->SetText(strFolderName);
-       static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_ITEM_COUNT))->SetText(CommonUtil::SetSongsString(__pPresentationModel->GetContentCount(itemIndex)));
-
        RelativeLayout layout;
        layout.Construct();
 
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
 
-       pItem->AddControl(*pTableViewItem);
-       CommonUtil::SetLayoutFitToContainer(*pItem, *pTableViewItem);
+       r = CreateTableViewItem(*pItem, *__pPresentationModel->GetFolderPath(itemIndex), __pPresentationModel->GetContentCount(itemIndex));
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
        pItem->SetContextItem(__pContextItem);
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       return null;
 }
 
 void
@@ -366,4 +329,56 @@ FolderListPanel::IsEmptyContentList(void)
        }
        AppLogDebug("EXIT");
        return false;
+}
+
+result
+FolderListPanel::CreateTableViewItem(Tizen::Ui::Container& parent, const Tizen::Base::String& contentPath, int contentCount)
+{
+       AppLogDebug("ENTER");
+       Bitmap* StorageIconBitmap = null;
+       String strFolderName = null;
+
+       int folderNamePosition = 0;
+       contentPath.LastIndexOf(IDS_SEPARATOR_SLASH, contentPath.GetLength() - 1, folderNamePosition);
+       contentPath.SubString(folderNamePosition + 1, strFolderName);
+
+       if (contentPath.Contains(IDS_STORAGE_PHONE_PATH))
+       {
+               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
+       }
+       else if (contentPath.Contains(IDS_STORAGE_SDCARD_PATH))
+       {
+               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_SDCARD);
+       }
+       else if (contentPath.Contains(IDS_STORAGE_EXTERNAL_PATH))
+       {
+               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_EXTERNAL);
+       }
+       else
+       {
+               StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
+       }
+
+       Panel* pTableViewItem = new (std::nothrow) Panel();
+       if (IsFailed(pTableViewItem->Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL)))
+       {
+               AppLogDebug("Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
+               return null;
+       }
+
+       static_cast<Label*>(pTableViewItem->GetControl(IDC_STORAGE_TYPE_ICON))->SetBackgroundBitmap(*StorageIconBitmap);
+       delete StorageIconBitmap;
+
+       String fullContentPath;
+       contentPath.SubString(INIT_VALUE, folderNamePosition, fullContentPath);
+       static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_PATH))->SetText(CommonUtil::SetHighDepthToEllipsisPath(fullContentPath));
+
+       static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_NAME))->SetText(strFolderName);
+       static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_ITEM_COUNT))->SetText(CommonUtil::SetSongsString(contentCount));
+
+       parent.AddControl(*pTableViewItem);
+       CommonUtil::SetLayoutFitToContainer(parent, *pTableViewItem);
+
+       AppLogDebug("EXIT");
+       return E_SUCCESS;
 }
\ No newline at end of file
index 08d7fad..7b137b9 100644 (file)
@@ -267,8 +267,13 @@ ContentInformation*
 FolderListPresentationModel::GetContentInfoN(int contentIndex)
 {
        AppLogDebug("ENTER");
-       ContentInformation* pContentInfoStruct = null;
+       if (__pContentList == null || contentIndex < INIT_VALUE)
+       {
+               AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pContentList is null)", contentIndex);
+               return null;
+       }
 
+       ContentInformation* pContentInfoStruct = null;
        ContentInfo* pContentInfo = static_cast<ContentInfo*>(__pContentList->GetAt(contentIndex));
        if (pContentInfo != null && pContentInfo->GetContentType() == CONTENT_TYPE_AUDIO)
        {
index 223cddd..300f676 100644 (file)
@@ -220,7 +220,7 @@ GenreListPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousScen
                int totalGenreCount = __pPresentationModel->GetAllGenreCount();
                CommonUtil::SetButtonEnabled(*pForm, totalGenreCount, IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
 
-               CommonUtil::ShowNoContentImage(totalGenreCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+//             CommonUtil::ShowNoContentImage(totalGenreCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
        }
        if (pArgs != null)
        {
index 4493b02..2abcc5c 100644 (file)
@@ -60,7 +60,7 @@ GenrePickerPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSc
        __pPresentationModel->UpdateGnereList();
        if (__pPresentationModel != null)
        {
-               CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllGenreCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+//             CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllGenreCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
        }
 
        if (pSceneManager->IsSceneAlive(IDSCN_PLAYER))
index 1769fb8..931c4c7 100644 (file)
@@ -527,13 +527,16 @@ MiniPlayer::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graph
        AppLogDebug("EXIT");\r
 }\r
 \r
-void\r
+result\r
 MiniPlayer::MiniPlayerActivate(void)\r
 {\r
        AppLogDebug("ENTER");\r
-//     if (__pPlayerPresentationModel->GetContentListCount() == INIT_VALUE)\r
-//     {\r
-//     }\r
+       result r = SetContentInfo(__pPresentationModel->GetCurrentContentIndex());\r
+       if (IsFailed(r))\r
+       {\r
+               AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));\r
+               return r;\r
+       }\r
 \r
        switch (__pPresentationModel->GetPlayerState())\r
        {\r
@@ -553,10 +556,11 @@ MiniPlayer::MiniPlayerActivate(void)
                break;\r
        }\r
 \r
-       SetContentInfo(__pPresentationModel->GetCurrentContentIndex());\r
        __pProgressBar->SetValue(__pPresentationModel->GetPlayPosition());\r
        __pPresentationModel->AddMusicPlayerEventListener(*this);\r
+\r
        AppLogDebug("EXIT");\r
+       return E_SUCCESS;\r
 }\r
 \r
 void\r
@@ -574,7 +578,6 @@ MiniPlayer::SetContentInfo(int currentContentIndex)
        ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(currentContentIndex);\r
        if (pContentInfo == null)\r
        {\r
-               AppLogDebug("__pPresentationModel->GetContentInfoN(currentContentIndex) failed");\r
                AppLogDebug("__pPlayerPresentationModel->GetContentInfoN is null");\r
                return E_FAILURE;\r
        }\r
index 29b699a..d8902fc 100644 (file)
@@ -1035,31 +1035,29 @@ Tizen::Ui::Controls::TableViewItem*
 PlayerForm::CreateItem(int index, int itemWidth)
 {
        AppLogDebug("ENTER");
-       ContentInformation* pContentInfo = __pPlayerPresentationModel->GetContentInfoN(index);
-       if (pContentInfo == null)
-       {
-               return null;
-       }
-
        RelativeLayout layout;
        layout.Construct();
 
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
+       ContentInformation* pContentInfo = __pPlayerPresentationModel->GetContentInfoN(index);
+
        result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-       if (IsFailed(r))
-       {
-               AppLogDebug("EXIT(%s)", GetErrorMessage(r));
-               delete pContentInfo;
-               delete pItem;
-               return null;
-       }
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+       TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
+
+       r = CreateTableViewItem(*pItem, *pContentInfo);
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
-       CreateTableViewItem(*pItem, *pContentInfo);
        RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(index)));
        delete pContentInfo;
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       delete pContentInfo;
+       return null;
 }
 
 bool
index 974f47b..03af0ac 100644 (file)
@@ -580,70 +580,77 @@ ContentInformation*
 PlayerPresentationModel::GetContentInfoN(int contentIndex)
 {
        AppLogDebug("ENTER");
-       Tizen::Base::String contentPath = *static_cast<String*>(__pPlayContentList->GetAt(contentIndex));
+       if (__pPlayContentList == null || contentIndex < INIT_VALUE)
+       {
+               AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pPlayContentList is null)", contentIndex);
+               return null;
+       }
 
+       Tizen::Base::String contentPath = *static_cast<String*>(__pPlayContentList->GetAt(contentIndex));
        if (File::IsFileExist(contentPath) == false)
        {
+               AppLogDebug("EXIT");
                return null;
        }
-       ContentInformation* pContentInfoStruct = new (std::nothrow) ContentInformation();
+
+       ContentInformation* pContentInfo = new (std::nothrow) ContentInformation();
        AudioContentInfo* pAudioContentInfo = CommonUtil::GetAudioContentInfoN(contentPath);
        if (pAudioContentInfo != null)
        {
                if (pAudioContentInfo->GetArtist() == null)
                {
-                       pContentInfoStruct->ArtistName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
+                       pContentInfo->ArtistName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
                }
                else
                {
-                       pContentInfoStruct->ArtistName = pAudioContentInfo->GetArtist();
+                       pContentInfo->ArtistName = pAudioContentInfo->GetArtist();
                }
 
                if (pAudioContentInfo->GetTitle() == null)
                {
-                       pContentInfoStruct->TitleName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
+                       pContentInfo->TitleName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
                }
                else
                {
-                       pContentInfoStruct->TitleName = pAudioContentInfo->GetTitle();
+                       pContentInfo->TitleName = pAudioContentInfo->GetTitle();
                }
-               pContentInfoStruct->Duration  = pAudioContentInfo->GetDuration();/*__pPlayer->GetDuration();*/
-               if (__pPlayer != null && pContentInfoStruct->Duration == null)
+               pContentInfo->Duration  = pAudioContentInfo->GetDuration();/*__pPlayer->GetDuration();*/
+               if (__pPlayer != null && pContentInfo->Duration == null)
                {
                        __pPlayer->GetDuration();
                }
-               pContentInfoStruct->contentId = pAudioContentInfo->GetContentId();
+               pContentInfo->contentId = pAudioContentInfo->GetContentId();
        }
        else
        {
                Tizen::Content::AudioMetadata* pAudioMeta = Tizen::Content::ContentManagerUtil::GetAudioMetaN(*static_cast<String*>(__pPlayContentList->GetAt(contentIndex)));
                if (pAudioMeta == null)
                {
-                       delete pContentInfoStruct;
+                       delete pContentInfo;
                        return null;
                }
 
                if (pAudioMeta->GetArtist() == null)
                {
-                       pContentInfoStruct->ArtistName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
+                       pContentInfo->ArtistName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
                }
                else
                {
-                       pContentInfoStruct->ArtistName = pAudioMeta->GetArtist();
+                       pContentInfo->ArtistName = pAudioMeta->GetArtist();
                }
 
                if (pAudioMeta->GetTitle() == null)
                {
-                       pContentInfoStruct->TitleName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
+                       pContentInfo->TitleName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
                }
                else
                {
-                       pContentInfoStruct->TitleName = pAudioMeta->GetTitle();
+                       pContentInfo->TitleName = pAudioMeta->GetTitle();
                }
 
                if (__pPlayer != null)
                {
-                       pContentInfoStruct->Duration = __pPlayer->GetDuration();
+                       pContentInfo->Duration = __pPlayer->GetDuration();
                }
 
                delete pAudioMeta;
@@ -651,7 +658,7 @@ PlayerPresentationModel::GetContentInfoN(int contentIndex)
 
        delete pAudioContentInfo;
        AppLogDebug("EXIT");
-       return pContentInfoStruct;
+       return pContentInfo;
 }
 
 Tizen::Graphics::Bitmap*
index b0a66ab..125cbb1 100644 (file)
@@ -259,35 +259,32 @@ PlaylistContentListForm::CreateItem(const int itemIndex, int itemWidth)
        RelativeLayout layout;
        layout.Construct();
 
-       TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       TableViewAnnexStyle tableViewAnnexStyle  = TABLE_VIEW_ANNEX_STYLE_NORMAL;
+       TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
        if (GetScreenState() != SCREEN_STATE_NORMAL)
        {
                tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
        }
 
+       TableViewItem* pItem = new (std::nothrow) TableViewItem();
+       ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
+
        result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle);
-       if (IsFailed(r))
-       {
-               AppLogDebug("pItem->Construct() failed(%s)", GetErrorMessage(r));
-               delete pItem;
-               return null;
-       }
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+       TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
 
-       ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
-       if (pContentInfo == null)
-       {
-               AppLogDebug("__pPresentationModel->GetContentInfoN failed(null)");
-               delete pItem;
-               return null;
-       }
+       r = CreateTableViewItem(*pItem, *pContentInfo);
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
-       CreateTableViewItem(*pItem, *pContentInfo);
        RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
        delete pContentInfo;
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       delete pContentInfo;
+       return null;
 }
 
 void
index d8e7282..d382fb9 100644 (file)
@@ -141,25 +141,25 @@ PlaylistCreatorForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previou
                int lastNum = 0;
                for (int i = 0; i < totalPlaylistCount; i++)
                {
-                       String* pStr = __pPlaylistEditorPresentationModel->GetPlayListNameN(i);
-                       if (pStr->GetLength() >= PlayListName.GetLength())
+                       String currentPlayListName = __pPlaylistEditorPresentationModel->GetPlayListName(i);
+                       if (currentPlayListName.GetLength() >= PlayListName.GetLength())
                        {
                                String pCompareStr = null;
-                               pStr->SubString(0, PlayListName.GetLength(), pCompareStr);
+                               currentPlayListName.SubString(0, PlayListName.GetLength(), pCompareStr);
                                if (pCompareStr.Equals(PlayListName, true))
                                {
                                        String pLastStr = null;
                                        wchar_t ch;
-                                       for (int index = pStr->GetLength()-1; index >= 0; index--)
+                                       for (int index = currentPlayListName.GetLength()-1; index >= 0; index--)
                                        {
-                                               pStr->GetCharAt(index, ch);
+                                               currentPlayListName.GetCharAt(index, ch);
                                                if (Character::IsDigit(ch))
                                                {
                                                        continue;
                                                }
                                                else
                                                {
-                                                       pStr->SubString(index + 1, pStr->GetLength() - (index + 1), pLastStr);
+                                                       currentPlayListName.SubString(index + 1, currentPlayListName.GetLength() - (index + 1), pLastStr);
                                                        break;
                                                }
                                        }
index 1792916..46c5ef1 100644 (file)
@@ -105,20 +105,33 @@ PlaylistEditorPresentationModel::GetAllPlayListNameN(void)
 //     StringComparer strComparer;
 //     pTempList->Sort(strComparer);
        AppLogDebug("EXIT");
-//     return pTempList;
        return PlayListManager::GetInstance()->GetAllPlayListNameN();
 }
 
-Tizen::Base::String*
-PlaylistEditorPresentationModel::GetPlayListNameN(int playlistIndex)
+Tizen::Base::String
+PlaylistEditorPresentationModel::GetPlayListName(int playlistIndex)
 {
        AppLogDebug("ENTER");
-//     IList* pTempList = PlayListManager::GetInstance()->GetAllPlayListNameN();
-//     StringComparer strComparer;
-//     pTempList->Sort(strComparer);
+       IList* pList = PlayListManager::GetInstance()->GetAllPlayListNameN();
+       if (pList == null)
+       {
+               AppLogDebug("EXIT");
+               return String(L"");
+       }
+
+        String* pPlayListName = static_cast<String*>(pList->GetAt(playlistIndex));
+        if (pPlayListName == null)
+        {
+                AppLogDebug("EXIT(pPlayListName is null)");
+                return String(L"");
+        }
+
+        String playListName(*pPlayListName);
+        pList->RemoveAll();
+        delete pList;
+
        AppLogDebug("EXIT");
-//     return static_cast<String*>(pTempList->GetAt(playlistIndex));
-       return static_cast<String*>(PlayListManager::GetInstance()->GetAllPlayListNameN()->GetAt(playlistIndex));
+       return playListName;
 }
 
 result
@@ -131,16 +144,13 @@ PlaylistEditorPresentationModel::SetPlayListName(const Tizen::Base::String& oldP
        {
                PlayList* pPlaylist = PlayListManager::GetInstance()->GetPlayListN(oldPlayListName);
                r = pPlaylist->SetPlayListName(newPlayListName);
-
                delete pPlaylist;
-               pPlaylist = null;
        }
        else
        {
                PlayList* pPlaylist = new (std::nothrow) PlayList();
                r = pPlaylist->Construct(newPlayListName);
                delete pPlaylist;
-               pPlaylist = null;
        }
 
        AppLogDebug("EXIT");
index 3e846e6..ce93916 100644 (file)
@@ -126,7 +126,7 @@ PlaylistListEditorPanel::OnActionPerformed(const Tizen::Ui::Control& source, int
                        {
                                if (__pContentTableView->IsItemChecked(index) == true)
                                {
-                                       pTempList->Add(*(new (std::nothrow) String(*__pPresentationModel->GetPlayListNameN(index))));
+                                       pTempList->Add(*(new (std::nothrow) String(__pPresentationModel->GetPlayListName(index))));
                                        __pContentTableView->RefreshItem(index, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE);
                                }
                        }
@@ -246,70 +246,39 @@ Tizen::Ui::Controls::TableViewItem*
 PlaylistListEditorPanel::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
-       AppLogDebug("%d", itemIndex);
        RelativeLayout layout;
        layout.Construct();
 
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+       Tizen::Base::String playlistName = __pPresentationModel->GetPlayListName(itemIndex);
+       Panel* pPanel = null;
 
-       Tizen::Base::String* playlistName = __pPresentationModel->GetPlayListNameN(itemIndex);
-       int playlistItemCount = __pPresentationModel->GetPlayListItemCount(*playlistName);
-       ContentId contentId = __pPresentationModel->GetPlayListItemContentId(*playlistName);
+       result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
 
-       Panel* pTableViewItem = new (std::nothrow) Panel();
-       if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_PLAYLIST_EDITOR_ITEM_PANEL)))
-       {
-               AppLogDebug("Construct(IDL_CONTENTS_LIBARY_EDITOR_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
-               return null;
-       }
-
-       static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_TITLE_NAME))->SetText(*playlistName);
-
-       String str = L"";
-       str.Append(itemIndex);
-
-       Button* pEditButton = static_cast<Button*>(pTableViewItem->GetControl(IDC_BUTTON_EDIT));
-       pEditButton->SetName(str);
-
-       Bitmap* pNormalBitmap = ResourceManager::GetBitmapN(L"00_button_rename_normal.png");
-       Bitmap* pPressedBitmap = ResourceManager::GetBitmapN(L"00_button_rename_press.png");
-       Bitmap* pBackgroundNormalBitmap = ResourceManager::GetBitmapN(L"00_btn_circle_bg_normal.png");
-       Bitmap* pBackgroundPressBitmap = ResourceManager::GetBitmapN(L"00_btn_circle_bg_press.png");
-
-       pEditButton->SetNormalBitmap(Point(0, 0), *pNormalBitmap);
-       pEditButton->SetNormalBackgroundBitmap(*pBackgroundNormalBitmap);
-       pEditButton->SetPressedBitmap(Point(0, 0), *pPressedBitmap);
-       pEditButton->SetPressedBackgroundBitmap(*pBackgroundPressBitmap);
-
-       pEditButton->SetActionId(IDA_RENAME_EDIT_BUTTON);
-       pEditButton->AddActionEventListener(*this);
-
-       delete pNormalBitmap;
-       delete pPressedBitmap;
-       delete pBackgroundNormalBitmap;
-       delete pBackgroundPressBitmap;
-
-       pItem->SetIndividualSelectionEnabled(pEditButton, true);
-       pItem->AddControl(*pTableViewItem);
-
-       CommonUtil::SetLayoutFitToContainer(*pItem, *pTableViewItem);
+       r = CreateTableViewItem(*pItem, playlistName, itemIndex);
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
-       if (playlistItemCount > 0 && !IsFailed(GetLastResult()))
+       pPanel = static_cast<Panel*>(pItem->GetControl(IDL_CONTENTS_PLAYLIST_EDITOR_ITEM_PANEL));
+       if (__pPresentationModel->GetPlayListItemCount(playlistName) > 0 && !IsFailed(GetLastResult()))
        {
-               static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*GetDefaultThumbnail());
-               RequestThumbnail(contentId, (new (std::nothrow) Integer(itemIndex)));
+               static_cast<Label*>(pPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*GetDefaultThumbnail());
+               RequestThumbnail(__pPresentationModel->GetPlayListItemContentId(playlistName), (new (std::nothrow) Integer(itemIndex)));
        }
        else
        {
                Bitmap* thumbnail = (ResourceManager::GetBitmapN(L"34_player_list_thum_noitems.png"));
                thumbnail->Scale(Dimension(W_THUMBNAIL, H_THUMBNAIL));
-               static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*thumbnail);
+               static_cast<Label*>(pPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*thumbnail);
                delete thumbnail;
        }
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       return null;
 }
 
 void
@@ -479,4 +448,48 @@ PlaylistListEditorPanel::GetCheckedItemCount(void)
        AppLogDebug("ENTER");
        AppLogDebug("EXIT");
        return __checkedItemCount;
+}
+
+result
+PlaylistListEditorPanel::CreateTableViewItem(Tizen::Ui::Controls::TableViewItem& parent, const Tizen::Base::String& title, int itemIndex)
+{
+       AppLogDebug("ENTER");
+       Panel* pTableViewItem = new (std::nothrow) Panel();
+       if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_PLAYLIST_EDITOR_ITEM_PANEL)))
+       {
+               AppLogDebug("Construct(IDL_CONTENTS_LIBARY_EDITOR_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
+               return E_FAILURE;
+       }
+
+       static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_TITLE_NAME))->SetText(title);
+
+       String str = L"";
+       str.Append(itemIndex);
+
+       Button* pEditButton = static_cast<Button*>(pTableViewItem->GetControl(IDC_BUTTON_EDIT));
+       pEditButton->SetName(str);
+
+       Bitmap* pNormalBitmap = ResourceManager::GetBitmapN(L"00_button_rename_normal.png");
+       Bitmap* pPressedBitmap = ResourceManager::GetBitmapN(L"00_button_rename_press.png");
+       Bitmap* pBackgroundNormalBitmap = ResourceManager::GetBitmapN(L"00_btn_circle_bg_normal.png");
+       Bitmap* pBackgroundPressBitmap = ResourceManager::GetBitmapN(L"00_btn_circle_bg_press.png");
+
+       pEditButton->SetNormalBitmap(Point(0, 0), *pNormalBitmap);
+       pEditButton->SetNormalBackgroundBitmap(*pBackgroundNormalBitmap);
+       pEditButton->SetPressedBitmap(Point(0, 0), *pPressedBitmap);
+       pEditButton->SetPressedBackgroundBitmap(*pBackgroundPressBitmap);
+
+       pEditButton->SetActionId(IDA_RENAME_EDIT_BUTTON);
+       pEditButton->AddActionEventListener(*this);
+
+       delete pNormalBitmap;
+       delete pPressedBitmap;
+       delete pBackgroundNormalBitmap;
+       delete pBackgroundPressBitmap;
+
+       parent.AddControl(*pTableViewItem);
+       CommonUtil::SetLayoutFitToContainer(parent, *pTableViewItem);
+
+       AppLogDebug("EXIT");
+       return E_SUCCESS;
 }
\ No newline at end of file
index 7d88e57..d37356f 100644 (file)
@@ -304,8 +304,9 @@ PlaylistListPanel::CreateItem(const int itemIndex, int itemWidth)
        RelativeLayout layout;
        layout.Construct();
 
-       TableViewItem* pTableItem = new (std::nothrow) TableViewItem();
-       pTableItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       TableViewItem* pItem = new (std::nothrow) TableViewItem();
+       result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
 
        if (itemIndex < USER_CONTENT)
        {
@@ -335,9 +336,12 @@ PlaylistListPanel::CreateItem(const int itemIndex, int itemWidth)
                }
 
                String bitmapResName[] = {"34_mostplayed.png", "34_recentlyplayed.png", "34_recentlyadded.png"};
-               CreateTableViewItem(*pTableItem, pDefaultPlaylistTitle, *(ResourceManager::GetBitmapN(bitmapResName[itemIndex])), NUM_NOT_DISPLAY_CONTENT_COUNT);
+               Bitmap* pBitmap = ResourceManager::GetBitmapN(bitmapResName[itemIndex]);
+               r = CreateTableViewItem(*pItem, pDefaultPlaylistTitle, *pBitmap, NUM_NOT_DISPLAY_CONTENT_COUNT);
+               TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
-               pTableItem->SetContextItem(__pContextItem_default);
+               pItem->SetContextItem(__pContextItem_default);
+               delete pBitmap;
        }
        else
        {
@@ -347,22 +351,28 @@ PlaylistListPanel::CreateItem(const int itemIndex, int itemWidth)
                ContentId contentId = __pPlaylistListPresentationModel->GetPlayListItemContentId(*playlistName);
                if (playlistItemCount > 0 && !IsFailed(GetLastResult()))
                {
-                       CreateTableViewItem(*pTableItem, *playlistName, *GetDefaultThumbnail(), playlistItemCount);
+                       r = CreateTableViewItem(*pItem, *playlistName, *GetDefaultThumbnail(), playlistItemCount);
+                       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
                        RequestThumbnail(contentId, (new (std::nothrow) Integer(itemIndex)));
                }
                else
                {
                        Bitmap* thumbnail = (ResourceManager::GetBitmapN(L"34_player_list_thum_noitems.png"));
                        thumbnail->Scale(Dimension(W_THUMBNAIL, H_THUMBNAIL));
-                       CreateTableViewItem(*pTableItem, *playlistName, *thumbnail, playlistItemCount);
+                       r = CreateTableViewItem(*pItem, *playlistName, *thumbnail, playlistItemCount);
+                       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
                        delete thumbnail;
                }
-
-               pTableItem->SetContextItem(__pContextItem_user);
+               pItem->SetContextItem(__pContextItem_user);
        }
 
        AppLogDebug("EXIT");
-       return pTableItem;
+       return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       return null;
 }
 
 bool
index c997654..3b053eb 100644 (file)
@@ -508,8 +508,9 @@ ContentInformation*
 PlaylistListPresentationModel::GetContentInfoN(int contentIndex)
 {
        AppLogDebug("ENTER");
-       if (__pContentList == null)
+       if (__pContentList == null || contentIndex < INIT_VALUE)
        {
+               AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pContentList is null)", contentIndex);
                return null;
        }
 
index e8232b6..e08483b 100644 (file)
@@ -246,18 +246,22 @@ Tizen::Ui::Controls::TableViewItem*
 PlayListPickerPopup::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
+       RelativeLayout layout;
+       layout.Construct();
+
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       if (pItem == null)
-       {
-               return null;
-       }
-       pItem->Construct(Dimension(itemWidth, HEIGHT_POPUP_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-//     pItem->SetBackgroundColor(Color(255, 255, 255));
+       result r = pItem->Construct(layout, Dimension(itemWidth, HEIGHT_POPUP_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
 
-       CreateTableViewItem(*pItem, *(__pPlaylistListPresentationModel->GetPlayListName(itemIndex)));
+       r = CreateTableViewItem(*pItem, *(__pPlaylistListPresentationModel->GetPlayListName(itemIndex)));
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       return null;
 }
 
 bool
index a506132..83eb416 100644 (file)
@@ -230,37 +230,50 @@ Tizen::Ui::Controls::TableViewItem*
 SearchForm::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
+       RelativeLayout layout;
+       layout.Construct();
+
+       ContentInformation* pContentInfo = null;
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       pItem->Construct(Dimension(itemWidth, H_GROUP_NAME), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-//     pItem->SetBackgroundColor(COLOR_ITEM);
+
+       result r = pItem->Construct(layout, Dimension(itemWidth, H_GROUP_NAME), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
 
        if (__pPresentationModel->GetArtistIndex() == itemIndex)
        {
-               CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_BODY_ARTISTS"));
+               r = CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_BODY_ARTISTS"));
+               TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
+               AppLogDebug("EXIT");
                return pItem;
        }
        else if (__pPresentationModel->GetAlbumIndex() == itemIndex)
        {
-               CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_BODY_ALBUMS"));
+               r = CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_BODY_ALBUMS"));
+               TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
+               AppLogDebug("EXIT");
                return pItem;
        }
        else if (__pPresentationModel->GetSongIndex() == itemIndex)
        {
-               CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_HEADER_SONGS"));
+               r = CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_HEADER_SONGS"));
+               TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
+               AppLogDebug("EXIT");
                return pItem;
        }
-
-       delete pItem;
-       pItem = null;
-
-       ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
-       if (pContentInfo == null)
+       else
        {
-               return null;
+               delete pItem;
        }
+
        pItem = new (std::nothrow) TableViewItem();
-       pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-//     pItem->SetBackgroundColor(COLOR_ITEM);
+       r = pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+
+       pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
+       TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
 
        if (itemIndex < __pPresentationModel->GetAlbumIndex())
        {
@@ -298,12 +311,15 @@ SearchForm::CreateItem(const int itemIndex, int itemWidth)
 
                pItem->AddControl(*pSongNameLabel);
        }
-
        delete pContentInfo;
-       pContentInfo = null;
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       delete pContentInfo;
+       return null;
 }
 
 bool
index fc86141..a4897b7 100644 (file)
@@ -214,8 +214,13 @@ ContentInformation*
 SearchPresentationModel::GetContentInfoN(int index)
 {
        AppLogDebug("ENTER");
-       ContentInformation* pContentInfoStruct = null;
+       if (__pSearchList == null || index < INIT_VALUE)
+       {
+               AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pSearchList is null)", index);
+               return null;
+       }
 
+       ContentInformation* pContentInfoStruct = null;
        ContentSearchResult* pResult = static_cast<ContentSearchResult*>(__pSearchList->GetAt(index));
        if (pResult->GetContentType() == CONTENT_TYPE_AUDIO)
        {
index 3299517..4096c52 100644 (file)
@@ -240,13 +240,13 @@ Tizen::Ui::Controls::TableViewItem*
 SetAsPopup::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
+       RelativeLayout layout;
+       layout.Construct();
+
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       if (pItem == null)
-       {
-               return null;
-       }
-       pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-//     pItem->SetBackgroundColor(COLOR_ITEM);
+
+       result r = pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
 
        if (itemIndex < SET_AS_END)
        {
@@ -268,10 +268,17 @@ SetAsPopup::CreateItem(const int itemIndex, int itemWidth)
                default:
                        break;
                }
-               CreateTableViewItem(*pItem, labelName);
+
+               r = CreateTableViewItem(*pItem, labelName);
+               TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
        }
+
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       return null;
 }
 
 bool
index 5cc1a0c..8f53301 100644 (file)
@@ -220,22 +220,21 @@ SettingForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
 Tizen::Ui::Controls::TableViewItem*
 SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
 {
-       AppLogDebug("ENTER %d %d", groupIndex, itemIndex);
+       AppLogDebug("ENTER");
        RelativeLayout layout;
        layout.Construct();
 
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
        Panel* pGroupTableViewItem =  new (std::nothrow) Panel();
 
-       if (IsFailed(pGroupTableViewItem->Construct(IDL_GROUPEDTABLEVIEW_ITEM_PANEL)))
-       {
-               AppLogDebug("Construct(IDL_SETTING_PLAYLIST_SET_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
-               return null;
-       }
+       result r = pGroupTableViewItem->Construct(IDL_GROUPEDTABLEVIEW_ITEM_PANEL);
+       TryCatch(r == E_SUCCESS, delete pItem, "pGroupTableViewItem->Construct(%s)", GetErrorMessage(r));
 
        if (groupIndex == ID_MAIN_DEFAULT_PLAYLIST_ITEM)
        {
-               pItem->Construct(layout, Tizen::Graphics::Dimension(W_CLIENT_AREA, SETTING_ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+               r = pItem->Construct(layout, Tizen::Graphics::Dimension(W_CLIENT_AREA, SETTING_ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+               TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+
                Label* pMainText = static_cast<Label*>(pGroupTableViewItem->GetControl(IDC_LABEL_MAIN_TEXT));
 
                switch (itemIndex)
@@ -264,7 +263,9 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        }
        else
        {
-               pItem->Construct(layout, Tizen::Graphics::Dimension(W_CLIENT_AREA, SETTING_ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_RADIO);
+               r = pItem->Construct(layout, Tizen::Graphics::Dimension(W_CLIENT_AREA, SETTING_ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_RADIO);
+               TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+
                Label* pMainText = static_cast<Label*>(pGroupTableViewItem->GetControl(IDC_LABEL_MAIN_TEXT));
 
                switch (itemIndex)
@@ -316,6 +317,11 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       delete pGroupTableViewItem;
+       return null;
 }
 
 void
index 6605fa6..66eef7a 100644 (file)
@@ -218,8 +218,13 @@ SharePopup::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
-       pItem->Construct(Dimension(itemWidth, HEIGHT_POPUP_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-//     pItem->SetBackgroundColor(COLOR_ITEM);
+       result r = pItem->Construct(Dimension(itemWidth, HEIGHT_POPUP_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+       if (IsFailed(r))
+       {
+               AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+               delete pItem;
+               return null;
+       }
 
        //String shareItemName[] = {L"Message", L"Email", L"Bluetooth"};//NEED STRING Bluetooth
        String shareItemName[] = {L"Email"};//NEED
index 22802c8..6382012 100644 (file)
@@ -273,35 +273,32 @@ UserPlaylistContentListForm::CreateItem(const int itemIndex, int itemWidth)
        RelativeLayout layout;
        layout.Construct();
 
-       TableViewItem* pItem = new (std::nothrow) TableViewItem();
        TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
        if (GetScreenState() != SCREEN_STATE_NORMAL)
        {
                tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
        }
 
+       TableViewItem* pItem = new (std::nothrow) TableViewItem();
+       ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
+
        result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle);
-       if (IsFailed(r))
-       {
-               AppLogDebug("pItem->Construct() failed(%s)", GetErrorMessage(r));
-               delete pItem;
-               return null;
-       }
+       TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+       TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
 
-       ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
-       if (pContentInfo == null)
-       {
-               AppLogDebug("__pPresentationModel->GetContentInfoN failed(null)");
-               delete pItem;
-               return null;
-       }
+       r = CreateTableViewItem(*pItem, *pContentInfo);
+       TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
 
-       CreateTableViewItem(*pItem, *pContentInfo);
        RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
        delete pContentInfo;
 
        AppLogDebug("EXIT");
        return pItem;
+
+CATCH:
+       AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+       delete pContentInfo;
+       return null;
 }
 
 void
index fa97ffc..a59a2fb 100644 (file)
@@ -220,7 +220,7 @@ YearsListPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousScen
                int totalYearCount = __pPresentationModel->GetAllYearCount();
                CommonUtil::SetButtonEnabled(*pForm, totalYearCount, IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
 
-               CommonUtil::ShowNoContentImage(totalYearCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+//             CommonUtil::ShowNoContentImage(totalYearCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
        }
        if (pArgs != null)
        {
index 9f0de37..74c8e4f 100644 (file)
@@ -60,7 +60,7 @@ YearPickerPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSce
        __pPresentationModel->UpdateYearList();
        if (__pPresentationModel != null)
        {
-               CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllYearCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+//             CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllYearCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
        }
 
        if (pSceneManager->IsSceneAlive(IDSCN_PLAYER))