Merge "Fixed jira issues:N_SE-46521" into tizen_2.2
authorJong-Tae Oh <jongtae.oh@samsung.com>
Tue, 16 Jul 2013 09:16:48 +0000 (09:16 +0000)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 16 Jul 2013 09:16:48 +0000 (09:16 +0000)
src/MpArtistListPresentationModel.cpp

index 3570707..1d094ee 100644 (file)
@@ -149,12 +149,15 @@ ArtistListPresentationModel::GetArtistAlbumContentCount(int albumIndex)
        else
        {
                String WhereExpr = __keyWord;
+               WhereExpr.Replace(L"'", L"\\'");
        //      WhereExpr = CommonUtil::SpecialReplaceChange(__keyWord);
                WhereExpr = CommonUtil::MakeQuery(STRING_SORT_ARTIST, WhereExpr);
 
                String SearchKeyword(WhereExpr);
                SearchKeyword.Append(L" AND ");
 
+               WhereExpr = *pContentFileName;
+               WhereExpr.Replace(L"'", L"\\'");
                //WhereExpr = CommonUtil::SpecialReplaceChange(*pContentFileName);
                WhereExpr = CommonUtil::MakeQuery(STRING_SORT_ALBUM, *pContentFileName);
 
@@ -324,6 +327,8 @@ ArtistListPresentationModel::InitializeArtistAlbumList(Tizen::Base::String& keyW
                return;
        }
 
+       __pArtistContentList = pContentSearchResultList;
+
        String tempAlbumName;
        int contentTotalCount = pContentSearchResultList->GetCount();
        for (int iCount = 0; iCount < contentTotalCount; iCount++)
@@ -341,10 +346,10 @@ ArtistListPresentationModel::InitializeArtistAlbumList(Tizen::Base::String& keyW
                }
        }
 
-       pContentSearchResultList->RemoveAll(true);
-       delete pContentSearchResultList;
+//     pContentSearchResultList->RemoveAll(true);
+//     delete pContentSearchResultList;
 
-       __pArtistContentList = CommonUtil::ContentSearchResultListN(keyWord, STRING_SORT_ARTIST, /*STRING_SORT_TITLE*/ STRING_SORT_ALBUM);
+//     __pArtistContentList = CommonUtil::ContentSearchResultListN(keyWord, STRING_SORT_ARTIST, /*STRING_SORT_TITLE*/ STRING_SORT_ALBUM);
        AppLogDebug("EXIT");
 }
 
@@ -387,6 +392,7 @@ ArtistListPresentationModel::InitializeContentList(int albumIndex)
        }
 
        String* pContentFileName = static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex));
+       AppLogDebug("pContentFileName(%ls), __keyWord(%ls)", pContentFileName->GetPointer(), __keyWord.GetPointer());
        if (pContentFileName == null)
        {
                AppLogDebug("EXIT(pContentFileName is null");
@@ -401,13 +407,16 @@ ArtistListPresentationModel::InitializeContentList(int albumIndex)
        {
                String WhereExpr = __keyWord;
        //      WhereExpr = CommonUtil::SpecialReplaceChange(__keyWord);
+               WhereExpr.Replace(L"'", L"\\'");
                WhereExpr = CommonUtil::MakeQuery(STRING_SORT_ARTIST, WhereExpr);
 
                String SearchKeyword(WhereExpr);
                SearchKeyword.Append(L" AND ");
 
+               WhereExpr = *pContentFileName;
+               WhereExpr.Replace(L"'", L"\\'");
                //WhereExpr = CommonUtil::SpecialReplaceChange(*pContentFileName);
-               WhereExpr = CommonUtil::MakeQuery(STRING_SORT_ALBUM, *pContentFileName);
+               WhereExpr = CommonUtil::MakeQuery(STRING_SORT_ALBUM, WhereExpr);
 
                SearchKeyword.Append(WhereExpr);
                __pArtistAlbumContentList = CommonUtil::SearchContentList(SearchKeyword, STRING_SORT_TITLE);