Permalink
Browse files

fixed: disabling addons

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30480 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
1 parent d59f94a commit f1031c4716fd594f9aa17d46bf2d672a0ef11575 spiff_ committed May 23, 2010
Showing with 11 additions and 0 deletions.
  1. +1 −0 xbmc/GUIDialogAddonInfo.cpp
  2. +6 −0 xbmc/addons/AddonManager.cpp
  3. +1 −0 xbmc/addons/AddonManager.h
  4. +3 −0 xbmc/addons/DllLibCPluff.h
@@ -137,6 +137,7 @@ void CGUIDialogAddonInfo::OnDisable()
list[0]->Select(true);
CJobManager::GetInstance().AddJob(new CFileOperationJob(CFileOperationJob::ActionDelete,list,""),window);
}
+ CAddonMgr::Get().RemoveAddon(m_localAddon->ID());
}
void CGUIDialogAddonInfo::OnSettings()
@@ -406,6 +406,12 @@ void CAddonMgr::FindAddons()
m_cpluff->scan_plugins(m_cp_context, 0);
}
+void CAddonMgr::RemoveAddon(const CStdString& ID)
+{
+ if (m_cpluff && m_cp_context)
+ m_cpluff->uninstall_plugin(m_cp_context,ID.c_str());
+}
+
bool CAddonMgr::GetTranslatedString(const TiXmlElement *xmldoc, const char *tag, CStdString& data)
{
const TiXmlElement *element = xmldoc->FirstChildElement(tag);
@@ -99,6 +99,7 @@ namespace ADDON
static AddonPtr AddonFromProps(AddonProps& props);
void UpdateRepos();
void FindAddons();
+ void RemoveAddon(const CStdString& ID);
/* libcpluff */
CStdString GetExtValue(cp_cfg_element_t *base, const char *path);
@@ -53,6 +53,7 @@ class DllLibCPluffInterface
virtual void release_symbol(cp_context_t *ctx, const void *ptr) =0;
virtual cp_plugin_info_t *load_plugin_descriptor(cp_context_t *ctx, const char *path, cp_status_t *status) =0;
virtual cp_plugin_info_t *load_plugin_descriptor_from_memory(cp_context_t *ctx, const char *buffer, unsigned int buffer_len, cp_status_t *status) =0;
+ virtual cp_status_t uninstall_plugin(cp_context_t *ctx, const char *id)=0;
};
class DllLibCPluff : public DllDynamic, DllLibCPluffInterface
@@ -85,6 +86,7 @@ class DllLibCPluff : public DllDynamic, DllLibCPluffInterface
DEFINE_METHOD2(void, release_symbol, (cp_context_t *p1, const void *p2))
DEFINE_METHOD3(cp_plugin_info_t*, load_plugin_descriptor, (cp_context_t *p1, const char *p2, cp_status_t *p3))
DEFINE_METHOD4(cp_plugin_info_t*, load_plugin_descriptor_from_memory, (cp_context_t *p1, const char *p2, unsigned int p3, cp_status_t *p4))
+ DEFINE_METHOD2(cp_status_t, uninstall_plugin, (cp_context_t *p1, const char *p2))
BEGIN_METHOD_RESOLVE()
RESOLVE_METHOD_RENAME(cp_get_version, get_version)
@@ -110,5 +112,6 @@ class DllLibCPluff : public DllDynamic, DllLibCPluffInterface
RESOLVE_METHOD_RENAME(cp_release_symbol, release_symbol)
RESOLVE_METHOD_RENAME(cp_load_plugin_descriptor, load_plugin_descriptor)
RESOLVE_METHOD_RENAME(cp_load_plugin_descriptor_from_memory, load_plugin_descriptor_from_memory)
+ RESOLVE_METHOD_RENAME(cp_uninstall_plugin, uninstall_plugin)
END_METHOD_RESOLVE()
};

0 comments on commit f1031c4

Please sign in to comment.