From 3b5f8d694e3d589a7c70f2ed083ae6a3a6e17478 Mon Sep 17 00:00:00 2001 From: David Fairbrother <DavidFair@users.noreply.github.com> Date: Wed, 11 Jul 2018 19:40:28 +0100 Subject: [PATCH] Re #22647 Clang formatting --- Framework/API/src/Algorithm.cpp | 2 +- Framework/API/src/AlgorithmManager.cpp | 3 +- Framework/API/src/FrameworkManager.cpp | 12 +++-- Framework/API/src/IPowderDiffPeakFunction.cpp | 9 ++-- .../src/Functions/PawleyFunction.cpp | 5 +- .../src/LoadInstrumentFromNexus.cpp | 3 +- .../src/LoadInstrumentFromRaw.cpp | 17 +++---- .../DataHandling/src/LoadRaw/isisraw2.cpp | 8 ++-- Framework/DataObjects/src/PeakColumn.cpp | 8 ++-- .../Kernel/inc/MantidKernel/DataService.h | 5 +- Framework/Kernel/src/ConfigService.cpp | 46 ++++++++++--------- Framework/Kernel/src/ErrorReporter.cpp | 8 ++-- Framework/Kernel/src/InternetHelper.cpp | 5 +- Framework/Kernel/src/MultiFileNameParser.cpp | 3 +- Framework/Kernel/src/ThreadPool.cpp | 3 +- Framework/Kernel/src/UsageService.cpp | 5 +- Framework/Kernel/test/ConfigServiceTest.h | 8 +++- .../LiveData/src/FakeEventDataListener.cpp | 24 ++++++---- .../LiveData/src/FileEventDataListener.cpp | 3 +- .../LiveData/src/ISIS/DAE/isisds_command.cpp | 7 ++- .../LiveData/src/SNSLiveEventDataListener.cpp | 3 +- Framework/LiveData/test/TestDataListener.cpp | 31 ++++++++----- .../src/ScriptRepositoryImpl.cpp | 3 +- MantidPlot/src/ProjectRecovery.cpp | 2 +- .../sliceviewer/src/QPeaksTableModel.cpp | 6 ++- qt/widgets/sliceviewer/src/SliceViewer.cpp | 4 +- 26 files changed, 138 insertions(+), 95 deletions(-) diff --git a/Framework/API/src/Algorithm.cpp b/Framework/API/src/Algorithm.cpp index cc743f92b8d..c838a6366ad 100644 --- a/Framework/API/src/Algorithm.cpp +++ b/Framework/API/src/Algorithm.cpp @@ -1624,7 +1624,7 @@ void Algorithm::setLoggingOffset(const int value) { if (m_communicator->rank() == 0) g_log.setLevelOffset(value); else { - auto offset = ConfigService::Instance().getValue<int>("mpi.loggingOffset"); + auto offset = ConfigService::Instance().getValue<int>("mpi.loggingOffset"); g_log.setLevelOffset(value + offset.get_value_or(1)); } } diff --git a/Framework/API/src/AlgorithmManager.cpp b/Framework/API/src/AlgorithmManager.cpp index ed3d7cdc62d..502b9009f33 100644 --- a/Framework/API/src/AlgorithmManager.cpp +++ b/Framework/API/src/AlgorithmManager.cpp @@ -16,7 +16,8 @@ Kernel::Logger g_log("AlgorithmManager"); /// Private Constructor for singleton class AlgorithmManagerImpl::AlgorithmManagerImpl() : m_managed_algs() { - auto max_no_algs = Kernel::ConfigService::Instance().getValue<int>("algorithms.retained"); + auto max_no_algs = + Kernel::ConfigService::Instance().getValue<int>("algorithms.retained"); if (max_no_algs.get_value_or(0) < 1) { m_max_no_algs = 100; // Default to keeping 100 algorithms if not specified diff --git a/Framework/API/src/FrameworkManager.cpp b/Framework/API/src/FrameworkManager.cpp index e1e32f7b1b6..8625515e3c6 100644 --- a/Framework/API/src/FrameworkManager.cpp +++ b/Framework/API/src/FrameworkManager.cpp @@ -161,7 +161,8 @@ void FrameworkManagerImpl::loadPlugins() { */ void FrameworkManagerImpl::setNumOMPThreadsToConfigValue() { // Set the number of threads to use for this process - auto maxCores = Kernel::ConfigService::Instance().getValue<int>("MultiThreaded.MaxCores"); + auto maxCores = + Kernel::ConfigService::Instance().getValue<int>("MultiThreaded.MaxCores"); if (maxCores.get_value_or(0) > 0) { setNumOMPThreads(maxCores.get()); } @@ -436,8 +437,8 @@ void FrameworkManagerImpl::disableNexusOutput() { /// Starts asynchronous tasks that are done as part of Start-up. void FrameworkManagerImpl::asynchronousStartupTasks() { - auto instrumentUpdates = Kernel::ConfigService::Instance().getValue<bool>( - "UpdateInstrumentDefinitions.OnStartup"); + auto instrumentUpdates = Kernel::ConfigService::Instance().getValue<bool>( + "UpdateInstrumentDefinitions.OnStartup"); if (instrumentUpdates.get_value_or(false)) { updateInstrumentDefinitions(); @@ -446,7 +447,8 @@ void FrameworkManagerImpl::asynchronousStartupTasks() { "instrument definitions.\n"; } - auto newVersionCheck = Kernel::ConfigService::Instance().getValue<bool>("CheckMantidVersion.OnStartup"); + auto newVersionCheck = Kernel::ConfigService::Instance().getValue<bool>( + "CheckMantidVersion.OnStartup"); if (newVersionCheck.get_value_or(false)) { checkIfNewerVersionIsAvailable(); } else { @@ -458,7 +460,7 @@ void FrameworkManagerImpl::asynchronousStartupTasks() { void FrameworkManagerImpl::setupUsageReporting() { auto &configSvc = ConfigService::Instance(); - auto interval = configSvc.getValue<int>("Usage.BufferCheckInterval"); + auto interval = configSvc.getValue<int>("Usage.BufferCheckInterval"); auto &usageSvc = UsageService::Instance(); if (interval.get_value_or(0) > 0) { usageSvc.setInterval(interval.get()); diff --git a/Framework/API/src/IPowderDiffPeakFunction.cpp b/Framework/API/src/IPowderDiffPeakFunction.cpp index 118cdb74fcd..81b91a0333e 100644 --- a/Framework/API/src/IPowderDiffPeakFunction.cpp +++ b/Framework/API/src/IPowderDiffPeakFunction.cpp @@ -26,10 +26,11 @@ IPowderDiffPeakFunction::IPowderDiffPeakFunction() m_unitCell(), m_unitCellSize(0.), m_parameterValid(false), mH(0), mK(0), mL(0), mHKLSet(false), LATTICEINDEX(9999), HEIGHTINDEX(9999) { // Set peak's radius from configuration - auto peakRadius = Kernel::ConfigService::Instance().getValue<int>("curvefitting.peakRadius"); - if (peakRadius.is_initialized() && peakRadius.get() != s_peakRadius) { - setPeakRadius(peakRadius.get()); - } + auto peakRadius = Kernel::ConfigService::Instance().getValue<int>( + "curvefitting.peakRadius"); + if (peakRadius.is_initialized() && peakRadius.get() != s_peakRadius) { + setPeakRadius(peakRadius.get()); + } } //---------------------------------------------------------------------------------------------- diff --git a/Framework/CurveFitting/src/Functions/PawleyFunction.cpp b/Framework/CurveFitting/src/Functions/PawleyFunction.cpp index 3a8c237d386..8bfb943a178 100644 --- a/Framework/CurveFitting/src/Functions/PawleyFunction.cpp +++ b/Framework/CurveFitting/src/Functions/PawleyFunction.cpp @@ -317,8 +317,9 @@ PawleyFunction::PawleyFunction() : IPawleyFunction(), m_compositeFunction(), m_pawleyParameterFunction(), m_peakProfileComposite(), m_hkls(), m_dUnit(), m_wsUnit(), m_peakRadius(5) { - auto peakRadius = Kernel::ConfigService::Instance().getValue<int>("curvefitting.peakRadius"); - m_peakRadius = peakRadius.get_value_or(5); + auto peakRadius = Kernel::ConfigService::Instance().getValue<int>( + "curvefitting.peakRadius"); + m_peakRadius = peakRadius.get_value_or(5); } void PawleyFunction::setMatrixWorkspace( diff --git a/Framework/DataHandling/src/LoadInstrumentFromNexus.cpp b/Framework/DataHandling/src/LoadInstrumentFromNexus.cpp index 6ca86886b4e..6a3b09c7db6 100644 --- a/Framework/DataHandling/src/LoadInstrumentFromNexus.cpp +++ b/Framework/DataHandling/src/LoadInstrumentFromNexus.cpp @@ -75,7 +75,8 @@ void LoadInstrumentFromNexus::exec() { instrument->add(source); instrument->markAsSource(source); // If user has provided an L1, use that - auto l1ConfigVal = Kernel::ConfigService::Instance().getValue<double>("instrument.L1"); + auto l1ConfigVal = + Kernel::ConfigService::Instance().getValue<double>("instrument.L1"); // Otherwise try and get it from the nexus file - but not there at present! // l1 = nxload.ivpb.i_l1; // Default to 10 if the file doesn't have it set diff --git a/Framework/DataHandling/src/LoadInstrumentFromRaw.cpp b/Framework/DataHandling/src/LoadInstrumentFromRaw.cpp index 694e5ee14af..28f3a6ee8b9 100644 --- a/Framework/DataHandling/src/LoadInstrumentFromRaw.cpp +++ b/Framework/DataHandling/src/LoadInstrumentFromRaw.cpp @@ -84,14 +84,15 @@ void LoadInstrumentFromRaw::exec() { instrument->markAsSource(source); progress(0.5); - // If user has provided an L1, use that - auto l1ConfigValue = Kernel::ConfigService::Instance().getValue<double>("instrument.L1"); - // Otherwise try and get it from the raw file - double l1 = l1ConfigValue.get_value_or(iraw.ivpb.i_l1); - // Default to 10 if the raw file doesn't have it set - if (l1 == 0) - l1 = 10.0; - + // If user has provided an L1, use that + auto l1ConfigValue = + Kernel::ConfigService::Instance().getValue<double>("instrument.L1"); + // Otherwise try and get it from the raw file + double l1 = l1ConfigValue.get_value_or(iraw.ivpb.i_l1); + // Default to 10 if the raw file doesn't have it set + if (l1 == 0) + l1 = 10.0; + source->setPos(0.0, 0.0, -1.0 * l1); // add detectors diff --git a/Framework/DataHandling/src/LoadRaw/isisraw2.cpp b/Framework/DataHandling/src/LoadRaw/isisraw2.cpp index 2acf22f1b5e..8aeb825516e 100644 --- a/Framework/DataHandling/src/LoadRaw/isisraw2.cpp +++ b/Framework/DataHandling/src/LoadRaw/isisraw2.cpp @@ -18,14 +18,16 @@ ISISRAW2::ISISRAW2() : ISISRAW(nullptr, false), ndes(0), outbuff(nullptr), m_bufferSize(0) { // Determine the size of the output buffer to create from the config service. g_log.debug("Determining ioRaw buffer size\n"); - auto bufferSizeConfigVal = Mantid::Kernel::ConfigService::Instance().getValue<int>("loadraw.readbuffer.size"); + auto bufferSizeConfigVal = + Mantid::Kernel::ConfigService::Instance().getValue<int>( + "loadraw.readbuffer.size"); -if (!bufferSizeConfigVal.is_initialized()){ + if (!bufferSizeConfigVal.is_initialized()) { m_bufferSize = 200000; g_log.debug() << "loadraw.readbuffer.size not found, setting to " << m_bufferSize << "\n"; } else { - m_bufferSize = bufferSizeConfigVal.get(); + m_bufferSize = bufferSizeConfigVal.get(); g_log.debug() << "loadraw.readbuffer.size set to " << m_bufferSize << "\n"; } } diff --git a/Framework/DataObjects/src/PeakColumn.cpp b/Framework/DataObjects/src/PeakColumn.cpp index 9d686036dde..538d7089f5c 100644 --- a/Framework/DataObjects/src/PeakColumn.cpp +++ b/Framework/DataObjects/src/PeakColumn.cpp @@ -84,10 +84,10 @@ PeakColumn::PeakColumn(std::vector<Peak> &peaks, const std::string &name) auto hklPrec = ConfigService::Instance().getValue<int>(key); this->m_hklPrec = hklPrec.get_value_or(2); if (!hklPrec.is_initialized()) { - g_log.information() - << "In PeakColumn constructor, did not find any value for '" << key - << "' from the Config Service. Using default: " << this->m_hklPrec - << "\n"; + g_log.information() + << "In PeakColumn constructor, did not find any value for '" << key + << "' from the Config Service. Using default: " << this->m_hklPrec + << "\n"; } } diff --git a/Framework/Kernel/inc/MantidKernel/DataService.h b/Framework/Kernel/inc/MantidKernel/DataService.h index 7049aa61cd9..f9568769f98 100644 --- a/Framework/Kernel/inc/MantidKernel/DataService.h +++ b/Framework/Kernel/inc/MantidKernel/DataService.h @@ -503,8 +503,9 @@ public: } static bool showingHiddenObjects() { - auto showingHiddenFlag = ConfigService::Instance().getValue<bool>("MantidOptions.InvisibleWorkspaces"); - return showingHiddenFlag.get_value_or(false); + auto showingHiddenFlag = ConfigService::Instance().getValue<bool>( + "MantidOptions.InvisibleWorkspaces"); + return showingHiddenFlag.get_value_or(false); } /// Sends notifications to observers. Observers can subscribe to diff --git a/Framework/Kernel/src/ConfigService.cpp b/Framework/Kernel/src/ConfigService.cpp index a9751d7bb59..05504c7e251 100644 --- a/Framework/Kernel/src/ConfigService.cpp +++ b/Framework/Kernel/src/ConfigService.cpp @@ -1119,9 +1119,9 @@ boost::optional<T> ConfigServiceImpl::getValue(const std::string &keyName) { int result = Mantid::Kernel::Strings::convert(strValue, output); if (result != 1) { - return boost::none; + return boost::none; } - + return boost::optional<T>(output); } @@ -1134,19 +1134,20 @@ boost::optional<T> ConfigServiceImpl::getValue(const std::string &keyName) { */ template <> boost::optional<bool> ConfigServiceImpl::getValue(const std::string &keyName) { - auto returnedValue = getValue<std::string>(keyName); - if (!returnedValue.is_initialized()) { - return boost::none; - } + auto returnedValue = getValue<std::string>(keyName); + if (!returnedValue.is_initialized()) { + return boost::none; + } - std::transform(returnedValue->begin(), returnedValue->end(), returnedValue->begin(), ::tolower); + std::transform(returnedValue->begin(), returnedValue->end(), + returnedValue->begin(), ::tolower); - bool trueString = returnedValue->find("true") != std::string::npos; - bool valueOne = returnedValue->find("1") != std::string::npos; + bool trueString = returnedValue->find("true") != std::string::npos; + bool valueOne = returnedValue->find("1") != std::string::npos; bool onOffString = returnedValue->find("on") != std::string::npos; - // A string of 1 or true both count - return trueString || valueOne || onOffString; + // A string of 1 or true both count + return trueString || valueOne || onOffString; } /** @@ -2020,12 +2021,10 @@ Kernel::ProxyInfo &ConfigServiceImpl::getProxy(const std::string &url) { if (!m_isProxySet) { // set the proxy // first check if the proxy is defined in the properties file - auto proxyHost = getValue<std::string>("proxy.host"); - auto proxyPort = getValue<int>("proxy.port"); - - + auto proxyHost = getValue<std::string>("proxy.host"); + auto proxyPort = getValue<int>("proxy.port"); - if ( proxyHost.is_initialized() && proxyPort.is_initialized()) { + if (proxyHost.is_initialized() && proxyPort.is_initialized()) { // set it from the config values m_proxyInfo = ProxyInfo(proxyHost.get(), proxyPort.get(), true); } else { @@ -2116,11 +2115,16 @@ int ConfigServiceImpl::FindLowestFilterLevel() const { } /// \cond TEMPLATE -template DLLExport boost::optional<double> ConfigServiceImpl::getValue(const std::string &); -template DLLExport boost::optional<std::string> ConfigServiceImpl::getValue(const std::string &); -template DLLExport boost::optional<int> ConfigServiceImpl::getValue(const std::string &); -template DLLExport boost::optional<size_t> ConfigServiceImpl::getValue(const std::string &); -template DLLExport boost::optional<bool> ConfigServiceImpl::getValue(const std::string &); +template DLLExport boost::optional<double> +ConfigServiceImpl::getValue(const std::string &); +template DLLExport boost::optional<std::string> +ConfigServiceImpl::getValue(const std::string &); +template DLLExport boost::optional<int> +ConfigServiceImpl::getValue(const std::string &); +template DLLExport boost::optional<size_t> +ConfigServiceImpl::getValue(const std::string &); +template DLLExport boost::optional<bool> +ConfigServiceImpl::getValue(const std::string &); /// \endcond TEMPLATE } // namespace Kernel diff --git a/Framework/Kernel/src/ErrorReporter.cpp b/Framework/Kernel/src/ErrorReporter.cpp index 7ed8a3bf221..c66d8b488b9 100644 --- a/Framework/Kernel/src/ErrorReporter.cpp +++ b/Framework/Kernel/src/ErrorReporter.cpp @@ -38,12 +38,12 @@ ErrorReporter::ErrorReporter(std::string application, std::string email) : m_application(application), m_exitCode(exitCode), m_upTime(upTime), m_share(share), m_name(name), m_email(email) { - auto url = Mantid::Kernel::ConfigService::Instance().getValue<std::string>("errorreports.rooturl"); + auto url = Mantid::Kernel::ConfigService::Instance().getValue<std::string>( + "errorreports.rooturl"); if (!url.is_initialized()) { g_log.debug() << "Failed to load error report url\n"; - } - else { - m_url = url.get(); + } else { + m_url = url.get(); } } diff --git a/Framework/Kernel/src/InternetHelper.cpp b/Framework/Kernel/src/InternetHelper.cpp index 73736c74664..33fe2ddbe1b 100644 --- a/Framework/Kernel/src/InternetHelper.cpp +++ b/Framework/Kernel/src/InternetHelper.cpp @@ -477,8 +477,9 @@ void InternetHelper::throwNotConnected(const std::string &url, **/ int InternetHelper::getTimeout() { if (!m_isTimeoutSet) { - auto m_timeout = ConfigService::Instance().getValue<int>("network.default.timeout"); - if (!m_timeout.is_initialized()) { + auto m_timeout = + ConfigService::Instance().getValue<int>("network.default.timeout"); + if (!m_timeout.is_initialized()) { m_timeout = 30; // the default value if the key is not found } } diff --git a/Framework/Kernel/src/MultiFileNameParser.cpp b/Framework/Kernel/src/MultiFileNameParser.cpp index 39206e379fc..4e8212aa555 100644 --- a/Framework/Kernel/src/MultiFileNameParser.cpp +++ b/Framework/Kernel/src/MultiFileNameParser.cpp @@ -549,7 +549,8 @@ generateRange(unsigned int const from, unsigned int const to, "Unable to generate a range with a step size of zero."); size_t limit; - auto limitStr = ConfigService::Instance().getValue<std::string>("loading.multifilelimit"); + auto limitStr = + ConfigService::Instance().getValue<std::string>("loading.multifilelimit"); if (!limitStr.is_initialized() || !Strings::convert(limitStr.get(), limit)) { limit = ConfigService::Instance().getFacility().multiFileLimit(); } diff --git a/Framework/Kernel/src/ThreadPool.cpp b/Framework/Kernel/src/ThreadPool.cpp index 25b74b63af8..afae29375c7 100644 --- a/Framework/Kernel/src/ThreadPool.cpp +++ b/Framework/Kernel/src/ThreadPool.cpp @@ -73,7 +73,8 @@ size_t ThreadPool::getNumPhysicalCores() { int physicalCores = PARALLEL_GET_MAX_THREADS; #endif - auto maxCores = Kernel::ConfigService::Instance().getValue<int>("MultiThreaded.MaxCores"); + auto maxCores = + Kernel::ConfigService::Instance().getValue<int>("MultiThreaded.MaxCores"); if (!maxCores.is_initialized()) return std::min(maxCores.get_value_or(0), physicalCores); diff --git a/Framework/Kernel/src/UsageService.cpp b/Framework/Kernel/src/UsageService.cpp index 9365b9ae029..af144317dbf 100644 --- a/Framework/Kernel/src/UsageService.cpp +++ b/Framework/Kernel/src/UsageService.cpp @@ -65,11 +65,12 @@ UsageServiceImpl::UsageServiceImpl() m_startupActiveMethod(this, &UsageServiceImpl::sendStartupAsyncImpl), m_featureActiveMethod(this, &UsageServiceImpl::sendFeatureAsyncImpl) { setInterval(60); - auto url = Mantid::Kernel::ConfigService::Instance().getValue<std::string>("usagereports.rooturl"); + auto url = Mantid::Kernel::ConfigService::Instance().getValue<std::string>( + "usagereports.rooturl"); if (!url.is_initialized()) { g_log.debug() << "Failed to load usage report url\n"; } else { - m_url = url.get(); + m_url = url.get(); g_log.debug() << "Root usage reporting url is " << m_url << "\n"; } m_startTime = Types::Core::DateAndTime::getCurrentTime(); diff --git a/Framework/Kernel/test/ConfigServiceTest.h b/Framework/Kernel/test/ConfigServiceTest.h index 816d466d05b..1d1f9fa7527 100644 --- a/Framework/Kernel/test/ConfigServiceTest.h +++ b/Framework/Kernel/test/ConfigServiceTest.h @@ -386,8 +386,12 @@ public: void TestCustomPropertyAsValue() { // Mantid.legs is defined in the properties script as 6 - int value = ConfigService::Instance().getValue<int>("algorithms.retained").get_value_or(0); - double dblValue = ConfigService::Instance().getValue<double>("algorithms.retained").get_value_or(0); + int value = ConfigService::Instance() + .getValue<int>("algorithms.retained") + .get_value_or(0); + double dblValue = ConfigService::Instance() + .getValue<double>("algorithms.retained") + .get_value_or(0); TS_ASSERT_EQUALS(value, 50); TS_ASSERT_EQUALS(dblValue, 50.0); diff --git a/Framework/LiveData/src/FakeEventDataListener.cpp b/Framework/LiveData/src/FakeEventDataListener.cpp index fd455cfe789..d93713aaf01 100644 --- a/Framework/LiveData/src/FakeEventDataListener.cpp +++ b/Framework/LiveData/src/FakeEventDataListener.cpp @@ -20,16 +20,20 @@ DECLARE_LISTENER(FakeEventDataListener) FakeEventDataListener::FakeEventDataListener() : LiveListener(), m_buffer(), m_rand(new Kernel::MersenneTwister(5489)), m_timer(), m_callbackloop(1), m_numExtractDataCalls(0), m_runNumber(1) { - - auto datarateConfigVal = ConfigService::Instance().getValue<int>("fakeeventdatalistener.datarate"); - m_datarate = datarateConfigVal.get_value_or(200); // Default data rate. Low so that our lowest-powered - // buildserver can cope. - // For auto-ending and restarting runs - auto endRunEveryConfigVal = ConfigService::Instance().getValue<int>("fakeeventdatalistener.endrunevery"); - m_endRunEvery = endRunEveryConfigVal.get_value_or(0); - - auto notyettimesConfigVal = ConfigService::Instance().getValue<int>("fakeeventdatalistener.notyettimes"); - m_notyettimes = notyettimesConfigVal.get_value_or(0); + + auto datarateConfigVal = + ConfigService::Instance().getValue<int>("fakeeventdatalistener.datarate"); + m_datarate = datarateConfigVal.get_value_or( + 200); // Default data rate. Low so that our lowest-powered + // buildserver can cope. + // For auto-ending and restarting runs + auto endRunEveryConfigVal = ConfigService::Instance().getValue<int>( + "fakeeventdatalistener.endrunevery"); + m_endRunEvery = endRunEveryConfigVal.get_value_or(0); + + auto notyettimesConfigVal = ConfigService::Instance().getValue<int>( + "fakeeventdatalistener.notyettimes"); + m_notyettimes = notyettimesConfigVal.get_value_or(0); } /// Destructor diff --git a/Framework/LiveData/src/FileEventDataListener.cpp b/Framework/LiveData/src/FileEventDataListener.cpp index 0e52c923f6f..d00fd9cb981 100644 --- a/Framework/LiveData/src/FileEventDataListener.cpp +++ b/Framework/LiveData/src/FileEventDataListener.cpp @@ -53,7 +53,8 @@ FileEventDataListener::FileEventDataListener() } } - auto numChunks = ConfigService::Instance().getValue<int>("fileeventdatalistener.chunks"); + auto numChunks = + ConfigService::Instance().getValue<int>("fileeventdatalistener.chunks"); m_numChunks = numChunks.get_value_or(0); if (!numChunks.is_initialized()) { g_log.error("Configuration property fileeventdatalistener.chunks not " diff --git a/Framework/LiveData/src/ISIS/DAE/isisds_command.cpp b/Framework/LiveData/src/ISIS/DAE/isisds_command.cpp index 04a518575f3..aab18ceb8da 100644 --- a/Framework/LiveData/src/ISIS/DAE/isisds_command.cpp +++ b/Framework/LiveData/src/ISIS/DAE/isisds_command.cpp @@ -161,8 +161,11 @@ SOCKET isisds_send_open(const char *host, ISISDSAccessMode access_type, return INVALID_SOCKET; } - auto timeoutInSecConfigVal = Mantid::Kernel::ConfigService::Instance().getValue<int>("ISISDAE.Timeout"); - int timeoutinSec = timeoutInSecConfigVal.get_value_or(120); // Default to 120 seconds if not specified + auto timeoutInSecConfigVal = + Mantid::Kernel::ConfigService::Instance().getValue<int>( + "ISISDAE.Timeout"); + int timeoutinSec = timeoutInSecConfigVal.get_value_or( + 120); // Default to 120 seconds if not specified #ifdef WIN32 // WINDOWS diff --git a/Framework/LiveData/src/SNSLiveEventDataListener.cpp b/Framework/LiveData/src/SNSLiveEventDataListener.cpp index 795f21be390..17f4331cc7b 100644 --- a/Framework/LiveData/src/SNSLiveEventDataListener.cpp +++ b/Framework/LiveData/src/SNSLiveEventDataListener.cpp @@ -90,7 +90,8 @@ SNSLiveEventDataListener::SNSLiveEventDataListener() // Initialize m_keepPausedEvents from the config file. // NOTE: To the best of my knowledge, the existence of this property is not // documented anywhere and this lack of documentation is deliberate. - auto keepPausedEvents = ConfigService::Instance().getValue<bool>("livelistener.keeppausedevents"); + auto keepPausedEvents = + ConfigService::Instance().getValue<bool>("livelistener.keeppausedevents"); // If the property hasn't been set, assume false m_keepPausedEvents = keepPausedEvents.get_value_or(false); diff --git a/Framework/LiveData/test/TestDataListener.cpp b/Framework/LiveData/test/TestDataListener.cpp index 8aa2ae1a3ea..6249e486fae 100644 --- a/Framework/LiveData/test/TestDataListener.cpp +++ b/Framework/LiveData/test/TestDataListener.cpp @@ -30,23 +30,30 @@ TestDataListener::TestDataListener() m_dataReset = false; m_timesCalled = 0; - m_resetAfter = ConfigService::Instance().getValue<int>("testdatalistener.reset_after").get_value_or(0); - m_changeStatusAfter = ConfigService::Instance().getValue<int>("testdatalistener.m_changeStatusAfter").get_value_or(0); - int temp = ConfigService::Instance().getValue<int>("testdatalistener.m_newStatus").get_value_or(0); - + m_resetAfter = ConfigService::Instance() + .getValue<int>("testdatalistener.reset_after") + .get_value_or(0); + m_changeStatusAfter = + ConfigService::Instance() + .getValue<int>("testdatalistener.m_changeStatusAfter") + .get_value_or(0); + int temp = ConfigService::Instance() + .getValue<int>("testdatalistener.m_newStatus") + .get_value_or(0); + switch (temp) { case 0: - m_newStatus = ILiveListener::NoRun; - break; + m_newStatus = ILiveListener::NoRun; + break; case 1: - m_newStatus = ILiveListener::BeginRun; - break; + m_newStatus = ILiveListener::BeginRun; + break; case 2: - m_newStatus = ILiveListener::Running; - break; + m_newStatus = ILiveListener::Running; + break; case 4: - m_newStatus = ILiveListener::EndRun; - break; + m_newStatus = ILiveListener::EndRun; + break; } } diff --git a/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp b/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp index 2ae53830806..cfcbeb8b26a 100644 --- a/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp +++ b/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp @@ -1384,7 +1384,8 @@ void ScriptRepositoryImpl::doDownloadFile(const std::string &url_file, // Configure Poco HTTP Client Session try { Kernel::InternetHelper inetHelper; - auto timeoutConfigVal = ConfigService::Instance().getValue<int>("network.scriptrepo.timeout"); + auto timeoutConfigVal = + ConfigService::Instance().getValue<int>("network.scriptrepo.timeout"); int timeout = timeoutConfigVal.get_value_or(DEFAULT_TIMEOUT_SEC); inetHelper.setTimeout(timeout); diff --git a/MantidPlot/src/ProjectRecovery.cpp b/MantidPlot/src/ProjectRecovery.cpp index 4b5c208cc34..ad07750ac2b 100644 --- a/MantidPlot/src/ProjectRecovery.cpp +++ b/MantidPlot/src/ProjectRecovery.cpp @@ -43,7 +43,7 @@ boost::optional<T> getConfigValue(const std::string &key) { } boost::optional<bool> getConfigBool(const std::string &key) { - return Mantid::Kernel::ConfigService::Instance().getValue<bool>(key); + return Mantid::Kernel::ConfigService::Instance().getValue<bool>(key); } /// Returns a string to the current top level recovery folder diff --git a/qt/widgets/sliceviewer/src/QPeaksTableModel.cpp b/qt/widgets/sliceviewer/src/QPeaksTableModel.cpp index 676c47f219a..72737bd43eb 100644 --- a/qt/widgets/sliceviewer/src/QPeaksTableModel.cpp +++ b/qt/widgets/sliceviewer/src/QPeaksTableModel.cpp @@ -35,8 +35,10 @@ static QString v3dAsString(const Mantid::Kernel::V3D &v3d) { * @returns :: number of decimals to round displayed HKL values to. */ static int getHKLPrecision() { - auto hklPrecConfigVal = Mantid::Kernel::ConfigService::Instance().getValue<int>("PeakColumn.hklPrec"); - int hklPrec = hklPrecConfigVal.get_value_or(2); + auto hklPrecConfigVal = + Mantid::Kernel::ConfigService::Instance().getValue<int>( + "PeakColumn.hklPrec"); + int hklPrec = hklPrecConfigVal.get_value_or(2); return hklPrec; } diff --git a/qt/widgets/sliceviewer/src/SliceViewer.cpp b/qt/widgets/sliceviewer/src/SliceViewer.cpp index fe48ae135be..9247d7cf592 100644 --- a/qt/widgets/sliceviewer/src/SliceViewer.cpp +++ b/qt/widgets/sliceviewer/src/SliceViewer.cpp @@ -101,7 +101,9 @@ SliceViewer::SliceViewer(QWidget *parent) ui.setupUi(this); std::string enableNonOrthogonal; - auto nonOrthogonalDefaultValue = Kernel::ConfigService::Instance().getValue<bool>("sliceviewer.nonorthogonal"); + auto nonOrthogonalDefaultValue = + Kernel::ConfigService::Instance().getValue<bool>( + "sliceviewer.nonorthogonal"); m_nonOrthogonalDefault = nonOrthogonalDefaultValue.get_value_or(false); m_inf = std::numeric_limits<double>::infinity(); -- GitLab