mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #7975 from OPM/7973-custom-export-filename
Export Completions : Custom export file name fails in some cases
This commit is contained in:
@@ -94,6 +94,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
|
||||
return;
|
||||
}
|
||||
|
||||
if ( exportSettings.customFileName().isEmpty() )
|
||||
{
|
||||
QDir folder( exportSettings.folder );
|
||||
if ( !folder.exists() )
|
||||
|
||||
@@ -71,28 +71,43 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions(
|
||||
if ( exportSettings.fileSplit() == RicExportCompletionDataSettingsUi::ExportSplit::UNIFIED_FILE )
|
||||
{
|
||||
{
|
||||
QString fileName;
|
||||
QString fileName;
|
||||
QString folderName;
|
||||
|
||||
QFileInfo fi( exportSettings.customFileName() );
|
||||
if ( !exportSettings.customFileName().isEmpty() )
|
||||
fileName = fi.baseName() + "_MSW";
|
||||
{
|
||||
fileName = fi.baseName();
|
||||
folderName = fi.absolutePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
fileName = QString( "UnifiedCompletions_MSW_%1" ).arg( exportSettings.caseToApply->caseUserDescription() );
|
||||
folderName = exportSettings.folder;
|
||||
}
|
||||
|
||||
unifiedExportFile =
|
||||
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName, fi.suffix() );
|
||||
RicWellPathExportCompletionsFileTools::openFileForExport( folderName, fileName, fi.suffix() );
|
||||
}
|
||||
|
||||
{
|
||||
QString lgrFileName;
|
||||
QString folderName;
|
||||
QFileInfo fi( exportSettings.customFileName() );
|
||||
if ( !exportSettings.customFileName().isEmpty() )
|
||||
{
|
||||
lgrFileName = fi.baseName() + "_LGR_MSW";
|
||||
folderName = fi.absolutePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
lgrFileName =
|
||||
QString( "UnifiedCompletions_LGR_MSW_%1" ).arg( exportSettings.caseToApply->caseUserDescription() );
|
||||
folderName = exportSettings.folder;
|
||||
}
|
||||
|
||||
unifiedLgrExportFile =
|
||||
RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, lgrFileName, fi.suffix() );
|
||||
RicWellPathExportCompletionsFileTools::openFileForExport( folderName, lgrFileName, fi.suffix() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user