Changed return type of getIconBasename() to be a reference.

This commit is contained in:
hiker 2014-07-28 21:07:03 +10:00
parent d3dbc42174
commit f6fcb9d8da
2 changed files with 2 additions and 2 deletions

View File

@ -164,7 +164,7 @@ public:
const std::string& getIconURL() const { return m_icon_url; } const std::string& getIconURL() const { return m_icon_url; }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** Returns the name of the icon (i.e. the basename of the url). */ /** Returns the name of the icon (i.e. the basename of the url). */
const std::string getIconBasename() const { return m_icon_basename; } const std::string& getIconBasename() const { return m_icon_basename; }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** Returns the name of the addon. */ /** Returns the name of the addon. */
const core::stringw& getDescription() const { return m_description; } const core::stringw& getDescription() const { return m_description; }

View File

@ -256,7 +256,7 @@ void AddonsManager::initAddons(const XMLNode *xml)
Log::warn( Log::warn(
"[AddonsManager] Removing '%s' which is not on the server anymore.\n", "[AddonsManager] Removing '%s' which is not on the server anymore.\n",
m_addons_list.getData()[i].getId().c_str() ); m_addons_list.getData()[i].getId().c_str() );
std::string icon = m_addons_list.getData()[i].getIconBasename(); const std::string &icon = m_addons_list.getData()[i].getIconBasename();
std::string icon_file =file_manager->getAddonsFile("icons/"+icon); std::string icon_file =file_manager->getAddonsFile("icons/"+icon);
if(file_manager->fileExists(icon_file)) if(file_manager->fileExists(icon_file))
{ {