From 4ed99dd05c2880265b7b7cc9e00282d9e92fe2b8 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Tue, 9 Jan 2018 12:42:47 +0100 Subject: [PATCH] Add-ons: make Addon::getMetadataFile() a private member function --- src/Add-ons/Addon.cxx | 4 ++++ src/Add-ons/Addon.hxx | 8 ++++---- src/Add-ons/AddonManager.cxx | 4 ---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Add-ons/Addon.cxx b/src/Add-ons/Addon.cxx index 271a21e08..b3ef0307b 100644 --- a/src/Add-ons/Addon.cxx +++ b/src/Add-ons/Addon.cxx @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -469,6 +470,9 @@ Addon Addon::fromAddonDir(const SGPath& addonPath) addon.setSupportUrl(addonSupportUrl); addon.setCodeRepositoryUrl(addonCodeRepoUrl); + SG_LOG(SG_GENERAL, SG_DEBUG, + "Loaded add-on metadata file: '" << metadataFile.utf8Str() + "'"); + return addon; } diff --git a/src/Add-ons/Addon.hxx b/src/Add-ons/Addon.hxx index 6bd455b61..76d4b7116 100644 --- a/src/Add-ons/Addon.hxx +++ b/src/Add-ons/Addon.hxx @@ -127,10 +127,6 @@ public: SGPath getBasePath() const; void setBasePath(const SGPath& addonBasePath); - // “Compute” a path to the metadata file from the add-on base path - static SGPath getMetadataFile(const SGPath& addonPath); - SGPath getMetadataFile() const; - // Should be valid for use with simgear::strutils::compare_versions() std::string getMinFGVersionRequired() const; void setMinFGVersionRequired(const std::string& minFGVersionRequired); @@ -175,6 +171,10 @@ public: static void setupGhost(nasal::Hash& addonsModule); private: + // “Compute” a path to the metadata file from the add-on base path + static SGPath getMetadataFile(const SGPath& addonPath); + SGPath getMetadataFile() const; + static std::tuple parseLicenseNode(const SGPath& addonPath, SGPropertyNode* addonNode); diff --git a/src/Add-ons/AddonManager.cxx b/src/Add-ons/AddonManager.cxx index 0f5113d79..0620911a2 100644 --- a/src/Add-ons/AddonManager.cxx +++ b/src/Add-ons/AddonManager.cxx @@ -113,7 +113,6 @@ AddonManager::registerAddonMetadata(const SGPath& addonPath) { using ptr_traits = shared_ptr_traits; AddonRef addon = ptr_traits::makeStrongRef(Addon::fromAddonDir(addonPath)); - SGPath metadataFile = addon->getMetadataFile(); string addonId = addon->getId(); SGPropertyNode* addonPropNode = fgGetNode("addons", true) @@ -151,9 +150,6 @@ AddonManager::registerAddonMetadata(const SGPath& addonPath) "path '" + existingElt->second->getBasePath().utf8Str() + "'"); } - SG_LOG(SG_GENERAL, SG_DEBUG, - "Loaded add-on metadata file: '" << metadataFile.utf8Str() + "'"); - return addonId; }