#10320 Ensemble Summary Import: wrong realization name when importing single realization

This commit is contained in:
Kristian Bendiksen 2023-05-31 10:45:07 +02:00
parent 0e25f364f8
commit 06d107c4e6

View File

@ -382,8 +382,10 @@ QString RiaEnsembleNameTools::findCommonBaseName( const QStringList& fileNames )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RiaEnsembleNameTools::uniqueShortName( const QString& sourceFileName, const QStringList& allFileNames, const QString& ensembleCaseName ) QString RiaEnsembleNameTools::uniqueShortName( const QString& sourceFileName, const QStringList& allFileNames, const QString& ensembleCaseName )
{ {
std::map<QString, QStringList> keyFileComponentsForAllFiles = RiaFilePathTools::keyPathComponentsForEachFilePath( allFileNames ); // Handle ensemble with only one realizations separately.
if ( allFileNames.size() == 1 ) return ensembleCaseName;
std::map<QString, QStringList> keyFileComponentsForAllFiles = RiaFilePathTools::keyPathComponentsForEachFilePath( allFileNames );
return uniqueShortNameFromComponents( sourceFileName, keyFileComponentsForAllFiles, ensembleCaseName ); return uniqueShortNameFromComponents( sourceFileName, keyFileComponentsForAllFiles, ensembleCaseName );
} }