From d1c4559abe07c27cea5c15883a8ec07bd32fddef Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 1 Oct 2012 10:03:49 +0200 Subject: [PATCH] fixed GMST string handling in GUI --- apps/openmw/mwbase/windowmanager.hpp | 2 +- apps/openmw/mwgui/windowmanagerimp.cpp | 4 ++-- apps/openmw/mwgui/windowmanagerimp.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index 8ea9e5cef..d1daa101d 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -213,7 +213,7 @@ namespace MWBase * @param id Identifier for the GMST setting, e.g. "aName" * @param default Default value if the GMST setting cannot be used. */ - virtual const std::string &getGameSettingString(const std::string &id, const std::string &default_) = 0; + virtual std::string getGameSettingString(const std::string &id, const std::string &default_) = 0; virtual void processChangedSettings(const Settings::CategorySettingVector& changed) = 0; diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 87a2bc440..2b592e2ca 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -520,9 +520,9 @@ int WindowManager::readPressedButton () return mMessageBoxManager->readPressedButton(); } -const std::string &WindowManager::getGameSettingString(const std::string &id, const std::string &default_) +std::string WindowManager::getGameSettingString(const std::string &id, const std::string &default_) { - const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.find(id); + const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.search(id); if (setting && setting->mType == ESM::VT_String) return setting->getString(); return default_; diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index e30e110d3..f67559ccd 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -196,7 +196,7 @@ namespace MWGui * @param id Identifier for the GMST setting, e.g. "aName" * @param default Default value if the GMST setting cannot be used. */ - virtual const std::string &getGameSettingString(const std::string &id, const std::string &default_); + virtual std::string getGameSettingString(const std::string &id, const std::string &default_); virtual void processChangedSettings(const Settings::CategorySettingVector& changed);