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));
}
}