Fixed the force close issue by deleting some string which should not be deleted
authorJongTaeOh <jongtae.oh@samsung.com>
Mon, 18 Mar 2013 09:44:35 +0000 (18:44 +0900)
committerJongTaeOh <jongtae.oh@samsung.com>
Mon, 18 Mar 2013 09:44:35 +0000 (18:44 +0900)
Change-Id: Idaa2bcb9fe8acaaa47647d3dc8d8e87e97b58b37

inc/MpPlaylistListPresentationModel.h
src/MpPlaylistListPanel.cpp
src/MpPlaylistListPresentationModel.cpp
src/MpPlaylistPickerPopup.cpp

index c10e784..909e67b 100644 (file)
@@ -45,7 +45,7 @@ public:
        void UpdatePlaylistContentList(const int contentType, const Tizen::Base::String& playlistName);
        void DeleteContent(int contentType, const ContentInformation& contentInfoStruct);
        ContentInformation* GetContentInfoN(int contentIndex);
-       Tizen::Base::String* GetPlayListNameN(int playlistIndex);
+       Tizen::Base::String* GetPlayListName(int playlistIndex);
        Tizen::Base::Collection::ArrayList* GetContentPathListN(int contentType);
        Tizen::Graphics::Bitmap* GetPlayListItemBitmap(Tizen::Base::String& playList);
        Tizen::Content::ContentId GetPlayListItemContentId(Tizen::Base::String& playlist);
@@ -66,4 +66,4 @@ private:
        Tizen::Base::String* __pQueryName;
 };
 
-#endif // _MP_PLAYLIST_LIST_PRESENTATION_MODEL_H_
\ No newline at end of file
+#endif // _MP_PLAYLIST_LIST_PRESENTATION_MODEL_H_
index 7139f50..68e081a 100644 (file)
@@ -133,8 +133,8 @@ PlaylistListPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actio
 
                        if (actionId == IDA_DELETE_POPUP_DELETE)
                        {
-                               String* pPlayName = __pPlaylistListPresentationModel->GetPlayListNameN(__selectedItemIndex - USER_CONTENT);
-                               __pPlaylistListPresentationModel->RemovePlayList(*pPlayName);
+                               String* pPlaylistName = __pPlaylistListPresentationModel->GetPlayListName(__selectedItemIndex - USER_CONTENT);
+                               __pPlaylistListPresentationModel->RemovePlayList(*pPlaylistName);
                                __pPlaylistListPresentationModel->UpdatePlaylistList();
                                __pContentTableView->UpdateTableView();
                                Invalidate(true);
@@ -189,9 +189,8 @@ PlaylistListPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actio
                {
                        if (__selectedItemIndex >= USER_CONTENT)
                        {
-                               String* pPlayName = __pPlaylistListPresentationModel->GetPlayListNameN(__selectedItemIndex - USER_CONTENT);
+                               String* pPlayName = __pPlaylistListPresentationModel->GetPlayListName(__selectedItemIndex - USER_CONTENT);
                                __pPlaylistListPresentationModel->UpdatePlaylistContentList(USER_CONTENT, *pPlayName);
-                               delete pPlayName;
                        }
                        ArrayList* pContentPath = __pPlaylistListPresentationModel->GetContentPathListN(__selectedItemIndex);
 
@@ -373,7 +372,7 @@ PlaylistListPanel::CreateItem(const int itemIndex, int itemWidth)
        }
        else
        {
-               Tizen::Base::String* playlistName = __pPlaylistListPresentationModel->GetPlayListNameN(itemIndex - USER_CONTENT);
+               Tizen::Base::String* playlistName = __pPlaylistListPresentationModel->GetPlayListName(itemIndex - USER_CONTENT);
 
                int playlistItemCount = __pPlaylistListPresentationModel->GetPlayListItemCount(*playlistName);
                ContentId contentId = __pPlaylistListPresentationModel->GetPlayListItemContentId(*playlistName);
@@ -492,7 +491,7 @@ PlaylistListPanel::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& t
                }
                else
                {
-                       Tizen::Base::String* pPlaylistName = __pPlaylistListPresentationModel->GetPlayListNameN(itemIndex - USER_CONTENT);
+                       Tizen::Base::String* pPlaylistName = __pPlaylistListPresentationModel->GetPlayListName(itemIndex - USER_CONTENT);
                        if (pPlaylistName != null)
                        {
                                pData->Add(*(new (std::nothrow) String(*pPlaylistName)));
@@ -676,4 +675,4 @@ PlaylistListPanel::IsEmptyContentList(void)
 //     }
        AppLogDebug("EXIT");
        return false;
-}
\ No newline at end of file
+}
index a897894..448732a 100644 (file)
@@ -346,7 +346,7 @@ PlaylistListPresentationModel::SetPlayListName(const Tizen::Base::String& oldPla
 }
 
 Tizen::Base::String*
-PlaylistListPresentationModel::GetPlayListNameN(int playlistIndex)
+PlaylistListPresentationModel::GetPlayListName(int playlistIndex)
 {
        AppLogDebug("ENTER");
        /*Tizen::Base::Collection::IList* pAllPlaylistNameList = PlayListManager::GetInstance()->GetAllPlayListNameN();
@@ -632,4 +632,4 @@ PlaylistListPresentationModel::DeleteContent(int contentType, const ContentInfor
                break;
        }
        AppLogDebug("EXIT");
-}
\ No newline at end of file
+}
index 346d4ec..5ae2ab4 100644 (file)
@@ -248,7 +248,7 @@ PlayListPickerPopup::CreateItem(const int itemIndex, int itemWidth)
        pItem->Construct(Dimension(itemWidth, HEIGHT_POPUP_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
 //     pItem->SetBackgroundColor(Color(255, 255, 255));
 
-       CreateTableViewItem(*pItem, *(__pPlaylistListPresentationModel->GetPlayListNameN(itemIndex)));
+       CreateTableViewItem(*pItem, *(__pPlaylistListPresentationModel->GetPlayListName(itemIndex)));
 
        AppLogDebug("EXIT");
        return pItem;
@@ -362,4 +362,4 @@ PlayListPickerPopup::CreateTableViewItem(Tizen::Ui::Container& parent, Tizen::Ba
 
        AppLogDebug("EXIT");
        return r;
-}
\ No newline at end of file
+}