From 2a2ddb51f931d5f606638a0a3d6d76c261f09659 Mon Sep 17 00:00:00 2001
From: Arne Morten Kvarving <cptspiff@gmail.com>
Date: Sun, 10 Aug 2014 10:01:15 +0200
Subject: [PATCH] added: special setting __addonpath__ to
 libXBMC_addon::GetSettings()

returns the path for an addon
---
 xbmc/addons/AddonCallbacksAddon.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xbmc/addons/AddonCallbacksAddon.cpp b/xbmc/addons/AddonCallbacksAddon.cpp
index b789648..40f1dde 100644
--- a/xbmc/addons/AddonCallbacksAddon.cpp
+++ b/xbmc/addons/AddonCallbacksAddon.cpp
@@ -187,6 +187,12 @@ bool CAddonCallbacksAddon::GetAddonSetting(void *addonData, const char *strSetti
   {
     CLog::Log(LOGDEBUG, "CAddonCallbacksAddon - %s - add-on '%s' requests setting '%s'", __FUNCTION__, addonHelper->m_addon->Name().c_str(), strSettingName);
 
+    if (strcasecmp(strSettingName, "__addonpath__") == 0)
+    {
+      strcpy((char*) settingValue, addonHelper->m_addon->Path().c_str());
+      return true;
+    }
+
     if (!addonHelper->m_addon->ReloadSettings())
     {
       CLog::Log(LOGERROR, "CAddonCallbacksAddon - %s - could't get settings for add-on '%s'", __FUNCTION__, addonHelper->m_addon->Name().c_str());
