本文整理汇总了C++中CAddonDatabase::OnPostUnInstall方法的典型用法代码示例。如果您正苦于以下问题:C++ CAddonDatabase::OnPostUnInstall方法的具体用法?C++ CAddonDatabase::OnPostUnInstall怎么用?C++ CAddonDatabase::OnPostUnInstall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAddonDatabase
的用法示例。
在下文中一共展示了CAddonDatabase::OnPostUnInstall方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoWork
bool CAddonUnInstallJob::DoWork()
{
ADDON::OnPreUnInstall(m_addon);
//Unregister addon with the manager to ensure nothing tries
//to interact with it while we are uninstalling.
CAddonMgr::GetInstance().UnregisterAddon(m_addon->ID());
if (!DeleteAddon(m_addon->Path()))
{
CLog::Log(LOGERROR, "CAddonUnInstallJob[%s]: could not delete addon data.", m_addon->ID().c_str());
return false;
}
ClearFavourites();
AddonPtr addon;
CAddonDatabase database;
// try to get the addon object from the repository as the local one does not exist anymore
// if that doesn't work fall back to the local one
if (!database.Open() || !database.GetAddon(m_addon->ID(), addon) || addon == NULL)
addon = m_addon;
CEventLog::GetInstance().Add(EventPtr(new CAddonManagementEvent(addon, 24144)));
CAddonMgr::GetInstance().OnPostUnInstall(m_addon->ID());
database.OnPostUnInstall(m_addon->ID());
ADDON::OnPostUnInstall(m_addon);
return true;
}
示例2: DoWork
bool CAddonUnInstallJob::DoWork()
{
ADDON::OnPreUnInstall(m_addon);
//TODO: looks broken. it just calls the repo with the most recent version, not the owner
RepositoryPtr repoPtr;
CAddonInstaller::GetRepoForAddon(m_addon->ID(), repoPtr);
if (repoPtr != NULL && !repoPtr->Props().libname.empty())
{
CFileItemList dummy;
std::string s = StringUtils::Format("plugin://%s/?action=uninstall&package=%s", repoPtr->ID().c_str(), m_addon->ID().c_str());
if (!CDirectory::GetDirectory(s, dummy))
return false;
}
else
{
//Unregister addon with the manager to ensure nothing tries
//to interact with it while we are uninstalling.
CAddonMgr::GetInstance().UnregisterAddon(m_addon->ID());
if (!DeleteAddon(m_addon->Path()))
{
CLog::Log(LOGERROR, "CAddonUnInstallJob[%s]: could not delete addon data.", m_addon->ID().c_str());
return false;
}
}
ClearFavourites();
AddonPtr addon;
CAddonDatabase database;
// try to get the addon object from the repository as the local one does not exist anymore
// if that doesn't work fall back to the local one
if (!database.Open() || !database.GetAddon(m_addon->ID(), addon) || addon == NULL)
addon = m_addon;
CEventLog::GetInstance().Add(EventPtr(new CAddonManagementEvent(addon, 24144)));
CAddonMgr::GetInstance().OnPostUnInstall(m_addon->ID());
database.OnPostUnInstall(m_addon->ID());
ADDON::OnPostUnInstall(m_addon);
return true;
}
示例3: DoWork
bool CAddonUnInstallJob::DoWork()
{
ADDON::OnPreUnInstall(m_addon);
//Unregister addon with the manager to ensure nothing tries
//to interact with it while we are uninstalling.
if (!CAddonMgr::GetInstance().UnloadAddon(m_addon))
{
CLog::Log(LOGERROR, "CAddonUnInstallJob[%s]: failed to unload addon.", m_addon->ID().c_str());
return false;
}
CFilesystemInstaller fsInstaller;
if (!fsInstaller.UnInstallFromFilesystem(m_addon->Path()))
{
CLog::Log(LOGERROR, "CAddonUnInstallJob[%s]: could not delete addon data.", m_addon->ID().c_str());
return false;
}
ClearFavourites();
if (m_removeData)
CFileUtils::DeleteItem("special://profile/addon_data/"+m_addon->ID()+"/", true);
AddonPtr addon;
CAddonDatabase database;
// try to get the addon object from the repository as the local one does not exist anymore
// if that doesn't work fall back to the local one
if (!database.Open() || !database.GetAddon(m_addon->ID(), addon) || addon == NULL)
addon = m_addon;
CEventLog::GetInstance().Add(EventPtr(new CAddonManagementEvent(addon, 24144)));
CAddonMgr::GetInstance().OnPostUnInstall(m_addon->ID());
database.OnPostUnInstall(m_addon->ID());
ADDON::OnPostUnInstall(m_addon);
return true;
}