Fixed jira issues:46440
authorajay.nayak <ajay.nayak@samsung.com>
Tue, 16 Jul 2013 04:24:22 +0000 (13:24 +0900)
committerajay.nayak <ajay.nayak@samsung.com>
Tue, 16 Jul 2013 04:24:22 +0000 (13:24 +0900)
Change-Id: I2ead1ab2b9638c0ef46fd1845d79a3f9d2febf50
Signed-off-by: ajay.nayak <ajay.nayak@samsung.com>
src/MpSearchForm.cpp

index 40a1cef..2b7a2f0 100644 (file)
@@ -476,22 +476,29 @@ SearchForm::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableVie
                return;
        }
 
+       int albumIndex = __pPresentationModel->GetAlbumIndex();
+       int songIndex = __pPresentationModel->GetSongIndex();
+
        ContentInformation* pContentInfo;
        SceneManager* pSceneManager = SceneManager::GetInstance();
        AppAssert(pSceneManager);
 
-       if (itemIndex < __pPresentationModel->GetAlbumIndex())
+       if (songIndex != -1 && itemIndex > songIndex) //song result
        {
                pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
+               ArrayList* pPath = new (std::nothrow) ArrayList();
+               pPath->Construct();
+               pPath->Add(*(new (std::nothrow) String(pContentInfo->ContentFilePath)));
 
                ArrayList* pData = new (std::nothrow) ArrayList();
                pData->Construct();
-               pData->Add(*(new (std::nothrow) String(IDSCN_ARTIST_LIST)));
-               pData->Add(*(new (std::nothrow) String(pContentInfo->ArtistName)));
+               pData->Add(*(new (std::nothrow) String(MUSIC)));
+               pData->Add(*(new (std::nothrow) Integer(0)));
+               pData->Add(*(pPath));
 
-               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ARTIST_CONTENT_LIST), pData);
+               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_PLAYER), pData);
        }
-       else if (itemIndex < __pPresentationModel->GetSongIndex())
+       else if (albumIndex != -1 && itemIndex > albumIndex)//album item
        {
                pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
 
@@ -503,20 +510,17 @@ SearchForm::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableVie
 
                pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_CONTENT_LIST), pData);
        }
-       else
+//     if (itemIndex < __pPresentationModel->GetAlbumIndex())
+       else//artist item
        {
                pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
-               ArrayList* pPath = new (std::nothrow) ArrayList();
-               pPath->Construct();
-               pPath->Add(*(new (std::nothrow) String(pContentInfo->ContentFilePath)));
 
                ArrayList* pData = new (std::nothrow) ArrayList();
                pData->Construct();
-               pData->Add(*(new (std::nothrow) String(MUSIC)));
-               pData->Add(*(new (std::nothrow) Integer(0)));
-               pData->Add(*(pPath));
+               pData->Add(*(new (std::nothrow) String(IDSCN_ARTIST_LIST)));
+               pData->Add(*(new (std::nothrow) String(pContentInfo->ArtistName)));
 
-               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_PLAYER), pData);
+               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ARTIST_CONTENT_LIST), pData);
        }
 
        delete pContentInfo;