From 7f9cab5300fe9f55accb3d1eb0fcde9741fb7e5d Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Tue, 22 Sep 2020 15:00:27 +0200 Subject: [PATCH] Simplify ensemble case naming --- .../ProjectDataModel/Summary/RimSummaryCase.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.cpp index 99f0674aeb..bf4475c315 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.cpp @@ -36,7 +36,7 @@ #include #include -#define SUMMARY_CASE_SHORT_NAME_LENGTH 6 // TODO: Could make this a preference if required. +#define SUMMARY_CASE_SHORT_NAME_LENGTH 4 // TODO: Could make this a preference if required. CAF_PDM_ABSTRACT_SOURCE_INIT( RimSummaryCase, "SummaryCase" ); namespace caf @@ -329,14 +329,11 @@ QString RimSummaryCase::uniqueShortNameForEnsembleCase( RimSummaryCase* summaryC for ( auto keyComponent : keyFileComponents ) { QStringList subComponents; - QString numberGroup = numberRe.match( keyComponent ).captured(); - int numberGroupAndDelimiterLength = numberGroup.length() + 1; + QString numberGroup = numberRe.match( keyComponent ).captured(); if ( !numberGroup.isEmpty() ) { keyComponent = keyComponent.replace( numberGroup, "" ); - - QString stem = - keyComponent.left( std::max( 1, SUMMARY_CASE_SHORT_NAME_LENGTH - numberGroupAndDelimiterLength ) ); + QString stem = keyComponent.left( SUMMARY_CASE_SHORT_NAME_LENGTH ); if ( !stem.isEmpty() ) subComponents.push_back( stem ); subComponents.push_back( numberGroup ); }