From 5d78d1bd971917d50335f172890cf5ac7ab22c4c Mon Sep 17 00:00:00 2001 From: Ross Whitfield Date: Wed, 29 May 2024 14:21:02 +1000 Subject: [PATCH 1/2] Fix bug where all workspaces are excluded in the Elwin interface when "Restrict allowed input files by name" is deselected QStringList{""} is actually creating a list with 1 item that is an empty string instead of creating an empty list. This causes the check ``WorkspaceMultiSelector::hasValidSuffix`` to always return false. --- qt/scientific_interfaces/Inelastic/Common/InterfaceUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/scientific_interfaces/Inelastic/Common/InterfaceUtils.cpp b/qt/scientific_interfaces/Inelastic/Common/InterfaceUtils.cpp index ab4e82b90777..cf766ab6ea80 100644 --- a/qt/scientific_interfaces/Inelastic/Common/InterfaceUtils.cpp +++ b/qt/scientific_interfaces/Inelastic/Common/InterfaceUtils.cpp @@ -102,7 +102,7 @@ QStringList getFBSuffixes(std::string const &interfaceName, std::string const &f QStringList getWSSuffixes(std::string const &interfaceName, std::string const &fileType) { if (!restrictInputDataByName()) { - return QStringList{""}; + return QStringList{}; } return toQStringList(getInterfaceProperty(interfaceName, "WORKSPACE-SUFFIXES", fileType), ","); } From 4b2b5fa94c149915cf54e05340b8fa4f62e08882 Mon Sep 17 00:00:00 2001 From: Ross Whitfield Date: Wed, 29 May 2024 15:15:13 +1000 Subject: [PATCH 2/2] Update test --- .../Inelastic/test/Common/InterfaceUtilsTest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/scientific_interfaces/Inelastic/test/Common/InterfaceUtilsTest.h b/qt/scientific_interfaces/Inelastic/test/Common/InterfaceUtilsTest.h index 14470b5a723c..52823bd168b3 100644 --- a/qt/scientific_interfaces/Inelastic/test/Common/InterfaceUtilsTest.h +++ b/qt/scientific_interfaces/Inelastic/test/Common/InterfaceUtilsTest.h @@ -33,7 +33,7 @@ class InterfaceUtilsTest : public CxxTest::TestSuite { InterfaceUtils::restrictInputDataByName = mockRestrictInputDataByName; // There are many similar functions in the interface, this test will try only one pair of such functions - TS_ASSERT_EQUALS(getResolutionWSSuffixes("Iqt"), QStringList({""})); + TS_ASSERT_EQUALS(getResolutionWSSuffixes("Iqt"), QStringList()); TS_ASSERT_EQUALS(getResolutionFBSuffixes("Iqt"), QStringList({".nxs"})); }