本文整理汇总了C++中CAddonDatabase::IsAddonBlacklisted方法的典型用法代码示例。如果您正苦于以下问题:C++ CAddonDatabase::IsAddonBlacklisted方法的具体用法?C++ CAddonDatabase::IsAddonBlacklisted怎么用?C++ CAddonDatabase::IsAddonBlacklisted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAddonDatabase
的用法示例。
在下文中一共展示了CAddonDatabase::IsAddonBlacklisted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRollback
void CGUIDialogAddonInfo::OnRollback()
{
if (!g_passwordManager.CheckMenuLock(WINDOW_ADDON_BROWSER))
return;
CGUIDialogContextMenu* dlg = (CGUIDialogContextMenu*)g_windowManager.GetWindow(WINDOW_DIALOG_CONTEXT_MENU);
CAddonDatabase database;
database.Open();
CContextButtons buttons;
for (unsigned int i=0;i<m_rollbackVersions.size();++i)
{
CStdString label(m_rollbackVersions[i]);
if (m_rollbackVersions[i] == m_localAddon->Version().asString())
label += " "+g_localizeStrings.Get(24094);
if (database.IsAddonBlacklisted(m_localAddon->ID(),label))
label += " "+g_localizeStrings.Get(24095);
buttons.Add(i,label);
}
int choice;
if ((choice=dlg->ShowAndGetChoice(buttons)) > -1)
{
// blacklist everything newer
for (unsigned int j=choice+1;j<m_rollbackVersions.size();++j)
database.BlacklistAddon(m_localAddon->ID(),m_rollbackVersions[j]);
CStdString path = "special://home/addons/packages/";
path += m_localAddon->ID()+"-"+m_rollbackVersions[choice]+".zip";
// needed as cpluff won't downgrade
if (!m_localAddon->IsType(ADDON_SERVICE))
//we will handle this for service addons in CAddonInstallJob::OnPostInstall
CAddonMgr::Get().RemoveAddon(m_localAddon->ID());
CAddonInstaller::Get().InstallFromZip(path);
database.RemoveAddonFromBlacklist(m_localAddon->ID(),m_rollbackVersions[choice]);
Close();
}
}
示例2: GetDirectory
//.........这里部分代码省略.........
if (search.IsEmpty() && !GetKeyboardInput(16017, search))
return false;
items.SetProperty("reponame",g_localizeStrings.Get(283));
items.SetLabel(g_localizeStrings.Get(283));
CAddonDatabase database;
database.Open();
database.Search(search, addons);
GenerateListing(path, addons, items, true);
path.SetFileName(search);
items.SetPath(path.Get());
return true;
}
else
{
reposAsFolders = false;
AddonPtr addon;
CAddonMgr::Get().GetAddon(path.GetHostName(),addon);
if (!addon)
return false;
// ensure our repos are up to date
CAddonInstaller::Get().UpdateRepos(false, true);
CAddonDatabase database;
database.Open();
database.GetRepository(addon->ID(),addons);
items.SetProperty("reponame",addon->Name());
items.SetLabel(addon->Name());
}
if (path.GetFileName().IsEmpty())
{
if (!path.GetHostName().Equals("repos"))
{
for (int i=ADDON_UNKNOWN+1;i<ADDON_VIZ_LIBRARY;++i)
{
for (unsigned int j=0;j<addons.size();++j)
{
if (addons[j]->IsType((TYPE)i))
{
CFileItemPtr item(new CFileItem(TranslateType((TYPE)i,true)));
item->SetPath(URIUtils::AddFileToFolder(strPath,TranslateType((TYPE)i,false)));
item->m_bIsFolder = true;
CStdString thumb = GetIcon((TYPE)i);
if (!thumb.IsEmpty() && g_TextureManager.HasTexture(thumb))
item->SetArt("thumb", thumb);
items.Add(item);
break;
}
}
}
items.SetPath(strPath);
return true;
}
}
else
{
TYPE type = TranslateType(path.GetFileName());
items.SetProperty("addoncategory",TranslateType(type, true));
items.SetLabel(TranslateType(type, true));
items.SetPath(strPath);
// FIXME: Categorisation of addons needs adding here
for (unsigned int j=0;j<addons.size();++j)
{
if (!addons[j]->IsType(type))
addons.erase(addons.begin()+j--);
}
}
items.SetPath(strPath);
GenerateListing(path, addons, items, reposAsFolders);
// check for available updates
if (path.GetHostName().Equals("enabled"))
{
CAddonDatabase database;
database.Open();
for (int i=0;i<items.Size();++i)
{
AddonPtr addon2;
database.GetAddon(items[i]->GetProperty("Addon.ID").asString(),addon2);
if (addon2 && addon2->Version() > AddonVersion(items[i]->GetProperty("Addon.Version").asString())
&& !database.IsAddonBlacklisted(addon2->ID(),addon2->Version().c_str()))
{
items[i]->SetProperty("Addon.Status",g_localizeStrings.Get(24068));
items[i]->SetProperty("Addon.UpdateAvail", true);
}
}
}
if (path.GetHostName().Equals("repos") && items.Size() > 1)
{
CFileItemPtr item(new CFileItem("addons://all/",true));
item->SetLabel(g_localizeStrings.Get(24032));
items.Add(item);
}
return true;
}