/*
* Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
+ * http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "guilib/LocalizeStrings.h"
#include "utils/LegacyPathTranslation.h"
#include "utils/log.h"
+#include "utils/StringUtils.h"
using namespace std;
using namespace XFILE;
bool CVideoDatabaseDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
{
CStdString path = CLegacyPathTranslation::TranslateVideoDbPath(strPath);
+ items.SetPath(path);
auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path));
if (!pNode.get())
if (item->m_bIsFolder && !item->HasIcon() && !item->HasArt("thumb"))
{
CStdString strImage = GetIcon(item->GetPath());
- if (!strImage.IsEmpty() && g_TextureManager.HasTexture(strImage))
+ if (!strImage.empty() && g_TextureManager.HasTexture(strImage))
item->SetIconImage(strImage);
}
}
Crc32 crc;
crc.ComputeFromLowerCase(path);
- CStdString strFileName;
- strFileName.Format("special://temp/%08x.fi", (unsigned __int32) crc);
+ CStdString strFileName = StringUtils::Format("special://temp/%08x.fi", (unsigned __int32) crc);
CFile::Delete(strFileName);
}
bool CVideoDatabaseDirectory::IsAllItem(const CStdString& strDirectory)
{
- if (strDirectory.Right(4).Equals("/-1/"))
+ if (StringUtils::EndsWith(strDirectory, "/-1/"))
return true;
return false;
}
CStdString path = CLegacyPathTranslation::TranslateVideoDbPath(strDirectory);
auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path));
- if (!pNode.get() || path.IsEmpty())
+ if (!pNode.get() || path.empty())
return false;
// first see if there's any filter criteria
// get year
if (params.GetYear() != -1)
{
- CStdString strTemp;
- strTemp.Format("%i",params.GetYear());
- if (!strLabel.IsEmpty())
+ CStdString strTemp = StringUtils::Format("%i",params.GetYear());
+ if (!strLabel.empty())
strLabel += " / ";
strLabel += strTemp;
}
- if (strLabel.IsEmpty())
+ if (strLabel.empty())
{
switch (pNode->GetChildType())
{
case NODE_TYPE_EPISODES: // Episodes
strLabel = g_localizeStrings.Get(20360); break;
default:
- CLog::Log(LOGWARNING, "%s - Unknown nodetype requested %d", __FUNCTION__, pNode->GetChildType());
return false;
}
}
case NODE_TYPE_MUSICVIDEOS_ALBUM: // Music Videos - Albums
return "DefaultMusicAlbums.png";
default:
- CLog::Log(LOGWARNING, "%s - Unknown nodetype requested %s", __FUNCTION__, strDirectory.c_str());
break;
}