本文整理汇总了C++中CAddonDatabase::DeleteRepository方法的典型用法代码示例。如果您正苦于以下问题:C++ CAddonDatabase::DeleteRepository方法的具体用法?C++ CAddonDatabase::DeleteRepository怎么用?C++ CAddonDatabase::DeleteRepository使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAddonDatabase
的用法示例。
在下文中一共展示了CAddonDatabase::DeleteRepository方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPostUnInstall
void CAddonUnInstallJob::OnPostUnInstall()
{
if (m_addon->Type() == ADDON_REPOSITORY)
{
CAddonDatabase database;
database.Open();
database.DeleteRepository(m_addon->ID());
}
bool bSave(false);
CFileItemList items;
XFILE::CFavouritesDirectory::Load(items);
for (int i=0; i < items.Size(); ++i)
{
if (items[i]->GetPath().find(m_addon->ID()) != std::string::npos)
{
items.Remove(items[i].get());
bSave = true;
}
}
if (bSave)
CFavouritesDirectory::Save(items);
if (m_addon->Type() == ADDON_PVRDLL)
{
if (CSettings::Get().GetBool("pvrmanager.enabled"))
PVR::CPVRManager::Get().Start(true);
}
}
示例2: OnPostUnInstall
void CAddonUnInstallJob::OnPostUnInstall()
{
if (m_addon->Type() == ADDON_REPOSITORY)
{
CAddonDatabase database;
database.Open();
database.DeleteRepository(m_addon->ID());
}
}
示例3: OnContextButton
bool CGUIWindowAddonBrowser::OnContextButton(int itemNumber,
CONTEXT_BUTTON button)
{
CFileItemPtr pItem = m_vecItems->Get(itemNumber);
if (pItem->GetPath().Equals("addons://enabled/"))
{
if (button == CONTEXT_BUTTON_SCAN)
{
CAddonMgr::Get().FindAddons();
return true;
}
}
AddonPtr addon;
if (!CAddonMgr::Get().GetAddon(pItem->GetProperty("Addon.ID").asString(), addon, ADDON_UNKNOWN, false)) // allow disabled addons
return false;
if (button == CONTEXT_BUTTON_SETTINGS)
return CGUIDialogAddonSettings::ShowAndGetInput(addon);
if (button == CONTEXT_BUTTON_UPDATE_LIBRARY)
{
CAddonDatabase database;
database.Open();
database.DeleteRepository(addon->ID());
button = CONTEXT_BUTTON_SCAN;
}
if (button == CONTEXT_BUTTON_SCAN)
{
RepositoryPtr repo = boost::dynamic_pointer_cast<CRepository>(addon);
CAddonInstaller::Get().UpdateRepos(true);
return true;
}
if (button == CONTEXT_BUTTON_INFO)
{
CGUIDialogAddonInfo::ShowForItem(pItem);
return true;
}
return CGUIMediaWindow::OnContextButton(itemNumber, button);
}