Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed: all addons should be store below either special://home/addon…

…s or

special://xbmc/addons. folder name should be derived from the addon's
id, but is not validated

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28382 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
commit 2ca76f93f7f50c3cde8e6a836907fbbac2843618 1 parent 4445ceb
alcoheca authored
Showing with 113 additions and 288 deletions.
  1. 0  addons/{libraries/scrapers/AllMusic → com.allmusic.scraper.common}/allmusic.xml
  2. 0  addons/{libraries/scrapers/AllMusic → com.allmusic.scraper.common}/description.xml
  3. 0  addons/{scrapers/AllMusic → com.allmusic.scraper}/allmusic.xml
  4. 0  addons/{scrapers/AllMusic → com.allmusic.scraper}/default.tbn
  5. 0  addons/{scrapers/AllMusic → com.allmusic.scraper}/description.xml
  6. 0  addons/{scrapers/AmazonUK → com.amazon.scraper.uk}/amazonuk.xml
  7. 0  addons/{scrapers/AmazonUK → com.amazon.scraper.uk}/default.tbn
  8. 0  addons/{scrapers/AmazonUK → com.amazon.scraper.uk}/description.xml
  9. 0  addons/{libraries/scrapers/Discogs → com.discogs.scraper.common}/description.xml
  10. 0  addons/{libraries/scrapers/Discogs → com.discogs.scraper.common}/discogs.xml
  11. 0  addons/{libraries/scrapers/DTrailer → com.dtrailer.scraper.common}/description.xml
  12. 0  addons/{libraries/scrapers/DTrailer → com.dtrailer.scraper.common}/dtrailer.xml
  13. 0  addons/{libraries/scrapers/HTBackDrops → com.htbackdrops.scraper.common}/description.xml
  14. 0  addons/{libraries/scrapers/HTBackDrops → com.htbackdrops.scraper.common}/htbackdrops.xml
  15. 0  addons/{libraries/scrapers/IMDB → com.imdb.scraper.common}/description.xml
  16. 0  addons/{libraries/scrapers/IMDB → com.imdb.scraper.common}/imdb.xml
  17. 0  addons/{scrapers/IMDB → com.imdb.scraper}/default.tbn
  18. 0  addons/{scrapers/IMDB → com.imdb.scraper}/description.xml
  19. 0  addons/{scrapers/IMDB → com.imdb.scraper}/imdb.xml
  20. 0  addons/{scrapers/IMDB → com.imdb.scraper}/resources/language/English/strings.xml
  21. 0  addons/{libraries/scrapers/IMPA → com.impa.scraper.common}/description.xml
  22. 0  addons/{libraries/scrapers/IMPA → com.impa.scraper.common}/impa.xml
  23. 0  addons/{visualizations/iTunes → com.itunes.vis}/description.xml
  24. 0  addons/{libraries/scrapers/MoviePosterDB → com.movieposterdb.scraper.common}/description.xml
  25. 0  addons/{libraries/scrapers/MoviePosterDB → com.movieposterdb.scraper.common}/movieposterdb.xml
  26. 0  addons/{scrapers/MTV → com.mtv.scraper}/default.tbn
  27. 0  addons/{scrapers/MTV → com.mtv.scraper}/description.xml
  28. 0  addons/{scrapers/MTV → com.mtv.scraper}/mtv.xml
  29. 0  addons/{libraries/scrapers/TMDB → com.tmdb.scraper.common}/description.xml
  30. 0  addons/{libraries/scrapers/TMDB → com.tmdb.scraper.common}/tmdb.xml
  31. 0  addons/{scrapers/TVDB → com.tvdb.scraper}/default.tbn
  32. 0  addons/{scrapers/TVDB → com.tvdb.scraper}/description.xml
  33. 0  addons/{scrapers/TVDB → com.tvdb.scraper}/tvdb.xml
  34. 0  addons/{scrapers/YahooMusic → com.yahoo.music.scraper}/default.tbn
  35. 0  addons/{scrapers/YahooMusic → com.yahoo.music.scraper}/description.xml
  36. 0  addons/{scrapers/YahooMusic → com.yahoo.music.scraper}/resources/language/English/strings.xml
  37. 0  addons/{scrapers/YahooMusic → com.yahoo.music.scraper}/yahoomusic.xml
  38. 0  addons/{libraries/scrapers/LastFM → fm.last.scraper.common}/description.xml
  39. 0  addons/{libraries/scrapers/LastFM → fm.last.scraper.common}/lastfm.xml
  40. 0  addons/{scrapers/LastFM → fm.last.scraper}/default.tbn
  41. 0  addons/{scrapers/LastFM → fm.last.scraper}/description.xml
  42. 0  addons/{scrapers/LastFM → fm.last.scraper}/lastfm.xml
  43. 0  addons/{visualizations/ProjectM → net.sf.projectm.xbmc}/default.tbn
  44. 0  addons/{visualizations/ProjectM → net.sf.projectm.xbmc}/description.xml
  45. 0  addons/{visualizations/ProjectM → net.sf.projectm.xbmc}/resources/language/English/strings.xml
  46. 0  addons/{visualizations/ProjectM → net.sf.projectm.xbmc}/resources/language/German/strings.xml
  47. 0  addons/{visualizations/ProjectM → net.sf.projectm.xbmc}/resources/presets.zip
  48. 0  addons/{screensavers/Euphoria → net.sf.rsxs.euphoria}/default.tbn
  49. 0  addons/{screensavers/Euphoria → net.sf.rsxs.euphoria}/description.xml
  50. 0  addons/{screensavers/Plasma → net.sf.rsxs.plasma}/default.tbn
  51. 0  addons/{screensavers/Plasma → net.sf.rsxs.plasma}/description.xml
  52. 0  addons/{screensavers/Solarwinds → net.sf.rsxs.solarwinds}/default.tbn
  53. 0  addons/{screensavers/Solarwinds → net.sf.rsxs.solarwinds}/description.xml
  54. 0  addons/{scrapers/TMDB → org.themoviedb.scraper}/default.tbn
  55. 0  addons/{scrapers/TMDB → org.themoviedb.scraper}/description.xml
  56. 0  addons/{scrapers/TMDB → org.themoviedb.scraper}/tmdb.xml
  57. 0  addons/{visualizations/GLSpectrum → vis.dxspectrum}/default.tbn
  58. 0  addons/{visualizations/DXSpectrum → vis.dxspectrum}/description.xml
  59. 0  addons/{visualizations/GLSpectrum → vis.dxspectrum}/resources/language/English/strings.xml
  60. 0  addons/{visualizations/GLSpectrum → vis.dxspectrum}/resources/language/German/strings.xml
  61. 0  addons/{visualizations/GLSpectrum → vis.dxspectrum}/resources/settings.xml
  62. 0  addons/{visualizations/DXSpectrum → vis.glspectrum}/default.tbn
  63. 0  addons/{visualizations/GLSpectrum → vis.glspectrum}/description.xml
  64. 0  addons/{visualizations/DXSpectrum → vis.glspectrum}/resources/language/English/strings.xml
  65. 0  addons/{visualizations/DXSpectrum → vis.glspectrum}/resources/language/German/strings.xml
  66. 0  addons/{visualizations/DXSpectrum → vis.glspectrum}/resources/settings.xml
  67. 0  addons/{visualizations/Waveform → vis.waveform}/default.tbn
  68. 0  addons/{visualizations/Waveform → vis.waveform}/description.xml
  69. +5 −2 guilib/GUIInfoTypes.cpp
  70. +0 −60 xbmc/Application.cpp
  71. +2 −2 xbmc/FileSystem/PluginDirectory.cpp
  72. +1 −1  xbmc/GUIDialogContextMenu.cpp
  73. +1 −1  xbmc/GUIMediaWindow.cpp
  74. +2 −2 xbmc/GUIWindowAddonBrowser.cpp
  75. +1 −1  xbmc/GUIWindowScreensaver.cpp
  76. +2 −2 xbmc/GUIWindowScripts.cpp
  77. +1 −1  xbmc/GUIWindowSettingsCategory.cpp
  78. +1 −1  xbmc/GUIWindowWeather.cpp
  79. +1 −1  xbmc/MusicDatabase.cpp
  80. +3 −3 xbmc/VideoDatabase.cpp
  81. +1 −1  xbmc/lib/libPython/xbmcmodule/PythonSettings.cpp
  82. +4 −4 xbmc/screensavers/rsxs-0.9/xbmc/Makefile.in
  83. +72 −189 xbmc/utils/AddonManager.cpp
  84. +10 −11 xbmc/utils/AddonManager.h
  85. +2 −2 xbmc/utils/ScraperParser.cpp
  86. +1 −1  xbmc/visualizations/OpenGLSpectrum/Makefile.in
  87. +1 −1  xbmc/visualizations/WaveForm/Makefile.in
  88. +1 −1  xbmc/visualizations/XBMCProjectM/Makefile.in
  89. +1 −1  xbmc/visualizations/iTunes/Makefile.in
