本文整理汇总了C++中CFileItemList::SetSaveInHistory方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemList::SetSaveInHistory方法的具体用法?C++ CFileItemList::SetSaveInHistory怎么用?C++ CFileItemList::SetSaveInHistory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemList
的用法示例。
在下文中一共展示了CFileItemList::SetSaveInHistory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirectory
//.........这里部分代码省略.........
const char* fanart = root->Attribute("art");
string strFanart;
if (fanart && strlen(fanart) > 0)
strFanart = ProcessUrl(strPath, fanart, false);
// Walk the parsed tree.
string strFileLabel = "%N - %T";
string strDirLabel = "%B";
string strSecondDirLabel = "%Y";
Parse(m_url, root, items, strFileLabel, strDirLabel, strSecondDirLabel);
// Set the window titles
const char* title1 = root->Attribute("title1");
const char* title2 = root->Attribute("title2");
if (title1 && strlen(title1) > 0)
items.SetFirstTitle(title1);
if (title2 && strlen(title2) > 0)
items.SetSecondTitle(title2);
// Set fanart on items if they don't have their own.
for (int i=0; i<items.Size(); i++)
{
CFileItemPtr pItem = items[i];
if (strFanart.size() > 0 && pItem->GetQuickFanart().size() == 0)
pItem->SetQuickFanart(strFanart);
// Make sure sort label is lower case.
string sortLabel = pItem->GetLabel();
boost::to_lower(sortLabel);
pItem->SetSortLabel(sortLabel);
}
// Set fanart on directory.
if (strFanart.size() > 0)
items.SetQuickFanart(strFanart);
// Set the view mode.
const char* viewmode = root->Attribute("viewmode");
if (viewmode && strlen(viewmode) > 0)
{
CGUIViewState* viewState = CGUIViewState::GetViewState(0, items);
viewState->SaveViewAsControl(atoi(viewmode));
}
// Override labels.
const char* fileLabel = root->Attribute("filelabel");
if (fileLabel && strlen(fileLabel) > 0)
strFileLabel = fileLabel;
const char* dirLabel = root->Attribute("dirlabel");
if (dirLabel && strlen(dirLabel) > 0)
strDirLabel = dirLabel;
// Add the sort method.
items.AddSortMethod(SORT_METHOD_NONE, 552, LABEL_MASKS(strFileLabel, "%D", strDirLabel, strSecondDirLabel));
// Set the content label.
const char* content = root->Attribute("content");
if (content && strlen(content) > 0)
{
items.SetContent(content);
}
// Check for dialog message attributes
CStdString strMessage = "";
const char* header = root->Attribute("header");
if (header && strlen(header) > 0)
{
const char* message = root->Attribute("message");
if (message && strlen(message) > 0)
strMessage = message;
items.m_displayMessage = true;
items.m_displayMessageTitle = header;
items.m_displayMessageContents = root->Attribute("message");
// Don't cache these.
m_dirCacheType = DIR_CACHE_NEVER;
}
// See if this directory replaces the parent.
const char* replace = root->Attribute("replaceParent");
if (replace && strcmp(replace, "1") == 0)
items.SetReplaceListing(true);
// See if we're saving this into the history or not.
const char* noHistory = root->Attribute("noHistory");
if (noHistory && strcmp(noHistory, "1") == 0)
items.SetSaveInHistory(false);
// See if we're not supposed to cache this directory.
const char* noCache = root->Attribute("nocache");
if (noCache && strcmp(noCache, "1") == 0)
m_dirCacheType = DIR_CACHE_NEVER;
return true;
}