From 97132a69d5ede88b286912e30768ad409a629e86 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 23 Oct 2015 19:14:15 +0100 Subject: Fix loading dynamically added option sources --- project2/common/optionsSource.cpp | 4 +++- project2/files/optionsSource.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/project2/common/optionsSource.cpp b/project2/common/optionsSource.cpp index 56e983c..0112ad4 100644 --- a/project2/common/optionsSource.cpp +++ b/project2/common/optionsSource.cpp @@ -26,7 +26,7 @@ boost::posix_time::ptime OptionsSource::loadedTime = boost::posix_time::special_ void OptionsSource::loadSources(const Options::CurrentPlatform & platform) { - const auto & configs = AdHoc::PluginManager::getDefault()->getAll(); + auto configs = AdHoc::PluginManager::getDefault()->getAll(); if (std::find_if(configs.begin(), configs.end(), [](boost::shared_ptr> c) { return c->implementation()->modifiedTime() > loadedTime; }) != configs.end()) { for (auto opts : AdHoc::PluginManager::getDefault()->getAll()) { opts->implementation()->reset(); @@ -39,6 +39,8 @@ OptionsSource::loadSources(const Options::CurrentPlatform & platform) if (loadedConfigs.find(c->implementation()) == loadedConfigs.end()) { c->implementation()->loadInto(dcc, platform); loadedConfigs.insert(c->implementation()); + configs = AdHoc::PluginManager::getDefault()->getAll(); + break; } } } diff --git a/project2/files/optionsSource.cpp b/project2/files/optionsSource.cpp index 2ce320c..f8d752d 100644 --- a/project2/files/optionsSource.cpp +++ b/project2/files/optionsSource.cpp @@ -29,7 +29,7 @@ boost::posix_time::ptime FileOptions::modifiedTime() const { return boost::posix_time::from_time_t( - boost::filesystem::exists(file) ? + boost::filesystem::exists(file) ? std::max( boost::filesystem::last_write_time(file), boost::filesystem::last_write_time(file.parent_path())) : -- cgit v1.2.3