当前位置: 首页>>代码示例>>C++>>正文


C++ CFileItemPtr::CleanString方法代码示例

本文整理汇总了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();
    }
  }
}
开发者ID:mmrvka,项目名称:xbmc,代码行数:53,代码来源:GUIWindowVideoNav.cpp

示例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();
    }
  }
}
开发者ID:derobert,项目名称:debianlink-xbmc,代码行数:13,代码来源:GUIWindowVideoFiles.cpp


注:本文中的CFileItemPtr::CleanString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。