Fixed jira issue related with appcontrol
authorJongTaeOh <jongtae.oh@samsung.com>
Fri, 5 Apr 2013 11:01:57 +0000 (20:01 +0900)
committerJongTaeOh <jongtae.oh@samsung.com>
Fri, 5 Apr 2013 11:01:57 +0000 (20:01 +0900)
Change-Id: I830144219ab3559b45279cb9696b2b3ee07a7a49

src/MpContentPanel.cpp
src/MpFolderListEditorPanel.cpp
src/MpMusicPlayerApp.cpp

index 48c9a63..7b710e9 100644 (file)
@@ -248,6 +248,9 @@ ContentPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneI
                                                                const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)\r
 {\r
        AppLogDebug("ENTER");\r
+       Header* pHeader = GetHeader();\r
+       pHeader->AddActionEventListener(*this);\r
+\r
        Footer* pFooter = GetFooter();\r
        pFooter->AddActionEventListener(*this);\r
        SetBackEventListner();\r
@@ -259,6 +262,9 @@ void
 ContentPanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)\r
 {\r
        AppLogDebug("ENTER");\r
+       Header* pHeader = GetHeader();\r
+       pHeader->RemoveActionEventListener(*this);\r
+\r
        Footer* pFooter = GetFooter();\r
        pFooter->RemoveActionEventListener(*this);\r
        RemoveBackEventListner();\r
index e74a4bd..15d19c2 100644 (file)
@@ -68,6 +68,12 @@ FolderListEditorPanel::OnTerminating(void)
                __pPlayListPickerPopup = null;
        }
 
+       Header* pHeader = GetParentHeader();
+       pHeader->RemoveActionEventListener(*this);
+
+       Footer* pFooter = GetFooter();
+       pFooter->RemoveActionEventListener(*this);
+
        AppLogDebug("EXIT");
        return E_SUCCESS;
 }
index e872c55..8e7f3a8 100644 (file)
@@ -116,12 +116,7 @@ MusicPlayerApp::OnAppInitialized(void)
                __sceneId = IDSCN_ALL_LIST;
        }
        __pMainFrame->GoToInitialScene(__sceneId, __pDataList);
-       if (__pDataList != null)
-       {
-               __pDataList->RemoveAll(true);
-               delete __pDataList;
-               __pDataList = null;
-       }
+
        AppLogDebug("EXIT");
        return true;
 
@@ -188,11 +183,10 @@ MusicPlayerApp::OnForeground(void)
 //                     pBaseForm->OnUpdateContentList();
 //             }
 //     }
-
        PlayerForm* pBaseForm = dynamic_cast<PlayerForm*>(pScene->GetForm());
        if (pScene->GetSceneId() == IDSCN_PLAYER)
        {
-               if (pBaseForm)
+               if (pBaseForm && __pDataList != null)
                {
                        pBaseForm->OnChangedContentList(__pDataList);
                }
@@ -202,13 +196,6 @@ MusicPlayerApp::OnForeground(void)
                __pMainFrame->GoToInitialScene(pSceneManager->GetCurrentSceneId(), __pDataList);
        }
 
-       if (__pDataList != null)
-       {
-               __pDataList->RemoveAll(true);
-               delete __pDataList;
-               __pDataList = null;
-       }
-
        Frame* pFrame = GetFrameAt(0);
        AppAssert(pFrame);
        pFrame->SetEnabled(true);
@@ -287,7 +274,15 @@ MusicPlayerApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::
        {
                __sceneId = IDSCN_ALL_LIST;
        }
-       __pMainFrame->GoToInitialScene(__sceneId, __pDataList);
+
+       if (__pMainFrame != null)
+       {
+               result r = __pMainFrame->GoToInitialScene(__sceneId, __pDataList);
+               if (r == E_SUCCESS)
+               {
+                       __pDataList = null;
+               }
+       }
        AppLogDebug("EXIT");
        return;
 }
@@ -308,29 +303,22 @@ MusicPlayerApp::ParsingArgument(const Tizen::Base::String* pUriData, const Tizen
                sourceStr.Replace(original, replace);
        //      pContentPath = &sourceStr;
 
+               __pDataList = new (std::nothrow) ArrayList();
+               __pDataList->Construct();
+
                ArrayList* pContentPathArrayList = new (std::nothrow) ArrayList();
                pContentPathArrayList->Construct();
 
                AppLogDebug("sourceStr : %ls", sourceStr.GetPointer());
                pContentPathArrayList->Add((new (std::nothrow) String(sourceStr)));
 
-               if (__pDataList == null)
-               {
-                       __pDataList = new (std::nothrow) ArrayList();
-                       __pDataList->Construct();
-               }
-               else
-               {
-                       __pDataList->RemoveAll(true);
-               }
-
                __pDataList->Add(pContentPathArrayList);
-               __pDataList->Add(*(new Integer(0)));
+               __pDataList->Add(new Integer(0));
        }
 
 /*For multiple file path*/
 
-/*     else if (pArgs != null && pArgs->GetCount() > 0)
+/*     else if (pArgs != null && pArgs->GetCoun__pDataListt() > 0)
        {
                pContentPath = static_cast<const String*>(pArgs->GetValue(APPCONTROL_KEYFIELD_PATH));
        }
@@ -383,4 +371,4 @@ MusicPlayerApp::GetOperationId(void)
        AppLogDebug("ENTER");
        AppLogDebug("EXIT");
        return __operationId;
-}
\ No newline at end of file
+}