本文整理汇总了C++中CFileItemList::IsPluginRoot方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemList::IsPluginRoot方法的具体用法?C++ CFileItemList::IsPluginRoot怎么用?C++ CFileItemList::IsPluginRoot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemList
的用法示例。
在下文中一共展示了CFileItemList::IsPluginRoot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirectory
/*!
\brief Overwrite to fill fileitems from a source
\param strDirectory Path to read
\param items Fill with items specified in \e strDirectory
*/
bool CGUIMediaWindow::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
{
// cleanup items
if (items.Size())
items.Clear();
CStdString strParentPath=m_history.GetParentPath();
CLog::Log(LOGDEBUG,"CGUIMediaWindow::GetDirectory (%s)", strDirectory.c_str());
CLog::Log(LOGDEBUG," ParentPath = [%s]", strParentPath.c_str());
// see if we can load a previously cached folder
CFileItemList cachedItems(strDirectory);
if (!strDirectory.IsEmpty() && cachedItems.Load())
{
items.Assign(cachedItems);
}
else
{
DWORD time = timeGetTime();
if (!m_rootDir.GetDirectory(strDirectory, items))
return false;
// took over a second, and not normally cached, so cache it
if (time + 1000 < timeGetTime() && items.CacheToDiscIfSlow())
items.Save();
// if these items should replace the current listing, then pop it off the top
if (items.GetReplaceListing())
m_history.RemoveParentPath();
}
if (m_guiState.get() && !m_guiState->HideParentDirItems() && !items.m_strPath.IsEmpty())
{
CFileItemPtr pItem(new CFileItem(".."));
pItem->m_strPath = strParentPath;
pItem->m_bIsFolder = true;
pItem->m_bIsShareOrDrive = false;
items.AddFront(pItem, 0);
}
int iWindow = GetID();
CStdStringArray regexps;
if (iWindow == WINDOW_VIDEO_FILES)
regexps = g_advancedSettings.m_videoExcludeFromListingRegExps;
if (iWindow == WINDOW_MUSIC_FILES)
regexps = g_advancedSettings.m_audioExcludeFromListingRegExps;
if (iWindow == WINDOW_PICTURES)
regexps = g_advancedSettings.m_pictureExcludeFromListingRegExps;
if (regexps.size())
{
for (int i=0; i < items.Size();)
{
if (CUtil::ExcludeFileOrFolder(items[i]->m_strPath, regexps))
items.Remove(i);
else
i++;
}
}
// clear window properties at root or plugin root
if (items.IsVirtualDirectoryRoot() || items.IsPluginRoot())
ClearProperties();
return true;
}