summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-10-23 19:14:15 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-10-23 19:14:15 +0100
commit97132a69d5ede88b286912e30768ad409a629e86 (patch)
treec247cd998132e504e6de8e152a35813229771d2a
parentAdd includes now slicer uses adhocutil (diff)
downloadproject2-97132a69d5ede88b286912e30768ad409a629e86.tar.bz2
project2-97132a69d5ede88b286912e30768ad409a629e86.tar.xz
project2-97132a69d5ede88b286912e30768ad409a629e86.zip
Fix loading dynamically added option sources
-rw-r--r--project2/common/optionsSource.cpp4
-rw-r--r--project2/files/optionsSource.cpp2
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<OptionsSource>();
+ auto configs = AdHoc::PluginManager::getDefault()->getAll<OptionsSource>();
if (std::find_if(configs.begin(), configs.end(), [](boost::shared_ptr<const AdHoc::PluginOf<OptionsSource>> c) { return c->implementation()->modifiedTime() > loadedTime; }) != configs.end()) {
for (auto opts : AdHoc::PluginManager::getDefault()->getAll<Options>()) {
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<OptionsSource>();
+ 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())) :