View
0  addons/libraries/scrapers/AllMusic/allmusic.xml → addons/com.allmusic.scraper.common/allmusic.xml
File renamed without changes
View
0  addons/libraries/scrapers/AllMusic/description.xml → addons/com.allmusic.scraper.common/description.xml
File renamed without changes
View
0  addons/scrapers/AllMusic/allmusic.xml → addons/com.allmusic.scraper/allmusic.xml
File renamed without changes
View
0  addons/scrapers/AllMusic/default.tbn → addons/com.allmusic.scraper/default.tbn
File renamed without changes
View
0  addons/scrapers/AllMusic/description.xml → addons/com.allmusic.scraper/description.xml
File renamed without changes
View
0  addons/scrapers/AmazonUK/amazonuk.xml → addons/com.amazon.scraper.uk/amazonuk.xml
File renamed without changes
View
0  addons/scrapers/AmazonUK/default.tbn → addons/com.amazon.scraper.uk/default.tbn
File renamed without changes
View
0  addons/scrapers/AmazonUK/description.xml → addons/com.amazon.scraper.uk/description.xml
File renamed without changes
View
0  addons/libraries/scrapers/Discogs/description.xml → addons/com.discogs.scraper.common/description.xml
File renamed without changes
View
0  addons/libraries/scrapers/Discogs/discogs.xml → addons/com.discogs.scraper.common/discogs.xml
File renamed without changes
View
0  addons/libraries/scrapers/DTrailer/description.xml → addons/com.dtrailer.scraper.common/description.xml
File renamed without changes
View
0  addons/libraries/scrapers/DTrailer/dtrailer.xml → addons/com.dtrailer.scraper.common/dtrailer.xml
File renamed without changes
View
0  ...ns/libraries/scrapers/HTBackDrops/description.xml → ...ns/com.htbackdrops.scraper.common/description.xml
File renamed without changes
View
0  ...ns/libraries/scrapers/HTBackDrops/htbackdrops.xml → ...ns/com.htbackdrops.scraper.common/htbackdrops.xml
File renamed without changes
View
0  addons/libraries/scrapers/IMDB/description.xml → addons/com.imdb.scraper.common/description.xml
File renamed without changes
View
0  addons/libraries/scrapers/IMDB/imdb.xml → addons/com.imdb.scraper.common/imdb.xml
File renamed without changes
View
0  addons/scrapers/IMDB/default.tbn → addons/com.imdb.scraper/default.tbn
File renamed without changes
View
0  addons/scrapers/IMDB/description.xml → addons/com.imdb.scraper/description.xml
File renamed without changes
View
0  addons/scrapers/IMDB/imdb.xml → addons/com.imdb.scraper/imdb.xml
File renamed without changes
View
0  ...apers/IMDB/resources/language/English/strings.xml → ...db.scraper/resources/language/English/strings.xml
File renamed without changes
View
0  addons/libraries/scrapers/IMPA/description.xml → addons/com.impa.scraper.common/description.xml
File renamed without changes
View
0  addons/libraries/scrapers/IMPA/impa.xml → addons/com.impa.scraper.common/impa.xml
File renamed without changes
View
0  addons/visualizations/iTunes/description.xml → addons/com.itunes.vis/description.xml
File renamed without changes
View
0  .../libraries/scrapers/MoviePosterDB/description.xml → .../com.movieposterdb.scraper.common/description.xml
File renamed without changes
View
0  ...ibraries/scrapers/MoviePosterDB/movieposterdb.xml → ...om.movieposterdb.scraper.common/movieposterdb.xml
File renamed without changes
View
0  addons/scrapers/MTV/default.tbn → addons/com.mtv.scraper/default.tbn
File renamed without changes
View
0  addons/scrapers/MTV/description.xml → addons/com.mtv.scraper/description.xml
File renamed without changes
View
0  addons/scrapers/MTV/mtv.xml → addons/com.mtv.scraper/mtv.xml
File renamed without changes
View
0  addons/libraries/scrapers/TMDB/description.xml → addons/com.tmdb.scraper.common/description.xml
File renamed without changes
View
0  addons/libraries/scrapers/TMDB/tmdb.xml → addons/com.tmdb.scraper.common/tmdb.xml
File renamed without changes
View
0  addons/scrapers/TVDB/default.tbn → addons/com.tvdb.scraper/default.tbn
File renamed without changes
View
0  addons/scrapers/TVDB/description.xml → addons/com.tvdb.scraper/description.xml
File renamed without changes
View
0  addons/scrapers/TVDB/tvdb.xml → addons/com.tvdb.scraper/tvdb.xml
File renamed without changes
View
0  addons/scrapers/YahooMusic/default.tbn → addons/com.yahoo.music.scraper/default.tbn
File renamed without changes
View
0  addons/scrapers/YahooMusic/description.xml → addons/com.yahoo.music.scraper/description.xml
File renamed without changes
View
0  ...YahooMusic/resources/language/English/strings.xml → ...ic.scraper/resources/language/English/strings.xml
File renamed without changes
View
0  addons/scrapers/YahooMusic/yahoomusic.xml → addons/com.yahoo.music.scraper/yahoomusic.xml
File renamed without changes
View
0  addons/libraries/scrapers/LastFM/description.xml → addons/fm.last.scraper.common/description.xml
File renamed without changes
View
0  addons/libraries/scrapers/LastFM/lastfm.xml → addons/fm.last.scraper.common/lastfm.xml
File renamed without changes
View
0  addons/scrapers/LastFM/default.tbn → addons/fm.last.scraper/default.tbn
File renamed without changes
View
0  addons/scrapers/LastFM/description.xml → addons/fm.last.scraper/description.xml
File renamed without changes
View
0  addons/scrapers/LastFM/lastfm.xml → addons/fm.last.scraper/lastfm.xml
File renamed without changes
View
0  addons/visualizations/ProjectM/default.tbn → addons/net.sf.projectm.xbmc/default.tbn
File renamed without changes
View
0  addons/visualizations/ProjectM/description.xml → addons/net.sf.projectm.xbmc/description.xml
File renamed without changes
View
0  ...s/ProjectM/resources/language/English/strings.xml → ...jectm.xbmc/resources/language/English/strings.xml
File renamed without changes
View
0  ...ns/ProjectM/resources/language/German/strings.xml → ...ojectm.xbmc/resources/language/German/strings.xml
File renamed without changes
View
0  addons/visualizations/ProjectM/resources/presets.zip → addons/net.sf.projectm.xbmc/resources/presets.zip
File renamed without changes
View
0  addons/screensavers/Euphoria/default.tbn → addons/net.sf.rsxs.euphoria/default.tbn
File renamed without changes
View
0  addons/screensavers/Euphoria/description.xml → addons/net.sf.rsxs.euphoria/description.xml
File renamed without changes
View
0  addons/screensavers/Plasma/default.tbn → addons/net.sf.rsxs.plasma/default.tbn
File renamed without changes
View
0  addons/screensavers/Plasma/description.xml → addons/net.sf.rsxs.plasma/description.xml
File renamed without changes
View
0  addons/screensavers/Solarwinds/default.tbn → addons/net.sf.rsxs.solarwinds/default.tbn
File renamed without changes
View
0  addons/screensavers/Solarwinds/description.xml → addons/net.sf.rsxs.solarwinds/description.xml
File renamed without changes
View
0  addons/scrapers/TMDB/default.tbn → addons/org.themoviedb.scraper/default.tbn
File renamed without changes
View
0  addons/scrapers/TMDB/description.xml → addons/org.themoviedb.scraper/description.xml
File renamed without changes
View
0  addons/scrapers/TMDB/tmdb.xml → addons/org.themoviedb.scraper/tmdb.xml
File renamed without changes
View
0  addons/visualizations/GLSpectrum/default.tbn → addons/vis.dxspectrum/default.tbn
File renamed without changes
View
0  addons/visualizations/DXSpectrum/description.xml → addons/vis.dxspectrum/description.xml
File renamed without changes
View
0  ...GLSpectrum/resources/language/English/strings.xml → ...dxspectrum/resources/language/English/strings.xml
File renamed without changes
View
0  .../GLSpectrum/resources/language/German/strings.xml → ....dxspectrum/resources/language/German/strings.xml
File renamed without changes
View
0  .../visualizations/GLSpectrum/resources/settings.xml → addons/vis.dxspectrum/resources/settings.xml
File renamed without changes
View
0  addons/visualizations/DXSpectrum/default.tbn → addons/vis.glspectrum/default.tbn
File renamed without changes
View
0  addons/visualizations/GLSpectrum/description.xml → addons/vis.glspectrum/description.xml
File renamed without changes
View
0  ...DXSpectrum/resources/language/English/strings.xml → ...glspectrum/resources/language/English/strings.xml
File renamed without changes
View
0  .../DXSpectrum/resources/language/German/strings.xml → ....glspectrum/resources/language/German/strings.xml
File renamed without changes
View
0  .../visualizations/DXSpectrum/resources/settings.xml → addons/vis.glspectrum/resources/settings.xml
File renamed without changes
View
0  addons/visualizations/Waveform/default.tbn → addons/vis.waveform/default.tbn
File renamed without changes
View
0  addons/visualizations/Waveform/description.xml → addons/vis.waveform/description.xml
File renamed without changes
View
7 guilib/GUIInfoTypes.cpp
@@ -226,6 +226,7 @@ CStdString CGUIInfoLabel::ReplaceLocalize(const CStdString &label)
CStdString CGUIInfoLabel::ReplaceAddonStrings(const CStdString &label)
{
CStdString work(label);
+ //FIXME why not use RE here?
// Replace all $ADDON[id number] with the real string
int pos1 = work.Find("$ADDON[");
while (pos1 >= 0)
@@ -235,8 +236,10 @@ CStdString CGUIInfoLabel::ReplaceAddonStrings(const CStdString &label)
{
CStdString left = work.Left(pos1);
CStdString right = work.Mid(pos2 + 1);
- CStdString id = work.substr(pos1+7, 36);
- int stringid = atoi(work.substr(pos1+7+36+1, 5).c_str());
+ int worki = work.Find(" ");
+ 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);
work = left + replace + right;
}
View
60 xbmc/Application.cpp
@@ -781,31 +781,14 @@ CProfile* CApplication::InitDirectoriesLinux()
CUtil::AddSlashAtEnd(strTempPath);
g_settings.m_logFolder = strTempPath;
- bool bCopySystemPlugins = false;
- if (!CDirectory::Exists("special://home/addons/plugins") )
- bCopySystemPlugins = true;
-
CDirectory::Create("special://home/");
CDirectory::Create("special://temp/");
CDirectory::Create("special://home/skin");
CDirectory::Create("special://home/addons");
- CDirectory::Create("special://home/addons/visualizations");
- CDirectory::Create("special://home/addons/scripts");
- CDirectory::Create("special://home/addons/scrapers");
- CDirectory::Create("special://home/addons/screensavers");
- CDirectory::Create("special://home/addons/plugins");
- CDirectory::Create("special://home/addons/libraries");
- CDirectory::Create("special://home/addons/libraries/scrapers");
CDirectory::Create("special://home/media");
CDirectory::Create("special://home/sounds");
CDirectory::Create("special://home/system");
- /*if (!CFile::Exists("special://home/scripts/Common Scripts"))
- {
- if (symlink( INSTALL_PATH "/scripts", _P("special://home/scripts/Common Scripts").c_str() ) != 0)
- CLog::Log(LOGERROR, "Failed to create common scripts symlink.");
- }*/
-
CDirectory::Create("special://masterprofile");
// copy required files
@@ -813,10 +796,6 @@ CProfile* CApplication::InitDirectoriesLinux()
CopyUserDataIfNeeded("special://masterprofile/", "RssFeeds.xml");
CopyUserDataIfNeeded("special://masterprofile/", "Lircmap.xml");
CopyUserDataIfNeeded("special://masterprofile/", "LCD.xml");
-
- // copy system-wide plugins into userprofile
- if ( bCopySystemPlugins )
- CUtil::CopyDirRecursive("special://xbmc/addons/plugins", "special://home/addons/plugins");
}
else
{
@@ -892,21 +871,10 @@ CProfile* CApplication::InitDirectoriesOSX()
CUtil::AddSlashAtEnd(strTempPath);
g_settings.m_logFolder = strTempPath;
- bool bCopySystemPlugins = false;
- if (!CDirectory::Exists("special://home/addons/plugins") )
- bCopySystemPlugins = true;
-
CDirectory::Create("special://home/");
CDirectory::Create("special://temp/");
CDirectory::Create("special://home/skin");
CDirectory::Create("special://home/addons");
- CDirectory::Create("special://home/addons/visualizations");
- CDirectory::Create("special://home/addons/scripts");
- CDirectory::Create("special://home/addons/scrapers");
- CDirectory::Create("special://home/addons/screensavers");
- CDirectory::Create("special://home/addons/plugins");
- CDirectory::Create("special://home/addons/libraries");
- CDirectory::Create("special://home/addons/libraries/scrapers");
CDirectory::Create("special://home/media");
CDirectory::Create("special://home/sounds");
CDirectory::Create("special://home/system");
@@ -924,10 +892,6 @@ CProfile* CApplication::InitDirectoriesOSX()
CopyUserDataIfNeeded("special://masterprofile/", "RssFeeds.xml");
CopyUserDataIfNeeded("special://masterprofile/", "Lircmap.xml");
CopyUserDataIfNeeded("special://masterprofile/", "LCD.xml");
-
- // copy system-wide plugins into userprofile
- if ( bCopySystemPlugins )
- CUtil::CopyDirRecursive("special://xbmc/addons/plugins", "special://home/addons/plugins");
}
else
{
@@ -988,20 +952,9 @@ CProfile* CApplication::InitDirectoriesWin32()
CSpecialProtocol::SetMasterProfilePath(CUtil::AddFileToFolder(homePath, "userdata"));
SetEnvironmentVariable("XBMC_PROFILE_USERDATA",_P("special://masterprofile").c_str());
- bool bCopySystemPlugins = false;
- if (!CDirectory::Exists("special://home/addons/plugins") )
- bCopySystemPlugins = true;
-
CDirectory::Create("special://home/");
CDirectory::Create("special://home/skin");
CDirectory::Create("special://home/addons");
- CDirectory::Create("special://home/addons/visualizations");
- CDirectory::Create("special://home/addons/scripts");
- CDirectory::Create("special://home/addons/scrapers");
- CDirectory::Create("special://home/addons/screensavers");
- CDirectory::Create("special://home/addons/plugins");
- CDirectory::Create("special://home/addons/libraries");
- CDirectory::Create("special://home/addons/libraries/scrapers");
CDirectory::Create("special://home/media");
CDirectory::Create("special://home/sounds");
CDirectory::Create("special://home/system");
@@ -1015,10 +968,6 @@ CProfile* CApplication::InitDirectoriesWin32()
CopyUserDataIfNeeded("special://masterprofile/", "Lircmap.xml");
CopyUserDataIfNeeded("special://masterprofile/", "LCD.xml");
- // copy system-wide plugins into userprofile
- if ( bCopySystemPlugins )
- CUtil::CopyDirRecursive("special://xbmc/addons/plugins", "special://home/addons/plugins");
-
// create user/app data/XBMC/cache
CSpecialProtocol::SetTempPath(CUtil::AddFileToFolder(homePath,"cache"));
CDirectory::Create("special://temp");
@@ -1103,17 +1052,8 @@ bool CApplication::Initialize()
if (!m_bPlatformDirectories)
#endif
{
- CDirectory::Create("special://xbmc/scripts");
- CDirectory::Create("special://xbmc/plugins/weather");
CDirectory::Create("special://xbmc/language");
CDirectory::Create("special://xbmc/addons");
- CDirectory::Create("special://xbmc/addons/visualizations");
- CDirectory::Create("special://xbmc/addons/scripts");
- CDirectory::Create("special://xbmc/addons/scrapers");
- CDirectory::Create("special://xbmc/addons/screensavers");
- CDirectory::Create("special://xbmc/addons/plugins");
- CDirectory::Create("special://home/addons/libraries");
- CDirectory::Create("special://home/addons/libraries/scrapers");
CDirectory::Create("special://xbmc/sounds");
}
View
4 xbmc/FileSystem/PluginDirectory.cpp
@@ -80,7 +80,7 @@ bool CPluginDirectory::StartScript(const CStdString& strPath)
{
CURL url(strPath);
- if (!CAddonMgr::Get()->GetAddon(ADDON_PLUGIN, url.GetHostName(), m_addon))
+ if (!CAddonMgr::Get()->GetAddon(url.GetHostName(), m_addon, ADDON_PLUGIN))
{
CLog::Log(LOGERROR, "Unable to find plugin %s", url.GetHostName().c_str());
return false;
@@ -391,7 +391,7 @@ bool CPluginDirectory::RunScriptWithParams(const CStdString& strPath)
return false;
AddonPtr addon;
- if (!CAddonMgr::Get()->GetAddon(ADDON_PLUGIN, url.GetHostName(), addon))
+ if (!CAddonMgr::Get()->GetAddon(url.GetHostName(), addon, ADDON_PLUGIN))
{
CLog::Log(LOGERROR, "Unable to find plugin %s", url.GetHostName().c_str());
return false;
View
2  xbmc/GUIDialogContextMenu.cpp
@@ -301,7 +301,7 @@ void CGUIDialogContextMenu::GetContextButtons(const CStdString &type, const CFil
else
{
ADDON::AddonPtr plugin;
- if (ADDON::CAddonMgr::Get()->GetAddon(ADDON::ADDON_PLUGIN, url.GetHostName(), 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
2  xbmc/GUIMediaWindow.cpp
@@ -1337,7 +1337,7 @@ bool CGUIMediaWindow::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{
CURL plugin(m_vecItems->Get(itemNumber)->m_strPath);
ADDON::AddonPtr addon;
- if (CAddonMgr::Get()->GetAddon(ADDON_PLUGIN, plugin.GetHostName(), addon))
+ if (CAddonMgr::Get()->GetAddon(plugin.GetHostName(), addon, ADDON_PLUGIN))
if (CGUIDialogAddonSettings::ShowAndGetInput(addon))
Update(m_vecItems->m_strPath);
return true;
View
4 xbmc/GUIWindowAddonBrowser.cpp
@@ -201,7 +201,7 @@ void CGUIWindowAddonBrowser::OnClick(int iItem)
AddonPtr addon;
TYPE type = TranslateType(pItem->GetProperty("Addon.Type"));
- if (CAddonMgr::Get()->GetAddon(type, pItem->GetProperty("Addon.ID"), addon))
+ if (CAddonMgr::Get()->GetAddon(pItem->GetProperty("Addon.ID"), addon, type))
{
if (addon->Disabled())
CAddonMgr::Get()->EnableAddon(addon);
@@ -227,7 +227,7 @@ bool CGUIWindowAddonBrowser::OnContextMenu(int iItem)
TYPE type = TranslateType(pItem->GetProperty("Addon.Type"));
AddonPtr addon;
- if (!CAddonMgr::Get()->GetAddon(type, pItem->GetProperty("Addon.ID"), addon))
+ if (!CAddonMgr::Get()->GetAddon(pItem->GetProperty("Addon.ID"), addon, type))
return false;
int iSettingsLabel = 24020;
View
2  xbmc/GUIWindowScreensaver.cpp
@@ -131,7 +131,7 @@ bool CGUIWindowScreensaver::OnMessage(CGUIMessage& message)
m_addon.reset();
// Setup new screensaver instance
ADDON::AddonPtr addon;
- if (!ADDON::CAddonMgr::Get()->GetAddon(ADDON::ADDON_SCREENSAVER, g_guiSettings.GetString("screensaver.mode"), addon))
+ if (!ADDON::CAddonMgr::Get()->GetAddon(g_guiSettings.GetString("screensaver.mode"), addon, ADDON::ADDON_SCREENSAVER))
return false;
m_addon = boost::dynamic_pointer_cast<CScreenSaver>(addon);
View
4 xbmc/GUIWindowScripts.cpp
@@ -246,7 +246,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(ADDON::ADDON_SCRIPT, item->m_strPath, script))
+ if (ADDON::CAddonMgr::Get()->GetAddon(item->m_strPath, script, ADDON::ADDON_SCRIPT))
{
if (script->HasSettings())
{
@@ -271,7 +271,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(ADDON::ADDON_SCRIPT, m_vecItems->Get(itemNumber)->m_strPath, 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
2  xbmc/GUIWindowSettingsCategory.cpp
@@ -1145,7 +1145,7 @@ void CGUIWindowSettingsCategory::OnClick(CBaseSettingControl *pSettingControl)
{
CStdString name = g_guiSettings.GetString("weather.script");
AddonPtr addon;
- if (CAddonMgr::Get()->GetAddon(ADDON_PLUGIN, name, addon))
+ 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);
}
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(ADDON_SCRIPT, g_guiSettings.GetString("weather.script"), addon))
+ if (!ADDON::CAddonMgr::Get()->GetAddon(g_guiSettings.GetString("weather.script"), addon, ADDON_SCRIPT))
return;
// create the full path to the script
View
2  xbmc/MusicDatabase.cpp
@@ -4082,7 +4082,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(ADDON::ADDON_SCRAPER, scraperUUID, addon) && 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)
View
6 xbmc/VideoDatabase.cpp
@@ -5580,7 +5580,7 @@ bool CVideoDatabase::GetScraperForPath(const CStdString& strPath, ScraperPtr& sc
{ // content set, use pre configured or default scraper
AddonPtr addon;
if (!scraperUUID.empty() &&
- CAddonMgr::Get()->GetAddon(ADDON::ADDON_SCRAPER, scraperUUID, addon))
+ CAddonMgr::Get()->GetAddon(scraperUUID, addon, ADDON::ADDON_SCRAPER))
{
scraper = boost::dynamic_pointer_cast<CScraper>(addon->Clone(addon));
if (!scraper)
@@ -5621,7 +5621,7 @@ bool CVideoDatabase::GetScraperForPath(const CStdString& strPath, ScraperPtr& sc
if (!m_pDS->eof())
{
AddonPtr defaultScraper;
- if (!CAddonMgr::Get()->GetAddon(ADDON::ADDON_SCRAPER, m_pDS->fv("path.strScraper").get_asString(), defaultScraper))
+ if (!CAddonMgr::Get()->GetAddon(m_pDS->fv("path.strScraper").get_asString(), defaultScraper, ADDON::ADDON_SCRAPER))
{
strPath1 = strParent;
continue;
@@ -7647,7 +7647,7 @@ void CVideoDatabase::ImportFromXML(const CStdString &path)
uuid = CUtil::GetFileName(uuid);
}
- if (CAddonMgr::Get()->GetAddon(ADDON::ADDON_SCRAPER, uuid, addon))
+ if (CAddonMgr::Get()->GetAddon(uuid, addon, ADDON::ADDON_SCRAPER))
{
SScanSettings settings;
ScraperPtr scraper = boost::dynamic_pointer_cast<CScraper>(addon);
View
2  xbmc/lib/libPython/xbmcmodule/PythonSettings.cpp
@@ -64,7 +64,7 @@ namespace PYXBMC
};
AddonPtr addon;
- if (CAddonMgr::Get()->GetAddon(ADDON::ADDON_SCRIPT, CStdString(cScriptUUID), addon))
+ if (CAddonMgr::Get()->GetAddon(CStdString(cScriptUUID), addon, ADDON::ADDON_SCRIPT))
{
PyErr_SetString(PyExc_Exception, "Could not get AddonPtr!");
return NULL;
View
8 xbmc/screensavers/rsxs-0.9/xbmc/Makefile.in
@@ -4,20 +4,20 @@ CXXFLAGS=-fPIC
.PHONY: compile
-OUTDIR=../../../../addons/screensavers
+OUTDIR=../../../../addons
RSXS=..
DIRS=$(RSXS)
RSXS-OBJS=$(RSXS)/src/common.o $(RSXS)/src/color.o $(RSXS)/lib/libmisc.a
-SOLARWINDS-OUT=$(OUTDIR)/Solarwinds/Solarwinds.xbs
+SOLARWINDS-OUT=$(OUTDIR)/net.sf.rsxs.solarwinds/Solarwinds.xbs
SOLARWINDS-DEP=$(RSXS)/src/solarwinds/rs-solarwinds
-PLASMA-OUT=$(OUTDIR)/Plasma/Plasma.xbs
+PLASMA-OUT=$(OUTDIR)/net.sf.rsxs.plasma/Plasma.xbs
PLASMA-DEP=$(RSXS)/src/plasma/rs-plasma
-EUPHORIA-OUT=$(OUTDIR)/Euphoria/Euphoria.xbs
+EUPHORIA-OUT=$(OUTDIR)/net.sf.rsxs.euphoria/Euphoria.xbs
EUPHORIA-DEP=$(RSXS)/src/euphoria/rs-euphoria
CLEAN_FILES=$(SOLARWINDS-OUT) $(PLASMA-OUT) $(EUPHORIA-OUT)
View
261 xbmc/utils/AddonManager.cpp
@@ -302,10 +302,10 @@ bool CAddonMgr::GetAddons(const TYPE &type, VECADDONS &addons, const CONTENT_TYP
// recheck addons.xml & each addontype's directories no more than once every ADDON_DIRSCAN_FREQ seconds
CDateTimeSpan span;
span.SetDateTimeSpan(0, 0, 0, ADDON_DIRSCAN_FREQ);
- if(!m_lastDirScan[type].IsValid() || (m_lastDirScan[type] + span) < CDateTime::GetCurrentDateTime())
+ if(!m_lastDirScan.IsValid() || (m_lastDirScan + span) < CDateTime::GetCurrentDateTime())
{
- m_lastDirScan[type] = CDateTime::GetCurrentDateTime();
- LoadAddonsXML(type);
+ m_lastDirScan = CDateTime::GetCurrentDateTime();
+ LoadAddonsXML();
}
addons.clear();
@@ -327,17 +327,17 @@ bool CAddonMgr::GetAddons(const TYPE &type, VECADDONS &addons, const CONTENT_TYP
return !addons.empty();
}
-bool CAddonMgr::GetAddon(const TYPE &type, const CStdString &str, AddonPtr &addon)
+bool CAddonMgr::GetAddon(const CStdString &str, AddonPtr &addon, const TYPE &type/*=ADDON_UNKNOWN*/)
{
CDateTimeSpan span;
span.SetDateTimeSpan(0, 0, 0, ADDON_DIRSCAN_FREQ);
- if(!m_lastDirScan[type].IsValid() || (m_lastDirScan[type] + span) < CDateTime::GetCurrentDateTime())
+ if(!m_lastDirScan.IsValid() || (m_lastDirScan + span) < CDateTime::GetCurrentDateTime())
{
- m_lastDirScan[type] = CDateTime::GetCurrentDateTime();
- LoadAddonsXML(type);
+ m_lastDirScan = CDateTime::GetCurrentDateTime();
+ LoadAddonsXML();
}
- if (m_addons.find(type) == m_addons.end())
+ if (type != ADDON_UNKNOWN && m_addons.find(type) == m_addons.end())
return false;
if (m_idMap[str])
@@ -400,7 +400,7 @@ bool CAddonMgr::GetDefault(const TYPE &type, AddonPtr &addon, const CONTENT_TYPE
return false;
}
}
- return GetAddon(type, setting, addon);
+ return GetAddon(setting, addon, type);
}
CStdString CAddonMgr::GetString(const CStdString &id, const int number)
@@ -429,7 +429,7 @@ bool CAddonMgr::EnableAddon(AddonPtr &addon)
CUtil::CreateDirectoryEx(addon->Profile());
addon->Enable();
CLog::Log(LOGINFO,"ADDON: Enabled %s: %s : %s", TranslateType(addon->Type()).c_str(), addon->Name().c_str(), addon->Version().Print().c_str());
- SaveAddonsXML(addon->Type());
+ SaveAddonsXML();
return true;
}
@@ -460,7 +460,7 @@ bool CAddonMgr::DisableAddon(AddonPtr &addon)
}
CLog::Log(LOGINFO,"ADDON: Disabled %s: %s", TranslateType(addon->Type()).c_str(), addon->Name().c_str());
- SaveAddonsXML(type);
+ SaveAddonsXML();
return true;
}
}
@@ -468,35 +468,35 @@ bool CAddonMgr::DisableAddon(AddonPtr &addon)
return false;
}
-bool CAddonMgr::LoadAddonsXML(const TYPE &type)
+bool CAddonMgr::LoadAddonsXML()
{
VECADDONPROPS props;
- if (!LoadAddonsXML(type, props))
+ if (!LoadAddonsXML(props))
return false;
// refresh addon dirs if neccesary/forced
- FindAddons(type);
+ FindAddons();
// now enable accordingly
VECADDONPROPS::const_iterator itr = props.begin();
while (itr != props.end())
{
AddonPtr addon;
- if (itr->parent.empty() && GetAddon(type, itr->id, addon))
+ if (itr->parent.empty() && GetAddon(itr->id, addon, itr->type))
{
EnableAddon(addon);
}
- else if (GetAddon(type, itr->parent, addon))
+ else if (GetAddon(itr->parent, addon))
{ // multiple addon configurations
AddonPtr clone = addon->Clone(addon);
if (clone)
{
- m_addons[type].push_back(clone);
+ m_addons[addon->Type()].push_back(clone);
}
}
else
{ // addon not found
- CLog::Log(LOGERROR, "ADDON: Couldn't find %s requested. Name: %s", TranslateType(type).c_str(), itr->name.c_str());
+ CLog::Log(LOGERROR, "ADDON: Couldn't find addon requested with ID: %s", itr->id.c_str());
//TODO we should really add but mark unavailable, to prompt user
}
++itr;
@@ -504,88 +504,17 @@ bool CAddonMgr::LoadAddonsXML(const TYPE &type)
return true;
}
-bool CAddonMgr::GetAddonProps(const TYPE &type, VECADDONPROPS &props)
-{
- props.clear();
- VECADDONS addons;
- bool found = GetAddons(type, addons);
- if (found)
- {
- IVECADDONS itr = addons.begin();
- while (itr != addons.end())
- {
- AddonProps addon(*itr);
- props.push_back(addon);
- ++itr;
- }
- }
- return found;
-}
-
-void CAddonMgr::FindAddons(const TYPE &type)
+void CAddonMgr::FindAddons()
{
// parse the user & system dirs for addons of the requested type
CFileItemList items;
- bool isHome = CSpecialProtocol::XBMCIsHome();
+ if (!CSpecialProtocol::XBMCIsHome())
+ CDirectory::GetDirectory("special://home/addons", items);
+ CDirectory::GetDirectory("special://xbmc/addons", items);
// store any addons with unresolved deps, then recheck at the end
VECADDONS unresolved;
- switch (type)
- {
- case ADDON_VIZ:
- { //TODO fix mvis handling
- if (!isHome)
- CDirectory::GetDirectory("special://home/addons/visualizations", items, ADDON_VIS_EXT, false);
- CDirectory::GetDirectory("special://xbmc/addons/visualizations", items, ADDON_VIS_EXT, false);
- break;
- }
- case ADDON_SCREENSAVER:
- {
- if (!isHome)
- CDirectory::GetDirectory("special://home/addons/screensavers", items, ADDON_SCREENSAVER_EXT, false);
- CDirectory::GetDirectory("special://xbmc/addons/screensavers", items, ADDON_SCREENSAVER_EXT, false);
- break;
- }
- case ADDON_SCRAPER:
- {
- if (!isHome)
- CDirectory::GetDirectory("special://home/addons/scrapers", items, ADDON_SCRAPER_EXT, false);
- CDirectory::GetDirectory("special://xbmc/addons/scrapers", items, ADDON_SCRAPER_EXT, false);
- break;
- }
- case ADDON_SCRAPER_LIBRARY:
- {
- if (!isHome)
- CDirectory::GetDirectory("special://home/addons/libraries/scrapers", items, ADDON_SCRAPER_EXT, false);
- CDirectory::GetDirectory("special://xbmc/addons/libraries/scrapers", items, ADDON_SCRAPER_EXT, false);
- break;
- }
- case ADDON_SCRIPT:
- {
- if (!isHome)
- CDirectory::GetDirectory("special://home/addons/scripts", items, ADDON_PYTHON_EXT, false);
- CDirectory::GetDirectory("special://xbmc/addons/scripts", items, ADDON_PYTHON_EXT, false);
- break;
- }
- case ADDON_PLUGIN:
- {
- if (!isHome)
- CDirectory::GetDirectory("special://home/addons/plugins", items, ADDON_PYTHON_EXT, false);
- CDirectory::GetDirectory("special://xbmc/addons/plugins", items, ADDON_PYTHON_EXT, false);
- break;
- }
- default:
- return;
- }
-
- //FIXME this only checks library dependencies - multiple addon type deps
- //need a more sophisticated approach
- if (type == ADDON_SCRAPER)
- FindAddons(ADDON_SCRAPER_LIBRARY);
- else if (type == ADDON_VIZ)
- FindAddons(ADDON_VIZ_LIBRARY);
-
// for all folders found
for (int i = 0; i < items.Size(); ++i)
{
@@ -593,7 +522,7 @@ void CAddonMgr::FindAddons(const TYPE &type)
// read description.xml and populate the addon
AddonPtr addon;
- if (!AddonFromInfoXML(type, item->m_strPath, addon))
+ if (!AddonFromInfoXML(item->m_strPath, addon))
{
CLog::Log(LOGDEBUG, "ADDON: Error reading %sdescription.xml, bypassing package", item->m_strPath.c_str());
continue;
@@ -634,8 +563,7 @@ void CAddonMgr::FindAddons(const TYPE &type)
continue;
else
{
- assert(addon->Type() == type);
- m_addons[type].push_back(addon);
+ m_addons[addon->Type()].push_back(addon);
m_idMap.insert(std::make_pair(addon->ID(), addon));
}
}
@@ -648,12 +576,12 @@ void CAddonMgr::FindAddons(const TYPE &type)
{
if (!UpdateIfKnown(addon))
{
- m_addons[type].push_back(addon);
+ m_addons[addon->Type()].push_back(addon);
m_idMap.insert(std::make_pair(addon->ID(), addon));
}
}
}
- CLog::Log(LOGINFO, "ADDON: Found %"PRIuS" addons of type %s", m_addons.find(type) == m_addons.end() ? 0: m_addons[type].size(), TranslateType(type).c_str());
+// CLog::Log(LOGINFO, "ADDON: Found %"PRIuS" addons", m_addons.find(type) == m_addons.end() ? 0: m_addons[type].size(), TranslateType(type).c_str());
}
bool CAddonMgr::UpdateIfKnown(AddonPtr &addon)
@@ -719,7 +647,7 @@ bool CAddonMgr::DependenciesMet(AddonPtr &addon)
return deps.empty();
}
-bool CAddonMgr::AddonFromInfoXML(const TYPE &reqType, const CStdString &path, AddonPtr &addon)
+bool CAddonMgr::AddonFromInfoXML(const CStdString &path, AddonPtr &addon)
{
// First check that we can load description.xml
CStdString strPath(path);
@@ -778,7 +706,7 @@ bool CAddonMgr::AddonFromInfoXML(const TYPE &reqType, const CStdString &path, Ad
return false;
}
type = TranslateType(element->GetText());
- if (type != reqType)
+ if (type == ADDON_UNKNOWN)
{
CLog::Log(LOGERROR, "ADDON: %s has invalid type identifier: '%d'", strPath.c_str(), type);
return false;
@@ -1053,73 +981,48 @@ CStdString CAddonMgr::GetAddonsXMLFile() const
return folder;
}
-bool CAddonMgr::SaveAddonsXML(const TYPE &type)
+bool CAddonMgr::SaveAddonsXML()
{
- VECADDONPROPS props;
- GetAddonProps(type, props);
+ //TODO lock
+ if (m_idMap.empty())
+ return true;
- // TODO: Should we be specifying utf8 here??
TiXmlDocument doc;
- if (!doc.LoadFile(GetAddonsXMLFile()))
- doc.ClearError();
-
- // either point to existing addons node, or create one
TiXmlNode *pRoot = NULL;
- pRoot = doc.FirstChildElement("addons");
- if (!pRoot)
- {
- TiXmlElement xmlRootElement("addons");
- pRoot = doc.InsertEndChild(xmlRootElement);
- if (!pRoot)
- return false;
- }
-
- // ok, now run through and save the modified addons section
- SetAddons(pRoot, type, props);
-
- return doc.SaveFile(GetAddonsXMLFile());
-}
-
-bool CAddonMgr::SetAddons(TiXmlNode *root, const TYPE &type, const VECADDONPROPS &addons)
-{
- CStdString strType;
- strType = TranslateType(type);
-
- if (strType.IsEmpty())
- return false;
-
- TiXmlElement sectionElement(strType);
- TiXmlNode *sectionNode = root->FirstChild(strType);
-
- if (sectionNode)
- { // must delete the original section before regenerating
- root->RemoveChild(sectionNode);
- }
- if (!addons.empty())
- { // only recreate the sectionNode if there's addons of this type enabled
- sectionNode = root->InsertEndChild(sectionElement);
+ TiXmlElement xmlRootElement("addons");
+ pRoot = doc.InsertEndChild(xmlRootElement);
- VECADDONPROPS::const_iterator itr = addons.begin();
- while (itr != addons.end())
+ std::map<CStdString, AddonPtr>::iterator itr = m_idMap.begin();
+ while (itr != m_idMap.end())
+ {
+ AddonPtr addon = (*itr).second;
+ if (addon && !addon->Disabled())
{
+ TYPE type = addon->Type();
+ CStdString strType = TranslateType(type);
+ TiXmlElement sectionElement(strType);
+ TiXmlNode *node = pRoot->FirstChild(strType);
+ if (!node)
+ node = pRoot->InsertEndChild(sectionElement);
+
TiXmlElement element("addon");
- XMLUtils::SetString(&element, "id", itr->id);
- if (!itr->parent.IsEmpty())
- XMLUtils::SetString(&element, "parentid", itr->parent);
- sectionNode->InsertEndChild(element);
- ++itr;
+ XMLUtils::SetString(&element, "id", addon->ID());
+ if (addon->Parent())
+ XMLUtils::SetString(&element, "parentid", addon->Parent()->ID());
+ //XMLUtils::SetString(&element, "repo", addon->Repo()->ID());
+ node->InsertEndChild(element);
}
+ itr++;
}
- return true;
+ return doc.SaveFile(GetAddonsXMLFile());
}
-bool CAddonMgr::LoadAddonsXML(const TYPE &type, VECADDONPROPS &addons)
+bool CAddonMgr::LoadAddonsXML(VECADDONPROPS &addons)
{
CStdString strXMLFile;
TiXmlDocument xmlDoc;
TiXmlElement *pRootElement = NULL;
strXMLFile = GetAddonsXMLFile();
- CLog::Log(LOGNOTICE, "ADDONS: Attempting to parse %s", strXMLFile.c_str());
if ( xmlDoc.LoadFile( strXMLFile ) )
{
pRootElement = xmlDoc.RootElement();
@@ -1128,7 +1031,7 @@ bool CAddonMgr::LoadAddonsXML(const TYPE &type, VECADDONPROPS &addons)
strValue = pRootElement->Value();
if ( strValue != "addons")
{
- CLog::Log(LOGERROR, "ADDONS: %s does not contain <addons> element", strXMLFile.c_str());
+ CLog::Log(LOGDEBUG, "ADDONS: %s does not contain <addons> element", strXMLFile.c_str());
return false;
}
}
@@ -1145,74 +1048,54 @@ bool CAddonMgr::LoadAddonsXML(const TYPE &type, VECADDONPROPS &addons)
if (pRootElement)
{ // parse addons...
- GetAddons(pRootElement, type, addons);
+ GetAddons(pRootElement, addons);
return true;
}
return false;
}
-void CAddonMgr::GetAddons(const TiXmlElement* pRootElement, const TYPE &type, VECADDONPROPS &addons)
+void CAddonMgr::GetAddons(const TiXmlElement* pAddons, VECADDONPROPS &addons)
{
- CStdString strTagName;
- strTagName = TranslateType(type);
- const TiXmlNode *pChild = pRootElement->FirstChild(strTagName.c_str());
- if (pChild)
+ const TiXmlNode *pType = 0;
+ while( pType = pAddons->IterateChildren( pType ) )
{
- pChild = pChild->FirstChild();
- while (pChild > 0)
+ TYPE type = TranslateType(pType->Value());
+ const TiXmlNode *pAddon = pType->FirstChild();
+ while (pAddon > 0)
{
- CStdString strValue = pChild->Value();
+ CStdString strValue = pAddon->Value();
if (strValue == "addon")
{
- GetAddon(type, pChild, addons);
+ GetAddon(type, pAddon, addons);
}
- pChild = pChild->NextSibling();
+ pAddon = pAddon->NextSibling();
}
}
- else
- {
- CLog::Log(LOGDEBUG, "ADDONS: <%s> tag is missing or addons.xml is malformed", strTagName.c_str());
- }
}
bool CAddonMgr::GetAddon(const TYPE &type, const TiXmlNode *node, VECADDONPROPS &addons)
{
// id
- const TiXmlNode *pNodePath = node->FirstChild("id");
+ const TiXmlNode *pNodeID = node->FirstChild("id");
CStdString id;
- if (pNodePath && pNodePath->FirstChild())
+ if (pNodeID && pNodeID->FirstChild())
{
- id = pNodePath->FirstChild()->Value();
+ id = pNodeID->FirstChild()->Value();
}
else
return false;
- // this AddonProps doesn't need a valid version
+ // will grab the version from description.xml
CStdString version;
AddonProps props(id, type, version);
- // name if present
- const TiXmlNode *pNodeName = node->FirstChild("name");
- CStdString strName;
- if (pNodeName && pNodeName->FirstChild())
- {
- props.name = pNodeName->FirstChild()->Value();
- }
-
// parent id if present
- const TiXmlNode *pNodeChildID = node->FirstChild("parentid");
- if (pNodeChildID && pNodeChildID->FirstChild())
- {
- props.parent = pNodeChildID->FirstChild()->Value();
- }
-
- // get custom thumbnail
- const TiXmlNode *pThumbnailNode = node->FirstChild("thumbnail");
- if (pThumbnailNode && pThumbnailNode->FirstChild())
+ const TiXmlNode *pNodeParent = node->FirstChild("parentid");
+ if (pNodeParent && pNodeParent->FirstChild())
{
- props.icon = pThumbnailNode->FirstChild()->Value();
+ props.parent = pNodeParent->FirstChild()->Value();
}
addons.insert(addons.end(), props);
View
21 xbmc/utils/AddonManager.h
@@ -104,7 +104,7 @@ namespace ADDON
/* Addon access */
bool GetDefault(const TYPE &type, AddonPtr &addon, const CONTENT_TYPE &content = CONTENT_NONE);
- bool GetAddon(const TYPE &type, const CStdString &str, AddonPtr &addon);
+ bool GetAddon(const CStdString &str, AddonPtr &addon, const TYPE &type = ADDON_UNKNOWN);
bool HasAddons(const TYPE &type, const CONTENT_TYPE &content = CONTENT_NONE);
bool GetAddons(const TYPE &type, VECADDONS &addons, const CONTENT_TYPE &content = CONTENT_NONE, bool enabled = true);
bool GetAllAddons(VECADDONS &addons, bool enabledOnly = true);
@@ -125,27 +125,26 @@ namespace ADDON
void UpdateRepos();
bool ParseRepoXML(const CStdString &path);
- void FindAddons(const TYPE &type);
- bool LoadAddonsXML(const TYPE &type);
- bool SaveAddonsXML(const TYPE &type);
- bool AddonFromInfoXML(const TYPE &reqType, const CStdString &path, AddonPtr &addon);
+ void FindAddons();
+ bool LoadAddonsXML();
+ bool SaveAddonsXML();
+ bool AddonFromInfoXML(const CStdString &path, AddonPtr &addon);
bool DependenciesMet(AddonPtr &addon);
bool UpdateIfKnown(AddonPtr &addon);
/* addons.xml */
CStdString GetAddonsXMLFile() const;
- bool GetAddonProps(const TYPE &type, VECADDONPROPS &addons);
- bool LoadAddonsXML(const TYPE& type, VECADDONPROPS& addons);
- bool SaveAddonsXML(const TYPE& type, const VECADDONPROPS &addons);
- bool SetAddons(TiXmlNode *root, const TYPE &type, const VECADDONPROPS &addons);
- void GetAddons(const TiXmlElement* pRootElement, const TYPE &type, VECADDONPROPS &addons);
+ bool LoadAddonsXML(VECADDONPROPS& addons);
+ bool SaveAddonsXML(const VECADDONPROPS &addons);
+ bool SetAddons(TiXmlNode *root, const VECADDONPROPS &addons);
+ void GetAddons(const TiXmlElement* pRootElement, VECADDONPROPS &addons);
bool GetAddon(const TYPE &type, const TiXmlNode *node, VECADDONPROPS &addon);
CAddonMgr();
static CAddonMgr* m_pInstance;
static std::map<TYPE, IAddonMgrCallback*> m_managers;
MAPADDONS m_addons;
- std::map<TYPE, CDateTime> m_lastDirScan;
+ CDateTime m_lastDirScan;
std::map<CStdString, AddonPtr> m_idMap;
};
View
4 xbmc/utils/ScraperParser.cpp
@@ -95,7 +95,7 @@ bool CScraperParser::Load(const CStdString& strXMLFile)
if (StringUtils::ValidateUUID(strXMLFile))
{
AddonPtr scraper;
- if (!CAddonMgr::Get()->GetAddon(ADDON_SCRAPER, strXMLFile, scraper))
+ if (!CAddonMgr::Get()->GetAddon(strXMLFile, scraper, ADDON_SCRAPER))
return false;
else
return Load(scraper);
@@ -166,7 +166,7 @@ bool CScraperParser::LoadFromXML()
while (itr != deps.end())
{
AddonPtr dep;
- if (!CAddonMgr::Get()->GetAddon(ADDON_SCRAPER_LIBRARY, (*itr).first, dep))
+ if (!CAddonMgr::Get()->GetAddon((*itr).first, dep, ADDON_SCRAPER_LIBRARY))
{
itr++;
continue;
View
2  xbmc/visualizations/OpenGLSpectrum/Makefile.in
@@ -4,7 +4,7 @@ DEFINES+=-DHAS_SDL_OPENGL -DHAS_SDL
CXXFLAGS=-fPIC
OBJS=opengl_spectrum.o
-SLIB=../../../addons/visualizations/GLSpectrum/opengl_spectrum.vis
+SLIB=../../../addons/vis.glspectrum/opengl_spectrum.vis
$(SLIB): $(OBJS)
ifeq ($(findstring osx,$(ARCH)), osx)
View
2  xbmc/visualizations/WaveForm/Makefile.in
@@ -4,7 +4,7 @@ DEFINES+=-DHAS_SDL_OPENGL -DHAS_SDL
CXXFLAGS=-fPIC
OBJS=Main.o
-SLIB=../../../addons/visualizations/Waveform/Waveform.vis
+SLIB=../../../addons/vis.waveform/Waveform.vis
$(SLIB): $(OBJS)
ifeq ($(findstring osx,$(ARCH)), osx)
View
2  xbmc/visualizations/XBMCProjectM/Makefile.in
@@ -1,7 +1,7 @@
ARCH=@ARCH@
INCLUDES=-I. -I../../addons/include
OBJS=Main.o
-SLIB=../../../addons/visualizations/ProjectM/projectM.vis
+SLIB=../../../addons/net.sf.projectm.xbmc/projectM.vis
DEFINES+=-DHAS_SDL_OPENGL -DHAS_SDL
CXXFLAGS=-fPIC
DIRS=libprojectM
View
2  xbmc/visualizations/iTunes/Makefile.in
@@ -2,7 +2,7 @@ ARCH=@ARCH@
INCLUDES=-I. -I../../addons/include -I/opt/local/include
OBJS=Main.o itunes_vis.o qview.o common_osx.o
CXXFLAGS=-Wall -g -fPIC
-SLIB=../../../addons/visualizations/iTunes/iTunes.mvis
+SLIB=../../../addons/com.itunes.vis/iTunes.mvis
$(SLIB): $(OBJS)
ifeq ($(findstring osx,$(ARCH)), osx)
Please sign in to comment.
Something went wrong with that request. Please try again.