diff --git a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp index de7b08e5886c2683f4b028201a101cefd3db9138..5c21d4fbc1445f7ee60aafbc605cc0b857d53d0e 100644 --- a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp +++ b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp @@ -689,6 +689,7 @@ void ConfigServiceImpl::updateConfig(const std::string& filename, const bool app convertRelativeToAbsolute(); //Configure search paths into a specially saved store as they will be used frequently cacheDataSearchPaths(); + appendDataSearchDir(getString("defaultsave.directory")); cacheUserSearchPaths(); } } @@ -1012,7 +1013,7 @@ void ConfigServiceImpl::setString(const std::string & key, const std::string & v m_AbsolutePaths[key] = makeAbsolute(value, key); } - if (key == "datasearch.directories") + if (key == "datasearch.directories" ) { cacheDataSearchPaths(); } @@ -1022,8 +1023,7 @@ void ConfigServiceImpl::setString(const std::string & key, const std::string & v } else if (key == "defaultsave.directory") { - //Some recursion here! As this call calls the current function - appendDataSearchDir(m_AbsolutePaths[key]); + appendDataSearchDir(value); } m_pConf->setString(key, value); diff --git a/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h b/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h index 6bce2b7cc3f7ffd831a53a79ac75ad319216bff9..b11c3f8ca81ecfb3f4a9ce2ce3db409554ba5af7 100644 --- a/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h +++ b/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h @@ -431,7 +431,8 @@ public: //Returns all *root* keys, i.e. unique keys left of the first period std::vector<std::string> keyVector = ConfigService::Instance().getKeys(""); - TS_ASSERT_EQUALS(keyVector.size(), 4); + // The 4 unique in the file and the ConfigService always sets a datasearch.directories key on creation + TS_ASSERT_EQUALS(keyVector.size(), 5); } void testRemovingProperty()