本文整理汇总了C++中CAddonDatabase::IsAddonDisabled方法的典型用法代码示例。如果您正苦于以下问题:C++ CAddonDatabase::IsAddonDisabled方法的具体用法?C++ CAddonDatabase::IsAddonDisabled怎么用?C++ CAddonDatabase::IsAddonDisabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAddonDatabase
的用法示例。
在下文中一共展示了CAddonDatabase::IsAddonDisabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenerateListing
void CAddonsDirectory::GenerateListing(CURL &path, VECADDONS& addons, CFileItemList &items, bool reposAsFolders)
{
CStdString xbmcPath = CSpecialProtocol::TranslatePath("special://xbmc/addons");
items.ClearItems();
CAddonDatabase db;
db.Open();
for (unsigned i=0; i < addons.size(); i++)
{
AddonPtr addon = addons[i];
CFileItemPtr pItem;
if (reposAsFolders && addon->Type() == ADDON_REPOSITORY)
pItem = FileItemFromAddon(addon, "addons://", true);
else
pItem = FileItemFromAddon(addon, path.Get(), false);
AddonPtr addon2;
if (CAddonMgr::Get().GetAddon(addon->ID(),addon2))
pItem->SetProperty("Addon.Status",g_localizeStrings.Get(305));
else if (db.IsOpen() && db.IsAddonDisabled(addon->ID()))
pItem->SetProperty("Addon.Status",g_localizeStrings.Get(24023));
if (!addon->Props().broken.IsEmpty())
pItem->SetProperty("Addon.Status",g_localizeStrings.Get(24098));
if (addon2 && addon2->Version() < addon->Version())
{
pItem->SetProperty("Addon.Status",g_localizeStrings.Get(24068));
pItem->SetProperty("Addon.UpdateAvail", true);
}
CAddonDatabase::SetPropertiesFromAddon(addon,pItem);
items.Add(pItem);
}
db.Close();
}
示例2: OnPreInstall
bool CAddonInstallJob::OnPreInstall()
{
// check whether this is an active skin - we need to unload it if so
if (g_guiSettings.GetString("lookandfeel.skin") == m_addon->ID())
{
CApplicationMessenger::Get().ExecBuiltIn("UnloadSkin", true);
return true;
}
if (m_addon->Type() == ADDON_SERVICE)
{
CAddonDatabase database;
database.Open();
bool running = !database.IsAddonDisabled(m_addon->ID()); //grab a current state
database.DisableAddon(m_addon->ID(),false); // enable it so we can remove it??
// regrab from manager to have the correct path set
AddonPtr addon;
ADDON::CAddonMgr::Get().GetAddon(m_addon->ID(), addon);
boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(addon);
if (service)
service->Stop();
CAddonMgr::Get().RemoveAddon(m_addon->ID()); // remove it
return running;
}
if (m_addon->Type() == ADDON_PVRDLL)
{
// stop the pvr manager, so running pvr add-ons are stopped and closed
PVR::CPVRManager::Get().Stop();
}
return false;
}