Fixed issue 45056
authorHimanshu <himanshu.t@samsung.com>
Mon, 8 Jul 2013 07:06:57 +0000 (12:36 +0530)
committerHimanshu <himanshu.t@samsung.com>
Mon, 8 Jul 2013 07:09:24 +0000 (12:39 +0530)
Change-Id: Ic348f56c3c20e07ddf46a3c491574c7049b4f0d2
Signed-off-by: Himanshu <himanshu.t@samsung.com>
src/GlFileListPresentationModel.cpp

index 24a0732..4e5016f 100644 (file)
@@ -1161,25 +1161,30 @@ FileListPresentationModel::RefreshCurrentAlbumContentInfoList(const ContentType
 void
 FileListPresentationModel::AddDirectoryIfNew(const String& dirName)
 {
+
        bool isMatched = false;
        int dirCount = __pDirectoryList->GetCount();
+       String fullDirName;
+       fullDirName = Environment::GetMediaPath();
+       fullDirName.Append(dirName);
+
        if (__albumName != ResourceManager::GetString(L"IDS_MEDIABR_BODY_ALL_ALBUMS"))//we are not in All albums
        {
                return;
        }
+
        for (int i = 0; i < dirCount ; ++i)
        {
-               if (static_cast<String*>(__pDirectoryList->GetAt(i))->CompareTo(dirName) == 0)
+               if (static_cast<String*>(__pDirectoryList->GetAt(i))->CompareTo(fullDirName) == 0)
                {
                        isMatched = true;
                        break;
                }
        }
+       
        if (!isMatched)
        {
-               String fullPath = Environment::GetMediaPath();
-               fullPath.Append(dirName);
-               __pDirectoryList->Add(new (std::nothrow) String(fullPath));
+               __pDirectoryList->Add(new (std::nothrow) String(fullDirName));
 
        }
 }