Permalink
Browse files

cleanup: Rename and document the cpluff versions of loading addon des…

…criptions

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30416 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
1 parent 92afa2e commit 5bca9c0242d292d7f97e7ab6115f1b5367e3d91c jmarshallnz committed May 22, 2010
Showing with 20 additions and 6 deletions.
  1. +1 −1 xbmc/GUIWindowAddonBrowser.cpp
  2. +2 −2 xbmc/addons/AddonManager.cpp
  3. +16 −2 xbmc/addons/AddonManager.h
  4. +1 −1 xbmc/addons/Repository.cpp
@@ -306,7 +306,7 @@ void CGUIWindowAddonBrowser::OnJobComplete(unsigned int jobID,
CUtil::GetFileName(strFolder));
}
AddonPtr addon;
- if (CAddonMgr::Get().CPAddonFromInfoXML(strFolder, addon))
+ if (CAddonMgr::Get().LoadAddonDescription(strFolder, addon))
{
CStdString strFolder2;
CUtil::GetDirectory(strFolder,strFolder2);
@@ -1017,7 +1017,7 @@ CStdString CAddonMgr::GetExtValue(cp_cfg_element_t *base, const char *path)
else return CStdString();
}
-bool CAddonMgr::CPAddonFromInfoXML(const CStdString &path, AddonPtr &addon)
+bool CAddonMgr::LoadAddonDescription(const CStdString &path, AddonPtr &addon)
{
cp_status_t status;
cp_plugin_info_t *info = m_cpluff->load_plugin_descriptor(m_cp_context, _P(path).c_str(), &status);
@@ -1030,7 +1030,7 @@ bool CAddonMgr::CPAddonFromInfoXML(const CStdString &path, AddonPtr &addon)
return false;
}
-bool CAddonMgr::AddonsFromInfoXML(const TiXmlElement *root, VECADDONS &addons)
+bool CAddonMgr::AddonsFromRepoXML(const TiXmlElement *root, VECADDONS &addons)
{
// create a context for these addons
cp_status_t status;
@@ -105,8 +105,22 @@ namespace ADDON
/* libcpluff */
CStdString GetExtValue(cp_cfg_element_t *base, const char *path);
const cp_extension_t *GetExtension(const cp_plugin_info_t *props, const char *extension);
- bool CPAddonFromInfoXML(const CStdString &path, AddonPtr &addon);
- bool AddonsFromInfoXML(const TiXmlElement *root, VECADDONS &addons);
+
+ /*! \brief Load the addon in the given path
+ This loads the addon using c-pluff which parses the addon descriptor file.
+ \param path folder that contains the addon.
+ \param addon [out] returned addon.
+ \return true if addon is set, false otherwise.
+ */
+ bool LoadAddonDescription(const CStdString &path, AddonPtr &addon);
+
+ /*! \brief Parse a repository XML file for addons and load their descriptors
+ A repository XML is essentially a concatenated list of addon descriptors.
+ \param root Root element of an XML document.
+ \param addons [out] returned list of addons.
+ \return true if the repository XML file is parsed, false otherwise.
+ */
+ bool AddonsFromRepoXML(const TiXmlElement *root, VECADDONS &addons);
private:
void LoadAddons(const CStdString &path,
@@ -120,7 +120,7 @@ VECADDONS CRepository::Parse()
doc.LoadFile(file);
if (doc.RootElement())
{
- CAddonMgr::Get().AddonsFromInfoXML(doc.RootElement(), result);
+ CAddonMgr::Get().AddonsFromRepoXML(doc.RootElement(), result);
// FIXME no need for this once everything is c-pluff'd
TiXmlElement* element = doc.RootElement()->FirstChildElement("addoninfo");
while (element)

0 comments on commit 5bca9c0

Please sign in to comment.