本文整理汇总了C++中CFileItemPtr::CleanString方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::CleanString方法的具体用法?C++ CFileItemPtr::CleanString怎么用?C++ CFileItemPtr::CleanString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemPtr
的用法示例。
在下文中一共展示了CFileItemPtr::CleanString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadVideoInfo
void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items)
{
// TODO: this could possibly be threaded as per the music info loading,
// we could also cache the info
if (!items.GetContent().IsEmpty())
return; // don't load for listings that have content set
CStdString content = m_database.GetContentForPath(items.m_strPath);
if (content.IsEmpty())
{
items.SetContent("files");
return;
}
items.SetContent(content);
bool clean = (g_guiSettings.GetBool("myvideos.cleanstrings") &&
!items.IsVirtualDirectoryRoot() &&
m_stackingAvailable);
if (!content.IsEmpty())
{
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr pItem = items[i];
CFileItem item;
if (m_database.GetItemForPath(content, pItem->m_strPath, item))
{ // copy info across
pItem->UpdateInfo(item);
// TODO: we may wish to use a playable_url parameter here rather than
// switching the path of the item (eg movie as a folder)
pItem->m_strPath = item.m_strPath;
pItem->m_bIsFolder = item.m_bIsFolder;
}
else
{
if (clean)
pItem->CleanString();
}
}
}
else
{
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr pItem = items[i];
int playCount = m_database.GetPlayCount(*pItem);
if (playCount >= 0)
pItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, playCount > 0);
if (clean)
pItem->CleanString();
}
}
}
示例2: OnPrepareFileItems
void CGUIWindowVideoFiles::OnPrepareFileItems(CFileItemList &items)
{
CGUIWindowVideoBase::OnPrepareFileItems(items);
if (g_guiSettings.GetBool("myvideos.cleanfilenames"))
{
for (int i = 0; i < (int)items.Size(); ++i)
{
CFileItemPtr item = items[i];
if ((item->m_bIsFolder && !CUtil::IsInArchive(item->m_strPath)) || m_cleaningAvailable)
item->CleanString();
}
}
}