From bdcd256fcdb801ab0c8023a1ab8fb7838b9fee46 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 15 Sep 2023 11:06:18 +0200 Subject: [PATCH] Fix Import Summary Cases Recursively Make sure that the loaded summary cases are added to the project. --- .../Commands/RicImportSummaryCasesFeature.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ApplicationLibCode/Commands/RicImportSummaryCasesFeature.cpp b/ApplicationLibCode/Commands/RicImportSummaryCasesFeature.cpp index 68b26f96a6..8f43fe16b6 100644 --- a/ApplicationLibCode/Commands/RicImportSummaryCasesFeature.cpp +++ b/ApplicationLibCode/Commands/RicImportSummaryCasesFeature.cpp @@ -72,13 +72,11 @@ void RicImportSummaryCasesFeature::onActionTriggered( bool isChecked ) QStringList fileNames = result.files; RiaDefines::FileType fileType = RicRecursiveFileSearchDialog::mapSummaryFileType( result.fileType ); - std::vector cases; + if ( fileNames.isEmpty() ) return; - if ( !fileNames.isEmpty() ) - { - CreateConfig createConfig{ .fileType = fileType, .ensembleOrGroup = false, .allowDialogs = true }; - auto [isOk, cases] = createSummaryCasesFromFiles( fileNames, createConfig ); - } + CreateConfig createConfig{ .fileType = fileType, .ensembleOrGroup = false, .allowDialogs = true }; + auto [isOk, cases] = createSummaryCasesFromFiles( fileNames, createConfig ); + if ( !isOk ) return; addSummaryCases( cases ); if ( !cases.empty() )