本文整理汇总了C++中CFileItemPtr::Exists方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::Exists方法的具体用法?C++ CFileItemPtr::Exists怎么用?C++ CFileItemPtr::Exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemPtr
的用法示例。
在下文中一共展示了CFileItemPtr::Exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClick
bool CGUIWindowVideoNav::OnClick(int iItem)
{
CFileItemPtr item = m_vecItems->Get(iItem);
if (!item->m_bIsFolder && item->IsVideoDb() && !item->Exists())
{
if (!DeleteItem(item.get(), true))
return true;
// update list
m_vecItems->RemoveDiscCache(GetID());
Update(m_vecItems->m_strPath);
m_viewControl.SetSelectedItem(iItem);
return true;
}
return CGUIWindowVideoBase::OnClick(iItem);
}
示例2: OnClick
bool CGUIWindowVideoNav::OnClick(int iItem)
{
CFileItemPtr item = m_vecItems->Get(iItem);
if (!item->m_bIsFolder && item->IsVideoDb() && !item->Exists())
{
CLog::Log(LOGDEBUG, "%s called on '%s' but file doesn't exist", __FUNCTION__, item->GetPath().c_str());
if (!CGUIDialogVideoInfo::DeleteVideoItemFromDatabase(item, true))
return true;
// update list
Refresh(true);
m_viewControl.SetSelectedItem(iItem);
return true;
}
else if (StringUtils::StartsWithNoCase(item->GetPath(), "newtag://"))
{
// dont allow update while scanning
if (g_application.IsVideoScanning())
{
CGUIDialogOK::ShowAndGetInput(257, 0, 14057, 0);
return true;
}
//Get the new title
CStdString strTag;
if (!CGUIKeyboardFactory::ShowAndGetInput(strTag, g_localizeStrings.Get(20462), false))
return true;
CVideoDatabase videodb;
if (!videodb.Open())
return true;
// get the media type and convert from plural to singular (by removing the trailing "s")
CStdString mediaType = item->GetPath().substr(9);
mediaType = mediaType.substr(0, mediaType.size() - 1);
CStdString localizedType = CGUIDialogVideoInfo::GetLocalizedVideoType(mediaType);
if (localizedType.empty())
return true;
if (!videodb.GetSingleValue("tag", "tag.idTag", videodb.PrepareSQL("tag.strTag = '%s' AND tag.idTag IN (SELECT taglinks.idTag FROM taglinks WHERE taglinks.media_type = '%s')", strTag.c_str(), mediaType.c_str())).empty())
{
CStdString strError = StringUtils::Format(g_localizeStrings.Get(20463), strTag.c_str());
CGUIDialogOK::ShowAndGetInput(20462, "", strError, "");
return true;
}
int idTag = videodb.AddTag(strTag);
CFileItemList items;
CStdString strLabel = StringUtils::Format(g_localizeStrings.Get(20464), localizedType.c_str());
if (CGUIDialogVideoInfo::GetItemsForTag(strLabel, mediaType, items, idTag))
{
for (int index = 0; index < items.Size(); index++)
{
if (!items[index]->HasVideoInfoTag() || items[index]->GetVideoInfoTag()->m_iDbId <= 0)
continue;
videodb.AddTagToItem(items[index]->GetVideoInfoTag()->m_iDbId, idTag, mediaType);
}
}
Refresh(true);
return true;
}
return CGUIWindowVideoBase::OnClick(iItem);
}