diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h index 5f218e2a1dc0..85f5fb9e7ba4 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h @@ -326,8 +326,6 @@ class MANTID_KERNEL_DLL ConfigServiceImpl { /// The list of available facilities std::vector m_facilities; - /// Define a flag value for a removed property - const std::string m_removedFlag; /// local cache of proxy details Kernel::ProxyInfo m_proxyInfo; diff --git a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp index 4ff60619ab8f..31a1e27689a9 100644 --- a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp +++ b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp @@ -149,7 +149,7 @@ ConfigServiceImpl::ConfigServiceImpl() m_user_properties_file_name("Mantid.user.properties"), #endif m_DataSearchDirs(), m_UserSearchDirs(), m_InstrumentDirs(), - m_instr_prefixes(), m_removedFlag("@@REMOVED@@"), m_proxyInfo(), + m_instr_prefixes(), m_proxyInfo(), m_isProxySet(false) { // getting at system details m_pSysConfig = new WrappedObject; @@ -943,8 +943,6 @@ std::string ConfigServiceImpl::getString(const std::string &keyName, std::string retVal; try { retVal = m_pConf->getString(keyName); - if (retVal == m_removedFlag) - retVal = ""; } catch (Poco::NotFoundException &) { g_log.debug() << "Unable to find " << keyName << " in the properties file" @@ -966,30 +964,8 @@ std::string ConfigServiceImpl::getString(const std::string &keyName, std::vector ConfigServiceImpl::getKeys(const std::string &keyName) const { std::vector rawKeys; - std::vector keyVector; - keyVector.reserve(rawKeys.size()); - try { - m_pConf->keys(keyName, rawKeys); - // Work around a limitation of Poco < v1.4 which has no remove functionality - // so check those that have been marked with the correct flag - const size_t nraw = rawKeys.size(); - for (size_t i = 0; i < nraw; ++i) { - const std::string key = rawKeys[i]; - try { - if (m_pConf->getString(key) == m_removedFlag) - continue; - } - catch (Poco::NotFoundException &) { - } - keyVector.push_back(key); - } - } - catch (Poco::NotFoundException &) { - g_log.debug() << "Unable to find " << keyName << " in the properties file" - << std::endl; - keyVector.clear(); - } - return keyVector; + m_pConf->keys(keyName, rawKeys); + return rawKeys; } /** @@ -1039,16 +1015,7 @@ std::vector ConfigServiceImpl::keys() const { * @param rootName :: The key that is to be deleted */ void ConfigServiceImpl::remove(const std::string &rootName) const { - try { - // m_pConf->remove(rootName) will only work in Poco v >=1.4. Current Ubuntu - // and RHEL use 1.3.x - // Simulate removal by marking with a flag value - m_pConf->setString(rootName, m_removedFlag); - } - catch (Poco::NotFoundException &) { - g_log.debug() << "Unable to find " << rootName << " in the properties file" - << std::endl; - } + m_pConf->remove(rootName); m_changed_keys.insert(rootName); } @@ -1059,9 +1026,7 @@ void ConfigServiceImpl::remove(const std::string &rootName) const { * @returns Boolean value denoting whether the exists or not. */ bool ConfigServiceImpl::hasProperty(const std::string &rootName) const { - // Work around a limitation of Poco < v1.4 which has no remove functionality - return m_pConf->hasProperty(rootName) && - m_pConf->getString(rootName) != m_removedFlag; + return m_pConf->hasProperty(rootName); } /** Checks to see whether the given file target is an executable one and it