From 6de145ef509783252f2966ea21f69457cde435d3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 8 Oct 2025 11:18:19 +0200 Subject: [PATCH] #12996 Resdata: Prefer UNRST over FUNRST --- .../FileInterface/RifEclipseOutputFileTools.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/FileInterface/RifEclipseOutputFileTools.cpp b/ApplicationLibCode/FileInterface/RifEclipseOutputFileTools.cpp index 846b5b0fdb..b537e3fad3 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseOutputFileTools.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseOutputFileTools.cpp @@ -518,9 +518,18 @@ cvf::ref RifEclipseOutputFileTools::createDynamicRe cvf::ref resultsAccess; // Look for unified restart file - QString unrstFileName = RifEclipseOutputFileTools::firstFileNameOfType( filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE ); - if ( unrstFileName.size() > 0 ) + auto unrstFileNames = RifEclipseOutputFileTools::filterFileNamesOfType( filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE ); + if ( !unrstFileNames.empty() ) { + QString unrstFileName = unrstFileNames.front(); + if ( unrstFileNames.size() > 1 ) + { + for ( const auto& candidate : unrstFileNames ) + { + if ( candidate.endsWith( ".UNRST" ) ) unrstFileName = candidate; + } + } + resultsAccess = new RifEclipseUnifiedRestartFileAccess(); resultsAccess->setRestartFiles( QStringList( unrstFileName ) ); }