Fix compile errors

pyro-refactor
MrSimbax 2020-07-22 17:24:07 +02:00
parent 2b96eda86d
commit 1be69a0a51
4 changed files with 10 additions and 8 deletions

View File

@ -33,7 +33,7 @@ namespace pt = boost::property_tree;
boost::optional<pt::ptree> LoadManifest(const std::string& path);
std::string GetStringProperty(const pt::ptree& manifest, const std::string& key);
std::unordered_map<Language, std::string> GetLanguageStringProperty(const pt::ptree& manifest, const std::string& key);
std::map<Language, std::string> GetLanguageStringProperty(const pt::ptree& manifest, const std::string& key);
ModData LoadModData(const std::string& path)
{
@ -89,9 +89,9 @@ std::string GetStringProperty(const pt::ptree& manifest, const std::string& key)
return {};
}
std::unordered_map<Language, std::string> GetLanguageStringProperty(const pt::ptree& manifest, const std::string& key)
std::map<Language, std::string> GetLanguageStringProperty(const pt::ptree& manifest, const std::string& key)
{
std::unordered_map<Language, std::string> ret;
std::map<Language, std::string> ret;
auto prop = manifest.get_child_optional(key);
if (prop)
{

View File

@ -21,15 +21,15 @@
#include "common/language.h"
#include <unordered_map>
#include <map>
struct ModData
{
std::unordered_map<Language, std::string> displayName{};
std::map<Language, std::string> displayName{};
std::string author{};
std::string version{};
std::string website{};
std::unordered_map<Language, std::string> summary{};
std::map<Language, std::string> summary{};
};
//! Loads the metadata for a mod in the given path.

View File

@ -559,7 +559,7 @@ void CScreenModList::UpdateUpDownButtons()
}
}
std::string CScreenModList::GetLanguageStringProperty(const std::unordered_map<Language, std::string>& property, const std::string& fallback)
std::string CScreenModList::GetLanguageStringProperty(const std::map<Language, std::string>& property, const std::string& fallback)
{
std::string ret{};
const auto language = m_app->GetLanguage();

View File

@ -25,6 +25,8 @@
#include "ui/screen/screen.h"
#include <map>
namespace Ui
{
@ -79,7 +81,7 @@ protected:
void UpdateApplyButton();
void UpdateUpDownButtons();
std::string GetLanguageStringProperty(const std::unordered_map<Language, std::string>& property, const std::string& fallback);
std::string GetLanguageStringProperty(const std::map<Language, std::string>& property, const std::string& fallback);
protected:
Ui::CMainDialog* m_dialog;