Permalink
Browse files

changed: bail out immeditaly if CAddonMgr::Init returns false

fixed: caddonmgr singleton access

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@29838 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
1 parent 47a8196 commit 718880811dbe55e5a51464e66d00499be88c81d7 alcoheca committed May 6, 2010
View
2 guilib/GUIInfoTypes.cpp
@@ -239,7 +239,7 @@ CStdString CGUIInfoLabel::ReplaceAddonStrings(const CStdString &label)
int length = work.Find(" ") - (pos1 + 7);
CStdString id = work.substr(pos1+7, length);
int stringid = atoi(work.substr(pos1+7+id.length()+1, 5).c_str());
- CStdString replace = CAddonMgr::Get()->GetString(id, stringid);
+ CStdString replace = CAddonMgr::Get().GetString(id, stringid);
work = left + replace + right;
}
else
View
2 guilib/GUIVisualisationControl.cpp
@@ -29,7 +29,7 @@ void CGUIVisualisationControl::Render()
if (!m_addon && g_application.IsPlayingAudio())
{
AddonPtr viz;
- if (ADDON::CAddonMgr::Get()->GetDefault(ADDON_VIZ, viz))
+ if (ADDON::CAddonMgr::Get().GetDefault(ADDON_VIZ, viz))
LoadAddon(viz);
}
else
View
10 xbmc/Application.cpp
@@ -477,6 +477,12 @@ bool CApplication::Create()
return false;
}
+ if (!CAddonMgr::Get().Init())
+ {
+ CLog::Log(LOGFATAL, "CApplication::Create: Unable to start CAddonMgr");
+ FatalErrorHandler(true, true, true);
+ }
+
g_settings.LoadProfiles(PROFILES_FILE);
CLog::Log(LOGNOTICE, "-----------------------------------------------------------------------");
@@ -1490,7 +1496,7 @@ void CApplication::ReloadSkin()
bool CApplication::LoadSkin(const CStdString& skinID)
{
AddonPtr addon;
- if (CAddonMgr::Get()->GetAddon(skinID, addon))
+ if (CAddonMgr::Get().GetAddon(skinID, addon))
{
LoadSkin(boost::dynamic_pointer_cast<ADDON::CSkinInfo>(addon));
return true;
@@ -4768,7 +4774,7 @@ void CApplication::ProcessSlow()
g_lcd->Initialize();
}
#endif
- ADDON::CAddonMgr::Get()->UpdateRepos();
+ ADDON::CAddonMgr::Get().UpdateRepos();
}
// Global Idle Time in Seconds
View
8 xbmc/FileSystem/AddonsDirectory.cpp
@@ -54,12 +54,12 @@ bool CAddonsDirectory::GetDirectory(const CStdString& strPath, CFileItemList &it
// get info from repository
if (path.GetHostName().Equals("enabled"))
{
- CAddonMgr::Get()->GetAllAddons(addons);
+ CAddonMgr::Get().GetAllAddons(addons);
items.SetProperty("reponame",g_localizeStrings.Get(24062));
}
else if (path.GetHostName().Equals("repos"))
{
- CAddonMgr::Get()->GetAddons(ADDON_REPOSITORY,addons,CONTENT_NONE,true);
+ CAddonMgr::Get().GetAddons(ADDON_REPOSITORY,addons,CONTENT_NONE,true);
}
else if (path.GetHostName().Equals("all"))
{
@@ -71,7 +71,7 @@ bool CAddonsDirectory::GetDirectory(const CStdString& strPath, CFileItemList &it
else
{
AddonPtr addon;
- CAddonMgr::Get()->GetAddon(path.GetHostName(),addon);
+ CAddonMgr::Get().GetAddon(path.GetHostName(),addon);
if (!addon)
return false;
CAddonDatabase database;
@@ -164,7 +164,7 @@ void CAddonsDirectory::GenerateListing(CURL &path, VECADDONS& addons, CFileItemL
pItem->SetProperty("fanart_image",addon->FanArt());
CAddonDatabase::SetPropertiesFromAddon(addon,pItem);
AddonPtr addon2;
- if (CAddonMgr::Get()->GetAddon(addon->ID(),addon2))
+ if (CAddonMgr::Get().GetAddon(addon->ID(),addon2))
pItem->SetProperty("Addon.Status",g_localizeStrings.Get(305));
if (addon2 && addon2->Version() < addon->Version())
{
View
6 xbmc/FileSystem/PluginDirectory.cpp
@@ -79,7 +79,7 @@ bool CPluginDirectory::StartScript(const CStdString& strPath)
{
CURL url(strPath);
- if (!CAddonMgr::Get()->GetAddon(url.GetHostName(), m_addon, ADDON_PLUGIN))
+ if (!CAddonMgr::Get().GetAddon(url.GetHostName(), m_addon, ADDON_PLUGIN))
{
CLog::Log(LOGERROR, "Unable to find plugin %s", url.GetHostName().c_str());
return false;
@@ -386,7 +386,7 @@ bool CPluginDirectory::RunScriptWithParams(const CStdString& strPath)
return false;
AddonPtr addon;
- if (!CAddonMgr::Get()->GetAddon(url.GetHostName(), addon, ADDON_PLUGIN))
+ if (!CAddonMgr::Get().GetAddon(url.GetHostName(), addon, ADDON_PLUGIN))
{
CLog::Log(LOGERROR, "Unable to find plugin %s", url.GetHostName().c_str());
return false;
@@ -427,7 +427,7 @@ bool CPluginDirectory::RunScriptWithParams(const CStdString& strPath)
bool CPluginDirectory::HasPlugins(const CONTENT_TYPE &type)
{
- return CAddonMgr::Get()->HasAddons(ADDON_PLUGIN, type);
+ return CAddonMgr::Get().HasAddons(ADDON_PLUGIN, type);
}
bool CPluginDirectory::WaitOnScriptResult(const CStdString &scriptPath, const CStdString &scriptName)
View
4 xbmc/GUIDialogAddonInfo.cpp
@@ -150,13 +150,13 @@ bool CGUIDialogAddonInfo::ShowForItem(const CFileItemPtr& item)
CURL url(item->m_strPath);
if (url.GetHostName().Equals("enabled"))
{
- CAddonMgr::Get()->GetAddon(item->GetProperty("Addon.ID"),dialog->m_addon);
+ CAddonMgr::Get().GetAddon(item->GetProperty("Addon.ID"),dialog->m_addon);
dialog->m_item->SetProperty("Addon.Installed","true");
dialog->m_localAddon = dialog->m_addon;
}
else
{
- if (CAddonMgr::Get()->GetAddon(item->GetProperty("Addon.ID"),
+ if (CAddonMgr::Get().GetAddon(item->GetProperty("Addon.ID"),
dialog->m_addon))
dialog->m_item->SetProperty("Addon.Installed","true");
else
View
4 xbmc/GUIDialogContentSettings.cpp
@@ -245,12 +245,12 @@ void CGUIDialogContentSettings::FillContentTypes(const CONTENT_TYPE &content)
{
// grab all scrapers which support this content-type
VECADDONS addons;
- if (!CAddonMgr::Get()->GetAddons(ADDON_SCRAPER, addons, content))
+ if (!CAddonMgr::Get().GetAddons(ADDON_SCRAPER, addons, content))
return;
AddonPtr addon;
CStdString defaultID;
- if (CAddonMgr::Get()->GetDefault(ADDON_SCRAPER, addon, content))
+ if (CAddonMgr::Get().GetDefault(ADDON_SCRAPER, addon, content))
defaultID = addon->ID();
for (IVECADDONS it = addons.begin(); it != addons.end(); it++)
View
2 xbmc/GUIDialogContextMenu.cpp
@@ -303,7 +303,7 @@ void CGUIDialogContextMenu::GetContextButtons(const CStdString &type, const CFil
else
{
ADDON::AddonPtr plugin;
- if (ADDON::CAddonMgr::Get()->GetAddon(url.GetHostName(), plugin, ADDON::ADDON_PLUGIN))
+ if (ADDON::CAddonMgr::Get().GetAddon(url.GetHostName(), plugin, ADDON::ADDON_PLUGIN))
if (plugin->HasSettings())
buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045); // Plugin Settings
}
View
8 xbmc/GUIDialogMediaSource.cpp
@@ -279,7 +279,7 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
extraShares.push_back(share1);
}
// add the plugins dir as needed
- if (ADDON::CAddonMgr::Get()->HasAddons(ADDON::ADDON_PLUGIN, CONTENT_AUDIO))
+ if (ADDON::CAddonMgr::Get().HasAddons(ADDON::ADDON_PLUGIN, CONTENT_AUDIO))
{
share1.strPath = "plugin://music/";
share1.strName = g_localizeStrings.Get(1038); // Music Plugins
@@ -319,7 +319,7 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
extraShares.push_back(share1);
// add the plugins dir as needed
- if (ADDON::CAddonMgr::Get()->HasAddons(ADDON::ADDON_PLUGIN, CONTENT_VIDEO))
+ if (ADDON::CAddonMgr::Get().HasAddons(ADDON::ADDON_PLUGIN, CONTENT_VIDEO))
{
share1.strPath = "plugin://video/";
share1.strName = g_localizeStrings.Get(1037); // Video Plugins
@@ -350,7 +350,7 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
extraShares.push_back(share1);
// add the plugins dir as needed
- if (ADDON::CAddonMgr::Get()->HasAddons(ADDON::ADDON_PLUGIN, CONTENT_IMAGE))
+ if (ADDON::CAddonMgr::Get().HasAddons(ADDON::ADDON_PLUGIN, CONTENT_IMAGE))
{
share1.strPath = "plugin://pictures/";
share1.strName = g_localizeStrings.Get(1039); // Picture Plugins
@@ -359,7 +359,7 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
}
else if (m_type == "programs")
{
- if (ADDON::CAddonMgr::Get()->HasAddons(ADDON::ADDON_PLUGIN, CONTENT_PROGRAM))
+ if (ADDON::CAddonMgr::Get().HasAddons(ADDON::ADDON_PLUGIN, CONTENT_PROGRAM))
{
CMediaSource share2;
share2.strPath = "plugin://programs/";
View
2 xbmc/GUIMediaWindow.cpp
@@ -1339,7 +1339,7 @@ bool CGUIMediaWindow::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{
CURL plugin(m_vecItems->Get(itemNumber)->m_strPath);
ADDON::AddonPtr addon;
- if (CAddonMgr::Get()->GetAddon(plugin.GetHostName(), addon, ADDON_PLUGIN))
+ if (CAddonMgr::Get().GetAddon(plugin.GetHostName(), addon, ADDON_PLUGIN))
if (CGUIDialogAddonSettings::ShowAndGetInput(addon))
Update(m_vecItems->m_strPath);
return true;
View
2 xbmc/GUIViewState.cpp
@@ -348,7 +348,7 @@ VECSOURCES& CGUIViewState::GetSources()
return m_sources;
ADDON::VECADDONS addons;
- ADDON::CAddonMgr::Get()->GetAddons(ADDON::ADDON_PLUGIN, addons, m_content);
+ ADDON::CAddonMgr::Get().GetAddons(ADDON::ADDON_PLUGIN, addons, m_content);
for (unsigned i=0; i<addons.size(); i++)
{
View
4 xbmc/GUIViewStateAddonBrowser.cpp
@@ -59,7 +59,7 @@ VECSOURCES& CGUIViewStateAddonBrowser::GetSources()
m_sources.clear();
VECADDONS addons;
- CAddonMgr::Get()->GetAllAddons(addons);
+ CAddonMgr::Get().GetAllAddons(addons);
if (addons.size())
{
CMediaSource share;
@@ -70,7 +70,7 @@ VECSOURCES& CGUIViewStateAddonBrowser::GetSources()
m_sources.push_back(share);
}
addons.clear();
- CAddonMgr::Get()->GetAddons(ADDON_REPOSITORY,addons,CONTENT_NONE,true);
+ CAddonMgr::Get().GetAddons(ADDON_REPOSITORY,addons,CONTENT_NONE,true);
if (addons.size())
{
CMediaSource share;
View
12 xbmc/GUIWindowAddonBrowser.cpp
@@ -179,7 +179,7 @@ void CGUIWindowAddonBrowser::GetContextButtons(int itemNumber,
TYPE type = TranslateType(pItem->GetProperty("Addon.intType"));
AddonPtr addon;
- if (!CAddonMgr::Get()->GetAddon(pItem->GetProperty("Addon.ID"),
+ if (!CAddonMgr::Get().GetAddon(pItem->GetProperty("Addon.ID"),
addon, type, false))
return;
@@ -201,13 +201,13 @@ bool CGUIWindowAddonBrowser::OnContextButton(int itemNumber,
{
if (button == CONTEXT_BUTTON_SCAN)
{
- CAddonMgr::Get()->FindAddons();
+ CAddonMgr::Get().FindAddons();
return true;
}
}
TYPE type = TranslateType(pItem->GetProperty("Addon.intType"));
AddonPtr addon;
- if (!CAddonMgr::Get()->GetAddon(pItem->GetProperty("Addon.ID"),
+ if (!CAddonMgr::Get().GetAddon(pItem->GetProperty("Addon.ID"),
addon, type, false))
return false;
@@ -314,7 +314,7 @@ void CGUIWindowAddonBrowser::OnJobComplete(unsigned int jobID,
it != addon->GetDeps().end();++it)
{
AddonPtr addon2;
- if (!CAddonMgr::Get()->GetAddon(it->first,addon2))
+ if (!CAddonMgr::Get().GetAddon(it->first,addon2))
{
CAddonDatabase database;
database.Open();
@@ -325,7 +325,7 @@ void CGUIWindowAddonBrowser::OnJobComplete(unsigned int jobID,
if (addon->Type() >= ADDON_VIZ_LIBRARY)
continue;
AddonPtr addon2;
- if (CAddonMgr::Get()->GetAddon(addon->ID(),addon2))
+ if (CAddonMgr::Get().GetAddon(addon->ID(),addon2))
{
g_application.m_guiDialogKaiToast.QueueNotification(
CGUIDialogKaiToast::Info,
@@ -343,7 +343,7 @@ void CGUIWindowAddonBrowser::OnJobComplete(unsigned int jobID,
}
}
}
- CAddonMgr::Get()->FindAddons();
+ CAddonMgr::Get().FindAddons();
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE);
g_windowManager.SendThreadMessage(msg);
View
2 xbmc/GUIWindowMusicNav.cpp
@@ -732,7 +732,7 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
if (!m_musicdatabase.GetScraperForPath(path,scraper))
{
ADDON::AddonPtr defaultScraper;
- if (ADDON::CAddonMgr::Get()->GetDefault(ADDON::ADDON_SCRAPER, defaultScraper, CONTENT_ALBUMS))
+ if (ADDON::CAddonMgr::Get().GetDefault(ADDON::ADDON_SCRAPER, defaultScraper, CONTENT_ALBUMS))
{
scraper = boost::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone(defaultScraper));
}
View
2 xbmc/GUIWindowScreensaver.cpp
@@ -133,7 +133,7 @@ bool CGUIWindowScreensaver::OnMessage(CGUIMessage& message)
m_addon.reset();
// Setup new screensaver instance
AddonPtr addon;
- if (!CAddonMgr::Get()->GetAddon(g_guiSettings.GetString("screensaver.mode"), addon, ADDON_SCREENSAVER))
+ if (!CAddonMgr::Get().GetAddon(g_guiSettings.GetString("screensaver.mode"), addon, ADDON_SCREENSAVER))
return false;
m_addon = boost::dynamic_pointer_cast<CScreenSaver>(addon);
View
6 xbmc/GUIWindowScripts.cpp
@@ -189,7 +189,7 @@ void CGUIWindowScripts::FrameMove()
bool CGUIWindowScripts::GetDirectory(const CStdString& strDirectory, CFileItemList& items)
{
VECADDONS addons;
- CAddonMgr::Get()->GetAddons(ADDON_SCRIPT,addons);
+ CAddonMgr::Get().GetAddons(ADDON_SCRIPT,addons);
items.ClearItems();
for (unsigned i=0; i < addons.size(); i++)
@@ -217,7 +217,7 @@ void CGUIWindowScripts::GetContextButtons(int itemNumber, CContextButtons &butto
CStdString path, filename;
CUtil::Split(item->m_strPath, path, filename);
ADDON::AddonPtr script;
- if (ADDON::CAddonMgr::Get()->GetAddon(item->m_strPath, script, ADDON::ADDON_SCRIPT))
+ if (ADDON::CAddonMgr::Get().GetAddon(item->m_strPath, script, ADDON::ADDON_SCRIPT))
{
if (script->HasSettings())
{
@@ -242,7 +242,7 @@ bool CGUIWindowScripts::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
CStdString path, filename;
CUtil::Split(m_vecItems->Get(itemNumber)->m_strPath, path, filename);
ADDON::AddonPtr script;
- if (ADDON::CAddonMgr::Get()->GetAddon(m_vecItems->Get(itemNumber)->m_strPath, script, ADDON::ADDON_SCRIPT))
+ if (ADDON::CAddonMgr::Get().GetAddon(m_vecItems->Get(itemNumber)->m_strPath, script, ADDON::ADDON_SCRIPT))
{
if (CGUIDialogAddonSettings::ShowAndGetInput(script))
Update(m_vecItems->m_strPath);
View
8 xbmc/GUIWindowSettingsCategory.cpp
@@ -1068,7 +1068,7 @@ void CGUIWindowSettingsCategory::OnClick(CBaseSettingControl *pSettingControl)
{
CStdString name = g_guiSettings.GetString("weather.script");
AddonPtr addon;
- if (CAddonMgr::Get()->GetAddon(name, addon, ADDON_PLUGIN))
+ if (CAddonMgr::Get().GetAddon(name, addon, ADDON_PLUGIN))
{ // TODO: maybe have ShowAndGetInput return a bool if settings changed, then only reset weather if true.
CGUIDialogAddonSettings::ShowAndGetInput(addon);
}
@@ -2273,7 +2273,7 @@ void CGUIWindowSettingsCategory::FillInVisualisations(CSetting *pSetting, int iC
vector<CStdString> vecVis;
VECADDONS addons;
- CAddonMgr::Get()->GetAddons(ADDON_VIZ, addons);
+ CAddonMgr::Get().GetAddons(ADDON_VIZ, addons);
if (!addons.empty())
{
for (unsigned int i = 0; i < addons.size(); i++)
@@ -2701,7 +2701,7 @@ void CGUIWindowSettingsCategory::FillInAddons(CGUISpinControlEx *pControl, CSett
pSetting->m_entries.insert(std::make_pair("_virtual.fan", g_localizeStrings.Get(20425))); // Fanart Slideshow
}
- CAddonMgr::Get()->GetAddons(pSetting->m_type, addons, pSetting->m_content);
+ CAddonMgr::Get().GetAddons(pSetting->m_type, addons, pSetting->m_content);
for (IVECADDONS it = addons.begin(); it != addons.end(); it++)
{
AddonPtr addon = *it;
@@ -2848,7 +2848,7 @@ void CGUIWindowSettingsCategory::FillInWeatherScripts(CGUISpinControlEx *pContro
pControl->AddLabel(g_localizeStrings.Get(24028), j++);
//find weather scripts....
- CAddonMgr::Get()->GetAddons(ADDON_SCRIPT, addons);
+ CAddonMgr::Get().GetAddons(ADDON_SCRIPT, addons);
if (!addons.empty())
{
for (unsigned int i = 0; i < addons.size(); i++)
View
2 xbmc/GUIWindowVisualisation.cpp
@@ -177,7 +177,7 @@ bool CGUIWindowVisualisation::OnMessage(CGUIMessage& message)
}
AddonPtr viz;
- if (CAddonMgr::Get()->GetDefault(ADDON_VIZ, viz))
+ if (CAddonMgr::Get().GetDefault(ADDON_VIZ, viz))
m_addon = boost::dynamic_pointer_cast<CVisualisation>(viz);
else
m_addon.reset();
View
2 xbmc/GUIWindowWeather.cpp
@@ -299,7 +299,7 @@ void CGUIWindowWeather::CallScript()
if (!g_guiSettings.GetString("weather.script").IsEmpty())
{
AddonPtr addon;
- if (!ADDON::CAddonMgr::Get()->GetAddon(g_guiSettings.GetString("weather.script"), addon, ADDON_SCRIPT))
+ if (!ADDON::CAddonMgr::Get().GetAddon(g_guiSettings.GetString("weather.script"), addon, ADDON_SCRIPT))
return;
// create the full path to the script
View
6 xbmc/MusicDatabase.cpp
@@ -4083,7 +4083,7 @@ bool CMusicDatabase::GetScraperForPath(const CStdString& strPath, ADDON::Scraper
if (content != CONTENT_NONE)
{ // content set, use pre configured or default scraper
ADDON::AddonPtr addon;
- if (!scraperUUID.empty() && ADDON::CAddonMgr::Get()->GetAddon(scraperUUID, addon, ADDON::ADDON_SCRAPER) && addon)
+ if (!scraperUUID.empty() && ADDON::CAddonMgr::Get().GetAddon(scraperUUID, addon, ADDON::ADDON_SCRAPER) && addon)
{
info = boost::dynamic_pointer_cast<ADDON::CScraper>(addon->Clone(addon));
if (!info)
@@ -4097,7 +4097,7 @@ bool CMusicDatabase::GetScraperForPath(const CStdString& strPath, ADDON::Scraper
else
{ // use default scraper for this content type
ADDON::AddonPtr defaultScraper;
- if (ADDON::CAddonMgr::Get()->GetDefault(ADDON::ADDON_SCRAPER, defaultScraper, content))
+ if (ADDON::CAddonMgr::Get().GetDefault(ADDON::ADDON_SCRAPER, defaultScraper, content))
{
info = boost::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone(defaultScraper));
if (info)
@@ -4112,7 +4112,7 @@ bool CMusicDatabase::GetScraperForPath(const CStdString& strPath, ADDON::Scraper
if (!info)
{ // use default music scraper instead
ADDON::AddonPtr addon;
- if(ADDON::CAddonMgr::Get()->GetDefault(ADDON::ADDON_SCRAPER, addon, CONTENT_ALBUMS))
+ if(ADDON::CAddonMgr::Get().GetDefault(ADDON::ADDON_SCRAPER, addon, CONTENT_ALBUMS))
{
info = boost::dynamic_pointer_cast<ADDON::CScraper>(addon);
return (info);
View
2 xbmc/NfoFile.cpp
@@ -69,7 +69,7 @@ CNfoFile::NFOResult CNfoFile::Create(const CStdString& strPath, const ScraperPtr
AddonPtr addon;
ScraperPtr defaultScraper;
- if (!CAddonMgr::Get()->GetDefault(ADDON_SCRAPER, addon, m_content))
+ if (!CAddonMgr::Get().GetDefault(ADDON_SCRAPER, addon, m_content))
return NO_NFO;
else
defaultScraper = boost::dynamic_pointer_cast<CScraper>(addon);
View
6 xbmc/VideoDatabase.cpp
@@ -5598,7 +5598,7 @@ ScraperPtr CVideoDatabase::GetScraperForPath(const CStdString& strPath, SScanSet
AddonPtr addon;
if (!scraperID.empty() &&
- CAddonMgr::Get()->GetAddon(scraperID, addon, ADDON::ADDON_SCRAPER))
+ CAddonMgr::Get().GetAddon(scraperID, addon, ADDON::ADDON_SCRAPER))
{
scraper = boost::dynamic_pointer_cast<CScraper>(addon->Clone(addon));
if (!scraper)
@@ -5642,7 +5642,7 @@ ScraperPtr CVideoDatabase::GetScraperForPath(const CStdString& strPath, SScanSet
AddonPtr addon;
if (content != CONTENT_NONE &&
- CAddonMgr::Get()->GetAddon(m_pDS->fv("path.strScraper").get_asString(), addon, ADDON::ADDON_SCRAPER))
+ CAddonMgr::Get().GetAddon(m_pDS->fv("path.strScraper").get_asString(), addon, ADDON::ADDON_SCRAPER))
{
scraper = boost::dynamic_pointer_cast<CScraper>(addon->Clone(addon));
scraper->m_pathContent = content;
@@ -7659,7 +7659,7 @@ void CVideoDatabase::ImportFromXML(const CStdString &path)
uuid = CUtil::GetFileName(uuid);
}
- if (CAddonMgr::Get()->GetAddon(uuid, addon, ADDON::ADDON_SCRAPER))
+ if (CAddonMgr::Get().GetAddon(uuid, addon, ADDON::ADDON_SCRAPER))
{
SScanSettings settings;
ScraperPtr scraper = boost::dynamic_pointer_cast<CScraper>(addon);
View
2 xbmc/addons/Addon.cpp
@@ -325,7 +325,7 @@ void CAddon::BuildLibName(cp_plugin_info_t *props)
{
case ADDON_SCREENSAVER:
{
- CStdString temp = CAddonMgr::Get()->GetExtValue(props->extensions->configuration, "@library");
+ CStdString temp = CAddonMgr::Get().GetExtValue(props->extensions->configuration, "@library");
m_strLibName = temp;
}
break;
View
15 xbmc/addons/AddonManager.cpp
@@ -62,7 +62,6 @@ cp_log_severity_t clog_to_cp(int);
*
*/
-CAddonMgr* CAddonMgr::m_pInstance = NULL;
map<TYPE, IAddonMgrCallback*> CAddonMgr::m_managers;
AddonPtr AddonFactory(const cp_extension_t *props)
@@ -168,7 +167,7 @@ bool CAddonMgr::Init()
}
status = m_cpluff->register_logger(m_cp_context, cp_logger,
- &CAddonMgr::m_pInstance, clog_to_cp(g_advancedSettings.m_logLevel));
+ &CAddonMgr::Get(), clog_to_cp(g_advancedSettings.m_logLevel));
if (status != CP_OK)
{
CLog::Log(LOGERROR, "ADDONS: Fatal Error, cp_register_logger() returned status: %i", status);
@@ -208,17 +207,17 @@ bool CAddonMgr::HasAddons(const TYPE &type, const CONTENT_TYPE &content/*= CONTE
bool CAddonMgr::GetAllAddons(VECADDONS &addons, bool enabledOnly/*= true*/)
{
VECADDONS temp;
- if (CAddonMgr::Get()->GetAddons(ADDON_PLUGIN, temp, CONTENT_NONE, enabledOnly))
+ if (CAddonMgr::Get().GetAddons(ADDON_PLUGIN, temp, CONTENT_NONE, enabledOnly))
addons.insert(addons.end(), temp.begin(), temp.end());
- if (CAddonMgr::Get()->GetAddons(ADDON_SCRAPER, temp, CONTENT_NONE, enabledOnly))
+ if (CAddonMgr::Get().GetAddons(ADDON_SCRAPER, temp, CONTENT_NONE, enabledOnly))
addons.insert(addons.end(), temp.begin(), temp.end());
- if (CAddonMgr::Get()->GetAddons(ADDON_SCREENSAVER, temp, CONTENT_NONE, enabledOnly))
+ if (CAddonMgr::Get().GetAddons(ADDON_SCREENSAVER, temp, CONTENT_NONE, enabledOnly))
addons.insert(addons.end(), temp.begin(), temp.end());
- if (CAddonMgr::Get()->GetAddons(ADDON_SCRIPT, temp, CONTENT_NONE, enabledOnly))
+ if (CAddonMgr::Get().GetAddons(ADDON_SCRIPT, temp, CONTENT_NONE, enabledOnly))
addons.insert(addons.end(), temp.begin(), temp.end());
- if (CAddonMgr::Get()->GetAddons(ADDON_SKIN, temp, CONTENT_NONE, enabledOnly))
+ if (CAddonMgr::Get().GetAddons(ADDON_SKIN, temp, CONTENT_NONE, enabledOnly))
addons.insert(addons.end(), temp.begin(), temp.end());
- if (CAddonMgr::Get()->GetAddons(ADDON_VIZ, temp, CONTENT_NONE, enabledOnly))
+ if (CAddonMgr::Get().GetAddons(ADDON_VIZ, temp, CONTENT_NONE, enabledOnly))
addons.insert(addons.end(), temp.begin(), temp.end());
return !addons.empty();
}
View
4 xbmc/addons/AddonManager.h
@@ -110,10 +110,10 @@ namespace ADDON
DllLibCPluff *m_cpluff;
static void cp_fatalErrorHandler(const char *msg) {
- CAddonMgr::Get()->CPluffFatalError(msg);
+ CAddonMgr::Get().CPluffFatalError(msg);
}
static void cp_logger(cp_log_severity_t level, const char *msg, const char *apid, void *user_data) {
- CAddonMgr::Get()->CPluffLog(level, msg, apid, user_data);
+ CAddonMgr::Get().CPluffLog(level, msg, apid, user_data);
}
private:
View
8 xbmc/addons/AddonStatusHandler.cpp
@@ -102,7 +102,7 @@ void CAddonStatusHandler::Process()
g_application.getApplicationMessenger().SendMessage(tMsg, true);
if (pDialog->IsConfirmed())
- CAddonMgr::Get()->GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, false);
+ CAddonMgr::Get().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, false);
}
/* Request to restart the AddOn and data structures need updated */
else if (m_status == STATUS_NEED_RESTART)
@@ -117,7 +117,7 @@ void CAddonStatusHandler::Process()
ThreadMessage tMsg = {TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_OK, g_windowManager.GetActiveWindow()};
g_application.getApplicationMessenger().SendMessage(tMsg, true);
- CAddonMgr::Get()->GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
+ CAddonMgr::Get().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
/* Some required settings are missing/invalid */
else if (m_status == STATUS_NEED_SETTINGS)
@@ -144,15 +144,15 @@ void CAddonStatusHandler::Process()
{
//todo doesn't dialogaddonsettings save these automatically? should do
m_addon->SaveSettings();
- CAddonMgr::Get()->GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
+ CAddonMgr::Get().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
else
m_addon->LoadSettings();
}
/* A unknown event has occurred */
else if (m_status == STATUS_UNKNOWN)
{
- //CAddonMgr::Get()->DisableAddon(m_addon->ID());
+ //CAddonMgr::Get().DisableAddon(m_addon->ID());
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (!pDialog) return;
View
2 xbmc/addons/Repository.cpp
@@ -199,7 +199,7 @@ bool CRepositoryUpdateJob::DoWork()
for (unsigned int i=0;i<addons.size();++i)
{
AddonPtr addon;
- if (CAddonMgr::Get()->GetAddon(addons[i]->ID(),addon) &&
+ if (CAddonMgr::Get().GetAddon(addons[i]->ID(),addon) &&
addons[i]->Version() > addon->Version())
{
if (g_settings.m_bAddonAutoUpdate || addon->Type() >= ADDON_VIZ_LIBRARY)
View
2 xbmc/addons/Scraper.cpp
@@ -87,7 +87,7 @@ bool CScraper::LoadUserXML(const CStdString& strSaved)
bool CScraper::LoadSettingsXML(const CStdString& strFunction, const CScraperUrl* url)
{
AddonPtr addon;
- if (!Parent() && !CAddonMgr::Get()->GetAddon(ID(), addon, ADDON_SCRAPER))
+ if (!Parent() && !CAddonMgr::Get().GetAddon(ID(), addon, ADDON_SCRAPER))
return false;
else if (Parent())
addon = Parent();
View
6 xbmc/addons/Skin.cpp
@@ -49,13 +49,13 @@ CSkinInfo::CSkinInfo(cp_plugin_info_t *props)
CLog::Log(LOGINFO, "Default 4:3 resolution directory is %s", CUtil::AddFileToFolder(Path(), GetDirFromRes(m_DefaultResolution)).c_str());
CLog::Log(LOGINFO, "Default 16:9 resolution directory is %s", CUtil::AddFileToFolder(Path(), GetDirFromRes(m_DefaultResolutionWide)).c_str());
- CStdString str = CAddonMgr::Get()->GetExtValue(props->extensions->configuration, "@effectslowdown");
+ CStdString str = CAddonMgr::Get().GetExtValue(props->extensions->configuration, "@effectslowdown");
if (!str.IsEmpty())
m_effectsSlowDown = (float)atof(str.c_str());
else
m_effectsSlowDown = 1.f;
- str = CAddonMgr::Get()->GetExtValue(props->extensions->configuration, "@debugging");
+ str = CAddonMgr::Get().GetExtValue(props->extensions->configuration, "@debugging");
m_debugging = !strcmp(str.c_str(), "true");
m_onlyAnimateToHome = true;
@@ -275,7 +275,7 @@ void CSkinInfo::GetSkinPaths(std::vector<CStdString> &paths) const
void CSkinInfo::GetDefaultResolution(cp_plugin_info_t *props, const char *tag, RESOLUTION &res, const RESOLUTION &def) const
{
//FIXME! only respects one extension per addon
- CStdString strRes(CAddonMgr::Get()->GetExtValue(props->extensions->configuration, tag));
+ CStdString strRes(CAddonMgr::Get().GetExtValue(props->extensions->configuration, tag));
if (!strRes.empty())
{
strRes.ToLower();
View
2 xbmc/lib/libPython/xbmcmodule/PythonSettings.cpp
@@ -64,7 +64,7 @@ namespace PYXBMC
};
AddonPtr addon;
- if (!CAddonMgr::Get()->GetAddon(CStdString(cScriptID), self->pAddon, ADDON::ADDON_SCRIPT) || !self->pAddon)
+ if (!CAddonMgr::Get().GetAddon(CStdString(cScriptID), self->pAddon, ADDON::ADDON_SCRIPT) || !self->pAddon)
{
PyErr_SetString(PyExc_Exception, "Could not get AddonPtr!");
return NULL;
View
4 xbmc/utils/Builtins.cpp
@@ -351,7 +351,7 @@ int CBuiltins::Execute(const CStdString& execString)
AddonPtr script;
CStdString scriptpath(params[0]);
- if (CAddonMgr::Get()->GetAddon(params[0], script))
+ if (CAddonMgr::Get().GetAddon(params[0], script))
scriptpath = CUtil::AddFileToFolder(script->Path(),script->LibName());
g_pythonParser.evalFile(scriptpath.c_str(), argc, (const char**)argv);
@@ -1278,7 +1278,7 @@ int CBuiltins::Execute(const CStdString& execString)
else if (execute.Equals("addon.default.opensettings") && params.size() == 1)
{
AddonPtr addon;
- if (CAddonMgr::Get()->GetDefault(TranslateType(params[0]), addon))
+ if (CAddonMgr::Get().GetDefault(TranslateType(params[0]), addon))
CGUIDialogAddonSettings::ShowAndGetInput(addon);
}
#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
View
2 xbmc/utils/ScraperParser.cpp
@@ -154,7 +154,7 @@ bool CScraperParser::LoadFromXML()
while (itr != deps.end())
{
AddonPtr dep;
- if (!CAddonMgr::Get()->GetAddon((*itr).first, dep, ADDON_SCRAPER_LIBRARY, false))
+ if (!CAddonMgr::Get().GetAddon((*itr).first, dep, ADDON_SCRAPER_LIBRARY, false))
{
itr++;
continue;

0 comments on commit 7188808

Please sign in to comment.