本文整理汇总了C++中CFileItemPtr::ClearProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::ClearProperty方法的具体用法?C++ CFileItemPtr::ClearProperty怎么用?C++ CFileItemPtr::ClearProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemPtr
的用法示例。
在下文中一共展示了CFileItemPtr::ClearProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Add
void CPlayList::Add(const CFileItemPtr &item, int iPosition, int iOrder)
{
int iOldSize = size();
if (iPosition < 0 || iPosition >= iOldSize)
iPosition = iOldSize;
if (iOrder < 0 || iOrder >= iOldSize)
item->m_iprogramCount = iOldSize;
else
item->m_iprogramCount = iOrder;
// videodb files are not supported by the filesystem as yet
if (item->IsVideoDb())
item->m_strPath = item->GetVideoInfoTag()->m_strFileNameAndPath;
// increment the playable counter
item->ClearProperty("unplayable");
if (m_iPlayableItems < 0)
m_iPlayableItems = 1;
else
m_iPlayableItems++;
//CLog::Log(LOGDEBUG,"%s item:(%02i/%02i)[%s]", __FUNCTION__, iPosition, item->m_iprogramCount, item->m_strPath.c_str());
if (iPosition == iOldSize)
m_vecItems.push_back(item);
else
{
ivecItems it = m_vecItems.begin() + iPosition;
m_vecItems.insert(it, 1, item);
// correct any duplicate order values
if (iOrder < iOldSize)
IncrementOrder(iPosition + 1, iOrder);
}
}
示例2: UpdateStatus
void CGUIWindowAddonBrowser::UpdateStatus(const CFileItemPtr& item)
{
if (!item || item->m_bIsFolder)
return;
unsigned int percent;
if (CAddonInstaller::GetInstance().GetProgress(item->GetProperty("Addon.ID").asString(), percent))
{
std::string progress = StringUtils::Format(g_localizeStrings.Get(24042).c_str(), percent);
item->SetProperty("Addon.Status", progress);
item->SetProperty("Addon.Downloading", true);
}
else
item->ClearProperty("Addon.Downloading");
}
示例3:
void CGUIWindowAddonBrowser::SetItemLabel2(CFileItemPtr item)
{
if (!item || item->m_bIsFolder) return;
unsigned int percent;
if (CAddonInstaller::Get().GetProgress(item->GetProperty("Addon.ID").asString(), percent))
{
std::string progress = StringUtils::Format(g_localizeStrings.Get(24042).c_str(), percent);
item->SetProperty("Addon.Status", progress);
item->SetProperty("Addon.Downloading", true);
}
else
item->ClearProperty("Addon.Downloading");
item->SetLabel2(item->GetProperty("Addon.Status").asString());
// to avoid the view state overriding label 2
item->SetLabelPreformated(true);
}