mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
+6
-2
@@ -259,7 +259,9 @@ BOSS_API unsigned int boss_load_lists (boss_db db, const char * const masterlist
|
||||
try {
|
||||
if (boost::filesystem::exists(masterlistPath)) {
|
||||
if (boost::algorithm::iends_with(masterlistPath, ".yaml")) {
|
||||
YAML::Node tempNode = YAML::LoadFile(masterlistPath);
|
||||
boss::ifstream in(masterlistPath);
|
||||
YAML::Node tempNode = YAML::Load(in);
|
||||
in.close();
|
||||
temp = tempNode["plugins"].as< std::list<boss::Plugin> >();
|
||||
}
|
||||
else {
|
||||
@@ -280,7 +282,9 @@ BOSS_API unsigned int boss_load_lists (boss_db db, const char * const masterlist
|
||||
if (userlistPath != NULL) {
|
||||
if (boost::filesystem::exists(userlistPath)) {
|
||||
if (boost::algorithm::iends_with(userlistPath, ".yaml")) {
|
||||
YAML::Node tempNode = YAML::LoadFile(userlistPath);
|
||||
boss::ifstream in(userlistPath);
|
||||
YAML::Node tempNode = YAML::Load(in);
|
||||
in.close();
|
||||
userTemp = tempNode["plugins"].as< std::list<boss::Plugin> >();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,9 @@ namespace boss {
|
||||
list<boss::Message> messages;
|
||||
list<boss::Plugin> plugins;
|
||||
try {
|
||||
YAML::Node mlist = YAML::LoadFile(game.MasterlistPath().string());
|
||||
boss::ifstream in(game.MasterlistPath());
|
||||
YAML::Node mlist = YAML::Load(in);
|
||||
in.close();
|
||||
|
||||
if (mlist["globals"])
|
||||
messages = mlist["globals"].as< list<boss::Message> >();
|
||||
|
||||
+15
-5
@@ -123,7 +123,9 @@ struct masterlist_updater_parser {
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "Parsing masterlist...";
|
||||
try {
|
||||
YAML::Node mlist = YAML::LoadFile(_game.MasterlistPath().string());
|
||||
boss::ifstream in(_game.MasterlistPath());
|
||||
YAML::Node mlist = YAML::Load(in);
|
||||
in.close();
|
||||
|
||||
if (mlist["globals"])
|
||||
_messages = mlist["globals"].as< list<boss::Message> >();
|
||||
@@ -187,7 +189,9 @@ bool BossGUI::OnInit() {
|
||||
}
|
||||
if (fs::exists(g_path_settings)) {
|
||||
try {
|
||||
_settings = YAML::LoadFile(g_path_settings.string());
|
||||
boss::ifstream in(g_path_settings);
|
||||
_settings = YAML::Load(in);
|
||||
in.close();
|
||||
} catch (YAML::ParserException& e) {
|
||||
wxMessageBox(
|
||||
FromUTF8(format(loc::translate("Error: Settings parsing failed. %1%")) % e.what()),
|
||||
@@ -538,7 +542,9 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) {
|
||||
BOOST_LOG_TRIVIAL(debug) << "Parsing userlist at: " << _game.UserlistPath();
|
||||
|
||||
try {
|
||||
YAML::Node ulist = YAML::LoadFile(_game.UserlistPath().string());
|
||||
boss::ifstream in(_game.UserlistPath());
|
||||
YAML::Node ulist = YAML::Load(in);
|
||||
in.close();
|
||||
|
||||
if (ulist["plugins"])
|
||||
ulist_plugins = ulist["plugins"].as< list<boss::Plugin> >();
|
||||
@@ -844,7 +850,9 @@ void Launcher::OnEditMetadata(wxCommandEvent& event) {
|
||||
BOOST_LOG_TRIVIAL(debug) << "Parsing masterlist.";
|
||||
YAML::Node mlist;
|
||||
try {
|
||||
mlist = YAML::LoadFile(_game.MasterlistPath().string());
|
||||
boss::ifstream in(_game.MasterlistPath());
|
||||
mlist = YAML::Load(in);
|
||||
in.close();
|
||||
} catch (YAML::ParserException& e) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Masterlist parsing failed. " << e.what();
|
||||
wxMessageBox(
|
||||
@@ -864,7 +872,9 @@ void Launcher::OnEditMetadata(wxCommandEvent& event) {
|
||||
BOOST_LOG_TRIVIAL(debug) << "Parsing userlist.";
|
||||
YAML::Node ulist;
|
||||
try {
|
||||
ulist = YAML::LoadFile(_game.UserlistPath().string());
|
||||
boss::ifstream in(_game.UserlistPath());
|
||||
ulist = YAML::Load(in);
|
||||
in.close();
|
||||
} catch (YAML::ParserException& e) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Userlist parsing failed. " << e.what();
|
||||
wxMessageBox(
|
||||
|
||||
Reference in New Issue
Block a user