diff options
32 files changed, 7 insertions, 135 deletions
diff --git a/xbmc/addons/Addon.cpp b/xbmc/addons/Addon.cpp index c7ec0a45d6..5864561800 100644 --- a/xbmc/addons/Addon.cpp +++ b/xbmc/addons/Addon.cpp @@ -207,23 +207,6 @@ CAddon::CAddon(AddonProps props) m_userSettingsLoaded = false; } -CAddon::CAddon(const CAddon &rhs) - : m_props(rhs.m_props), - m_settings(rhs.m_settings) -{ - m_addonXmlDoc = rhs.m_addonXmlDoc; - m_settingsLoaded = rhs.m_settingsLoaded; - m_userSettingsLoaded = rhs.m_userSettingsLoaded; - m_hasSettings = rhs.m_hasSettings; - BuildProfilePath(); - m_userSettingsPath = URIUtils::AddFileToFolder(Profile(), "settings.xml"); -} - -AddonPtr CAddon::Clone() const -{ - return AddonPtr(new CAddon(*this)); -} - bool CAddon::MeetsVersion(const AddonVersion &version) const { return m_props.minversion <= version && version <= m_props.version; @@ -504,11 +487,6 @@ CAddonLibrary::CAddonLibrary(AddonProps props) { } -AddonPtr CAddonLibrary::Clone() const -{ - return AddonPtr(new CAddonLibrary(*this)); -} - TYPE CAddonLibrary::SetAddonType() { if (Type() == ADDON_VIZ_LIBRARY) diff --git a/xbmc/addons/Addon.h b/xbmc/addons/Addon.h index cf85ec0dfc..becf55686b 100644 --- a/xbmc/addons/Addon.h +++ b/xbmc/addons/Addon.h @@ -105,7 +105,6 @@ class CAddon : public IAddon public: explicit CAddon(AddonProps props); virtual ~CAddon() {} - virtual AddonPtr Clone() const; /*! \brief Check whether the this addon can be configured or not \return true if the addon has settings, false otherwise @@ -205,8 +204,6 @@ public: protected: friend class CAddonCallbacksAddon; - CAddon(const CAddon &rhs); // protected as all copying is handled by Clone() - /*! \brief Load the default settings and override these with any previously configured user settings \param bForce force the load of settings even if they are already loaded (reload) \return true if settings exist, false otherwise @@ -260,8 +257,6 @@ class CAddonLibrary : public CAddon public: explicit CAddonLibrary(AddonProps props); - virtual AddonPtr Clone() const; - private: TYPE SetAddonType(); const TYPE m_addonType; // addon type this library enhances diff --git a/xbmc/addons/AddonDll.h b/xbmc/addons/AddonDll.h index 44cfc46de4..a18d650b4d 100644 --- a/xbmc/addons/AddonDll.h +++ b/xbmc/addons/AddonDll.h @@ -48,7 +48,6 @@ namespace ADDON //FIXME: does shallow pointer copy. no copy assignment op CAddonDll(const CAddonDll<TheDll, TheStruct, TheProps> &rhs); virtual ~CAddonDll(); - virtual AddonPtr Clone() const; virtual ADDON_STATUS GetStatus(); // addon settings @@ -124,12 +123,6 @@ CAddonDll<TheDll, TheStruct, TheProps>::~CAddonDll() } template<class TheDll, typename TheStruct, typename TheProps> -AddonPtr CAddonDll<TheDll, TheStruct, TheProps>::Clone() const -{ - return AddonPtr(new CAddonDll<TheDll, TheStruct, TheProps>(*this)); -} - -template<class TheDll, typename TheStruct, typename TheProps> bool CAddonDll<TheDll, TheStruct, TheProps>::LoadDll() { if (m_pDll) diff --git a/xbmc/addons/AudioDecoder.cpp b/xbmc/addons/AudioDecoder.cpp index 288a9cefdf..a89c51cb9f 100644 --- a/xbmc/addons/AudioDecoder.cpp +++ b/xbmc/addons/AudioDecoder.cpp @@ -46,12 +46,6 @@ CAudioDecoder::CAudioDecoder(AddonProps props, std::string extension, std::strin m_strExt = std::move(strExt); } -AddonPtr CAudioDecoder::Clone() const -{ - // Copy constructor is generated by compiler and calls parent copy constructor - return AddonPtr(new CAudioDecoder(*this)); -} - bool CAudioDecoder::Init(const std::string& strFile, unsigned int filecache) { if (!Initialized()) diff --git a/xbmc/addons/AudioDecoder.h b/xbmc/addons/AudioDecoder.h index c3600f3972..3c04de2bbb 100644 --- a/xbmc/addons/AudioDecoder.h +++ b/xbmc/addons/AudioDecoder.h @@ -57,7 +57,6 @@ namespace ADDON bool tracks, std::string codecName, std::string strExt); virtual ~CAudioDecoder() {} - virtual AddonPtr Clone() const; // Things that MUST be supplied by the child classes bool Init(const std::string& strFile, unsigned int filecache); diff --git a/xbmc/addons/AudioEncoder.cpp b/xbmc/addons/AudioEncoder.cpp index b5e9f19d88..0b04600460 100644 --- a/xbmc/addons/AudioEncoder.cpp +++ b/xbmc/addons/AudioEncoder.cpp @@ -32,12 +32,6 @@ CAudioEncoder::CAudioEncoder(AddonProps props, std::string _extension) { } -AddonPtr CAudioEncoder::Clone() const -{ - // Copy constructor is generated by compiler and calls parent copy constructor - return AddonPtr(new CAudioEncoder(*this)); -} - bool CAudioEncoder::Init(audioenc_callbacks &callbacks) { if (!Initialized()) diff --git a/xbmc/addons/AudioEncoder.h b/xbmc/addons/AudioEncoder.h index f5411b3cce..b609358503 100644 --- a/xbmc/addons/AudioEncoder.h +++ b/xbmc/addons/AudioEncoder.h @@ -36,7 +36,6 @@ namespace ADDON explicit CAudioEncoder(AddonProps props) : AudioEncoderDll(std::move(props)), m_context{nullptr} {}; CAudioEncoder(AddonProps props, std::string extension); virtual ~CAudioEncoder() {} - virtual AddonPtr Clone() const; // Things that MUST be supplied by the child classes bool Init(audioenc_callbacks &callbacks); diff --git a/xbmc/addons/IAddon.h b/xbmc/addons/IAddon.h index ad7e716e10..2469a642e0 100644 --- a/xbmc/addons/IAddon.h +++ b/xbmc/addons/IAddon.h @@ -89,7 +89,6 @@ namespace ADDON { public: virtual ~IAddon() {}; - virtual AddonPtr Clone() const =0; virtual TYPE Type() const =0; virtual TYPE FullType() const =0; virtual bool IsType(TYPE type) const =0; diff --git a/xbmc/addons/ImageResource.cpp b/xbmc/addons/ImageResource.cpp index cde99444e0..4b4672b225 100644 --- a/xbmc/addons/ImageResource.cpp +++ b/xbmc/addons/ImageResource.cpp @@ -39,11 +39,6 @@ CImageResource::CImageResource(AddonProps props, std::string type) { } -AddonPtr CImageResource::Clone() const -{ - return AddonPtr(new CImageResource(*this)); -} - void CImageResource::OnPreUnInstall() { CURL xbtUrl; diff --git a/xbmc/addons/ImageResource.h b/xbmc/addons/ImageResource.h index 090f074819..094247248f 100644 --- a/xbmc/addons/ImageResource.h +++ b/xbmc/addons/ImageResource.h @@ -37,7 +37,6 @@ public: explicit CImageResource(AddonProps props) : CResource(std::move(props)) {}; CImageResource(AddonProps props, std::string type); - virtual AddonPtr Clone() const; virtual void OnPreUnInstall(); virtual bool IsAllowed(const std::string &file) const; diff --git a/xbmc/addons/LanguageResource.cpp b/xbmc/addons/LanguageResource.cpp index ef16941f5c..33c9ed443f 100644 --- a/xbmc/addons/LanguageResource.cpp +++ b/xbmc/addons/LanguageResource.cpp @@ -126,11 +126,6 @@ CLanguageResource::CLanguageResource( m_sortTokens(sortTokens) { } -AddonPtr CLanguageResource::Clone() const -{ - return AddonPtr(new CLanguageResource(*this)); -} - bool CLanguageResource::IsInUse() const { return StringUtils::EqualsNoCase(CSettings::GetInstance().GetString(CSettings::SETTING_LOCALE_LANGUAGE), ID()); diff --git a/xbmc/addons/LanguageResource.h b/xbmc/addons/LanguageResource.h index cba170bd98..87776caa49 100644 --- a/xbmc/addons/LanguageResource.h +++ b/xbmc/addons/LanguageResource.h @@ -43,8 +43,6 @@ public: const std::string& dvdLanguageSubtitle, const std::set<std::string>& sortTokens); - virtual AddonPtr Clone() const; - virtual bool IsInUse() const; virtual void OnPostInstall(bool update, bool modal); diff --git a/xbmc/addons/PluginSource.cpp b/xbmc/addons/PluginSource.cpp index 677c9153c6..14ca09e4ce 100644 --- a/xbmc/addons/PluginSource.cpp +++ b/xbmc/addons/PluginSource.cpp @@ -51,11 +51,6 @@ CPluginSource::CPluginSource(AddonProps props, const std::string& provides) SetProvides(provides); } -AddonPtr CPluginSource::Clone() const -{ - return AddonPtr(new CPluginSource(*this)); -} - void CPluginSource::SetProvides(const std::string &content) { if (!content.empty()) diff --git a/xbmc/addons/PluginSource.h b/xbmc/addons/PluginSource.h index deea2944d4..eafc12be79 100644 --- a/xbmc/addons/PluginSource.h +++ b/xbmc/addons/PluginSource.h @@ -35,7 +35,6 @@ public: explicit CPluginSource(AddonProps props); CPluginSource(AddonProps props, const std::string& provides); - virtual AddonPtr Clone() const; virtual TYPE FullType() const; virtual bool IsType(TYPE type) const; bool Provides(const Content& content) const diff --git a/xbmc/addons/Repository.cpp b/xbmc/addons/Repository.cpp index 9907e2434e..e2b792ea1d 100644 --- a/xbmc/addons/Repository.cpp +++ b/xbmc/addons/Repository.cpp @@ -54,11 +54,6 @@ using namespace KODI::MESSAGING; using KODI::MESSAGING::HELPERS::DialogResponse; -AddonPtr CRepository::Clone() const -{ - return AddonPtr(new CRepository(*this)); -} - std::unique_ptr<CRepository> CRepository::FromExtension(AddonProps props, const cp_extension_t* ext) { DirList dirs; diff --git a/xbmc/addons/Repository.h b/xbmc/addons/Repository.h index 185469bd01..b3cac90c1a 100644 --- a/xbmc/addons/Repository.h +++ b/xbmc/addons/Repository.h @@ -49,8 +49,6 @@ namespace ADDON explicit CRepository(AddonProps props) : CAddon(std::move(props)) {}; CRepository(AddonProps props, DirList dirs); - virtual AddonPtr Clone() const; - /*! \brief Get the md5 hash for an addon. \param the addon in question. \return the md5 hash for the given addon, empty if non exists. diff --git a/xbmc/addons/Resource.h b/xbmc/addons/Resource.h index 019ddd0047..988bc87fce 100644 --- a/xbmc/addons/Resource.h +++ b/xbmc/addons/Resource.h @@ -32,8 +32,6 @@ class CResource : public CAddon public: virtual ~CResource() { } - virtual AddonPtr Clone() const = 0; - virtual bool IsAllowed(const std::string &file) const = 0; virtual std::string GetFullPath(const std::string &filePath) const diff --git a/xbmc/addons/Scraper.cpp b/xbmc/addons/Scraper.cpp index 4896cff481..6d839bb0a2 100644 --- a/xbmc/addons/Scraper.cpp +++ b/xbmc/addons/Scraper.cpp @@ -180,20 +180,6 @@ CScraper::CScraper(AddonProps props, const std::string& language, bool requiress { } -AddonPtr CScraper::Clone() const -{ - return AddonPtr(new CScraper(*this)); -} - -CScraper::CScraper(const CScraper &rhs) - : CAddon(rhs), m_fLoaded(false), - m_language(rhs.m_language), - m_requiressettings(rhs.m_requiressettings), - m_persistence(rhs.m_persistence), - m_pathContent(rhs.m_pathContent) -{ -} - bool CScraper::Supports(const CONTENT_TYPE &content) const { return Type() == ScraperTypeFromContent(content); diff --git a/xbmc/addons/Scraper.h b/xbmc/addons/Scraper.h index dd1cd8db50..f5c1819462 100644 --- a/xbmc/addons/Scraper.h +++ b/xbmc/addons/Scraper.h @@ -87,8 +87,6 @@ public: explicit CScraper(AddonProps props); CScraper(AddonProps props, const std::string& language, bool requiressettings, const CDateTimeSpan& persistence); - virtual AddonPtr Clone() const; - /*! \brief Set the scraper settings for a particular path from an XML string Loads the default and user settings (if not already loaded) and, if the given XML string is non-empty, overrides the user settings with the XML. diff --git a/xbmc/addons/ScreenSaver.cpp b/xbmc/addons/ScreenSaver.cpp index 6879244095..6e2763a5eb 100644 --- a/xbmc/addons/ScreenSaver.cpp +++ b/xbmc/addons/ScreenSaver.cpp @@ -37,12 +37,6 @@ CScreenSaver::CScreenSaver(const char *addonID) { } -AddonPtr CScreenSaver::Clone() const -{ - // Copy constructor is generated by compiler and calls parent copy constructor - return AddonPtr(new CScreenSaver(*this)); -} - bool CScreenSaver::IsInUse() const { return CSettings::GetInstance().GetString(CSettings::SETTING_SCREENSAVER_MODE) == ID(); @@ -56,7 +50,7 @@ bool CScreenSaver::CreateScreenSaver() g_alarmClock.Stop(SCRIPT_ALARM, true); if (!CScriptInvocationManager::GetInstance().Stop(LibPath())) - CScriptInvocationManager::GetInstance().ExecuteAsync(LibPath(), Clone()); + CScriptInvocationManager::GetInstance().ExecuteAsync(LibPath(), AddonPtr(new CScreenSaver(*this))); return true; } // pass it the screen width,height diff --git a/xbmc/addons/ScreenSaver.h b/xbmc/addons/ScreenSaver.h index 6e5468de1f..1e6e8d11fa 100644 --- a/xbmc/addons/ScreenSaver.h +++ b/xbmc/addons/ScreenSaver.h @@ -34,7 +34,6 @@ public: explicit CScreenSaver(const char *addonID); virtual ~CScreenSaver() {} - virtual AddonPtr Clone() const; virtual bool IsInUse() const; // Things that MUST be supplied by the child classes diff --git a/xbmc/addons/Service.cpp b/xbmc/addons/Service.cpp index 959cfac971..5ce961dcb2 100644 --- a/xbmc/addons/Service.cpp +++ b/xbmc/addons/Service.cpp @@ -42,11 +42,6 @@ CService::CService(AddonProps props, TYPE type, START_OPTION startOption) BuildServiceType(); } -AddonPtr CService::Clone() const -{ - return AddonPtr(new CService(*this)); -} - bool CService::Start() { bool ret = true; diff --git a/xbmc/addons/Service.h b/xbmc/addons/Service.h index e5a5ffab4d..2600b0deb8 100644 --- a/xbmc/addons/Service.h +++ b/xbmc/addons/Service.h @@ -43,7 +43,6 @@ namespace ADDON explicit CService(AddonProps props) : CAddon(std::move(props)), m_type(UNKNOWN), m_startOption(LOGIN) {} CService(AddonProps props, TYPE type, START_OPTION startOption); - virtual AddonPtr Clone() const; bool Start(); bool Stop(); diff --git a/xbmc/addons/Skin.cpp b/xbmc/addons/Skin.cpp index 061588585c..8eda7202bf 100644 --- a/xbmc/addons/Skin.cpp +++ b/xbmc/addons/Skin.cpp @@ -198,11 +198,6 @@ CSkinInfo::CSkinInfo( m_version = GetDependencyVersion("xbmc.gui"); } -AddonPtr CSkinInfo::Clone() const -{ - return AddonPtr(new CSkinInfo(*this)); -} - struct closestRes { closestRes(const RESOLUTION_INFO &target) : m_target(target) { }; diff --git a/xbmc/addons/Skin.h b/xbmc/addons/Skin.h index 45ac16c40e..fe48d072d3 100644 --- a/xbmc/addons/Skin.h +++ b/xbmc/addons/Skin.h @@ -123,8 +123,6 @@ public: float effectsSlowDown, bool debugging); - virtual AddonPtr Clone() const; - /*! \brief Load resultion information from directories in Path(). */ void Start(); diff --git a/xbmc/addons/UISoundsResource.cpp b/xbmc/addons/UISoundsResource.cpp index f408be3c12..5dd8113100 100644 --- a/xbmc/addons/UISoundsResource.cpp +++ b/xbmc/addons/UISoundsResource.cpp @@ -27,11 +27,6 @@ namespace ADDON { -AddonPtr CUISoundsResource::Clone() const -{ - return AddonPtr(new CUISoundsResource(*this)); -} - bool CUISoundsResource::IsAllowed(const std::string& file) const { return StringUtils::EqualsNoCase(file, "sounds.xml") diff --git a/xbmc/addons/UISoundsResource.h b/xbmc/addons/UISoundsResource.h index 995ecbb5dc..58ead3552a 100644 --- a/xbmc/addons/UISoundsResource.h +++ b/xbmc/addons/UISoundsResource.h @@ -28,7 +28,6 @@ class CUISoundsResource : public CResource { public: CUISoundsResource(AddonProps props) : CResource(std::move(props)) {}; - virtual AddonPtr Clone() const; virtual bool IsAllowed(const std::string &file) const; virtual bool IsInUse() const; virtual void OnPostInstall(bool update, bool modal); diff --git a/xbmc/addons/Webinterface.cpp b/xbmc/addons/Webinterface.cpp index d3c619a4c2..59c927d31b 100644 --- a/xbmc/addons/Webinterface.cpp +++ b/xbmc/addons/Webinterface.cpp @@ -64,8 +64,3 @@ std::string CWebinterface::GetBaseLocation() const return ""; } - -AddonPtr CWebinterface::Clone() const -{ - return AddonPtr(new CWebinterface(*this)); -}
\ No newline at end of file diff --git a/xbmc/addons/Webinterface.h b/xbmc/addons/Webinterface.h index f34ac94930..a15e1b9a2d 100644 --- a/xbmc/addons/Webinterface.h +++ b/xbmc/addons/Webinterface.h @@ -48,9 +48,6 @@ namespace ADDON std::string GetEntryPoint(const std::string &path) const; std::string GetBaseLocation() const; - // specializations of CAddon - virtual AddonPtr Clone() const; - private: WebinterfaceType m_type; std::string m_entryPoint; diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp index dc16b5e951..e717ea0c03 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -5394,7 +5394,7 @@ bool CMusicDatabase::GetScraperForPath(const std::string& strPath, ADDON::Scrape ADDON::AddonPtr addon; if (!scraperUUID.empty() && ADDON::CAddonMgr::GetInstance().GetAddon(scraperUUID, addon) && addon) { - info = std::dynamic_pointer_cast<ADDON::CScraper>(addon->Clone()); + info = std::dynamic_pointer_cast<ADDON::CScraper>(addon); if (!info) return false; // store this path's settings @@ -5406,7 +5406,7 @@ bool CMusicDatabase::GetScraperForPath(const std::string& strPath, ADDON::Scrape ADDON::AddonPtr defaultScraper; if (ADDON::CAddonMgr::GetInstance().GetDefault(type, defaultScraper)) { - info = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone()); + info = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper); } } } diff --git a/xbmc/music/windows/GUIWindowMusicNav.cpp b/xbmc/music/windows/GUIWindowMusicNav.cpp index f29c34e750..a1a35c761d 100644 --- a/xbmc/music/windows/GUIWindowMusicNav.cpp +++ b/xbmc/music/windows/GUIWindowMusicNav.cpp @@ -750,7 +750,7 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button) ADDON::AddonPtr defaultScraper; if (ADDON::CAddonMgr::GetInstance().GetDefault(ADDON::ScraperTypeFromContent(content), defaultScraper)) { - scraper = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone()); + scraper = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper); } } diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index ea42ead3ed..0fd0851ba1 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -6944,10 +6944,9 @@ ScraperPtr CVideoDatabase::GetScraperForPath(const std::string& strPath, SScanSe std::string scraperID = m_pDS->fv("path.strScraper").get_asString(); AddonPtr addon; - if (!scraperID.empty() && - CAddonMgr::GetInstance().GetAddon(scraperID, addon)) + if (!scraperID.empty() && CAddonMgr::GetInstance().GetAddon(scraperID, addon)) { - scraper = std::dynamic_pointer_cast<CScraper>(addon->Clone()); + scraper = std::dynamic_pointer_cast<CScraper>(addon); if (!scraper) return ScraperPtr(); @@ -6990,7 +6989,7 @@ ScraperPtr CVideoDatabase::GetScraperForPath(const std::string& strPath, SScanSe if (content != CONTENT_NONE && CAddonMgr::GetInstance().GetAddon(m_pDS->fv("path.strScraper").get_asString(), addon)) { - scraper = std::dynamic_pointer_cast<CScraper>(addon->Clone()); + scraper = std::dynamic_pointer_cast<CScraper>(addon); scraper->SetPathSettings(content, m_pDS->fv("path.strSettings").get_asString()); settings.parent_name = m_pDS->fv("path.useFolderNames").get_asBool(); settings.recurse = m_pDS->fv("path.scanRecursive").get_asInt(); |