diff --git a/Framework/Kernel/inc/MantidKernel/DataService.h b/Framework/Kernel/inc/MantidKernel/DataService.h index bac8582716277ae1434cb717520778095ecc8688..3d6de5faf49853b46c7b000922b295f1dc3808d4 100644 --- a/Framework/Kernel/inc/MantidKernel/DataService.h +++ b/Framework/Kernel/inc/MantidKernel/DataService.h @@ -398,14 +398,13 @@ public: /// Checks all elements within the specified vector exist in the ADS bool doAllWsExist(const std::vector<std::string> &listOfNames) { - for (const auto &wsName : listOfNames) { - if (!doesExist(wsName)) - return false; - } - return true; + for (const auto &wsName : listOfNames) { + if (!doesExist(wsName)) + return false; + } + return true; } - /// Check to see if a data object exists in the store bool doesExist(const std::string &name) const { // Make DataService access thread-safe diff --git a/Framework/Kernel/test/DataServiceTest.h b/Framework/Kernel/test/DataServiceTest.h index 927ba067e56f02146a11b2f52498d33c8e23e2d7..6dfa57de8dd36099f36898365854f1ebd3416ddb 100644 --- a/Framework/Kernel/test/DataServiceTest.h +++ b/Framework/Kernel/test/DataServiceTest.h @@ -230,49 +230,48 @@ public: } void test_does_all_exist() { - auto one = boost::make_shared<int>(1); - auto two = boost::make_shared<int>(2); + auto one = boost::make_shared<int>(1); + auto two = boost::make_shared<int>(2); - const std::string oneName = "one"; - const std::string twoName = "two"; + const std::string oneName = "one"; + const std::string twoName = "two"; - svc.add(oneName, one); - svc.add(twoName, two); + svc.add(oneName, one); + svc.add(twoName, two); - std::vector<std::string> expectedNames{ oneName, twoName }; + std::vector<std::string> expectedNames{oneName, twoName}; - TS_ASSERT(svc.doAllWsExist(expectedNames)); + TS_ASSERT(svc.doAllWsExist(expectedNames)); } void test_does_all_exist_partial() { - auto one = boost::make_shared<int>(1); + auto one = boost::make_shared<int>(1); - const std::string oneName = "one"; + const std::string oneName = "one"; - svc.add(oneName, one); + svc.add(oneName, one); - std::vector<std::string> expectedNames{ oneName }; + std::vector<std::string> expectedNames{oneName}; - TS_ASSERT(svc.doAllWsExist(expectedNames)); + TS_ASSERT(svc.doAllWsExist(expectedNames)); } void test_does_all_exist_missing_ws() { - auto one = boost::make_shared<int>(1); - auto two = boost::make_shared<int>(2); + auto one = boost::make_shared<int>(1); + auto two = boost::make_shared<int>(2); - const std::string oneName = "one"; - const std::string twoName = "two"; - const std::string threeName = "three"; + const std::string oneName = "one"; + const std::string twoName = "two"; + const std::string threeName = "three"; - svc.add(oneName, one); - svc.add(twoName, two); + svc.add(oneName, one); + svc.add(twoName, two); - std::vector<std::string> expectedNames{ oneName, twoName, threeName }; + std::vector<std::string> expectedNames{oneName, twoName, threeName}; - TS_ASSERT(!svc.doAllWsExist(expectedNames)); + TS_ASSERT(!svc.doAllWsExist(expectedNames)); } - void test_size() { TS_ASSERT_EQUALS(svc.size(), 0); svc.add("something", boost::make_shared<int>(-1)); diff --git a/MantidPlot/src/ProjectSerialiser.cpp b/MantidPlot/src/ProjectSerialiser.cpp index decf523673edfdb02f1a28ef779d7353daedb313..1f548c31f82a6dba4cd4bfb404d6e9d931f686a7 100644 --- a/MantidPlot/src/ProjectSerialiser.cpp +++ b/MantidPlot/src/ProjectSerialiser.cpp @@ -721,7 +721,8 @@ void ProjectSerialiser::populateMantidTreeWidget(const QString &lines) { // Check everything was loaded before continuing, as we might need to open a // window // for a workspace which did not load in - if (!Mantid::API::AnalysisDataService::Instance().doAllWsExist(expectedWorkspaces)) { + if (!Mantid::API::AnalysisDataService::Instance().doAllWsExist( + expectedWorkspaces)) { QMessageBox::critical(window, "MantidPlot - Algorithm error", " The workspaces associated with this project " "could not be loaded. Aborting project loading.");