Fixed jira issue related with search UI
authorJongTaeOh <jongtae.oh@samsung.com>
Tue, 19 Mar 2013 04:35:34 +0000 (13:35 +0900)
committerJongTaeOh <jongtae.oh@samsung.com>
Tue, 19 Mar 2013 04:35:34 +0000 (13:35 +0900)
Change-Id: Ibd608fba42b96a9896b44f3a6192a25a32aeab64

src/MpMusicPlayerPresentationModel.cpp
src/MpSearchForm.cpp

index 8cbb906..f0940c8 100644 (file)
@@ -611,7 +611,7 @@ PlayerPresentationModel::GetContentInfoN(int contentIndex)
                        pContentInfoStruct->TitleName = pAudioContentInfo->GetTitle();
                }
                pContentInfoStruct->Duration  = pAudioContentInfo->GetDuration();/*__pPlayer->GetDuration();*/
-               if (pContentInfoStruct->Duration == null)
+               if (__pPlayer != null && pContentInfoStruct->Duration == null)
                {
                        __pPlayer->GetDuration();
                }
@@ -643,7 +643,11 @@ PlayerPresentationModel::GetContentInfoN(int contentIndex)
                {
                        pContentInfoStruct->TitleName = pAudioMeta->GetTitle();
                }
-               pContentInfoStruct->Duration = __pPlayer->GetDuration();
+
+               if(__pPlayer != null)
+               {
+                       pContentInfoStruct->Duration = __pPlayer->GetDuration();
+               }
 
                delete pAudioMeta;
        }
@@ -673,6 +677,12 @@ PlayerPresentationModel::Play(int contentIndex, int sliderPosition, bool bPauseP
        AppLogDebug("ENTER");
        result r = E_SUCCESS;
 
+       if(__pPlayer == null)
+       {
+               AppLogDebug("EXIT");
+               return E_FAILURE;
+       }
+
        if (__seekCompleted == false)
        {
                AppLogDebug("EXIT");
@@ -917,6 +927,13 @@ void
 PlayerPresentationModel::Pause(void)
 {
        AppLogDebug("ENTER");
+
+       if(__pPlayer == null)
+       {
+               AppLogDebug("EXIT");
+               return;
+       }
+
        result r = E_SUCCESS;
        PlayerState playerState = __pPlayer->GetState() ;
        AppLogDebug("%d", playerState);
@@ -949,6 +966,13 @@ void
 PlayerPresentationModel::MovePreviousContent(bool forceMove)
 {
        AppLogDebug("ENTER");
+
+       if(__pPlayer == null)
+       {
+               AppLogDebug("EXIT");
+               return;
+       }
+
        result r = E_SUCCESS;
        String currentDuration = null;
 
@@ -1013,6 +1037,12 @@ void
 PlayerPresentationModel::MoveNextContent(void)
 {
        AppLogDebug("ENTER");
+
+       if(__pPlayer == null)
+       {
+               AppLogDebug("EXIT");
+               return;
+       }
 //     String currentDuration = null;
 
 //     ClosePlayer();
@@ -1147,6 +1177,13 @@ void
 PlayerPresentationModel::SetPlayPosition(int playPosition)
 {
        AppLogDebug("ENTER");
+
+       if(__pPlayer == null)
+       {
+               AppLogDebug("EXIT");
+               return;
+       }
+
        result r = E_SUCCESS;
        String currentDuration = null;
 
@@ -1614,6 +1651,12 @@ PlayerPresentationModel::OnPlayerEndOfClip(void)
        AppLogDebug("ENTER");
 //     StopForwardRewind();
 
+       if(__pPlayer == null)
+       {
+               AppLogDebug("EXIT");
+               return;
+       }
+
        AppLogDebug("GetRepeatState() : %d", GetRepeatState());
        switch (GetRepeatState())// 0 - 2 (OFF, ONE, ALL)
        {
@@ -1674,6 +1717,11 @@ void
 PlayerPresentationModel::OnPlayerBuffering(int percent)
 {
        AppLogDebug("ENTER");
+       if(__pPlayer == null)
+       {
+               AppLogDebug("EXIT");
+               return;
+       }
        CallOnPlayStateChanged(__pPlayer->GetState());
        AppLogDebug("EXIT");
 }
@@ -1682,6 +1730,11 @@ void
 PlayerPresentationModel::OnPlayerErrorOccurred(PlayerErrorReason r)
 {
        AppLogDebug("ENTER");
+       if(__pPlayer == null)
+       {
+               AppLogDebug("EXIT");
+               return;
+       }
        CallOnPlayStateChanged(__pPlayer->GetState());
        AppLogDebug("EXIT");
 }
@@ -1744,6 +1797,13 @@ void
 PlayerPresentationModel::OnTimerExpired(Timer& timer)
 {
        AppLogDebug("ENTER");
+
+       if(__pPlayer == null)
+       {
+               AppLogDebug("EXIT");
+               return;
+       }
+
        result r = E_SUCCESS;
        if (__pPlayStateTimer == &timer)
        {
@@ -1914,4 +1974,4 @@ PlayerPresentationModel::CallOnPlayPresentationModelDestroying(void)
                pListener->OnPlayPresentationModelDestroying();
        }
        AppLogDebug("EXIT");
-}
\ No newline at end of file
+}
index d6e0277..c9f9f29 100644 (file)
@@ -351,13 +351,12 @@ SearchForm::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableVie
                return;
        }
 
-       __pSearchBar->HideKeypad();
-       Invalidate(true);
-
        if (itemIndex == __pPresentationModel->GetArtistIndex()
                || itemIndex == __pPresentationModel->GetAlbumIndex()
                || itemIndex == __pPresentationModel->GetSongIndex())
        {
+               __pSearchBar->HideKeypad();
+               Invalidate(true);
                return;
        }
 
@@ -491,14 +490,14 @@ SearchForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
                                                                const Tizen::Ui::Scenes::SceneId& nextSceneId)
 {
        AppLogDebug("ENTER");
-       if (__pSearchBar != null)
+/*     if (__pSearchBar != null)
        {
                __pSearchBar->HideKeypad();
                Invalidate(true);
        }
        __pPresentationModel->RemoveSearchResult();
        __pSearchTableView->UpdateTableView();
-
+*/
 //     if (__pSearchBar->GetKeypadAction() == true)
 //     {
 //             __pSearchBar->HideKeypad();
@@ -657,4 +656,4 @@ SearchForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
 
        pSceneManager->GoForward(ForwardSceneTransition(__pSceneId->GetPointer(), SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
        AppLogDebug("EXIT");
-}
\ No newline at end of file
+}