From f053dfa8e33e583cceefc7d2564cbe09fa27cd4c Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 8 Feb 2018 13:17:18 +0100 Subject: [PATCH] #2446 : Snapshot : Improve generated file, always use _ in generated filename --- .../ExportCommands/RicSnapshotFilenameGenerator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotFilenameGenerator.cpp b/ApplicationCode/Commands/ExportCommands/RicSnapshotFilenameGenerator.cpp index 30edda7a76..37128b6591 100644 --- a/ApplicationCode/Commands/ExportCommands/RicSnapshotFilenameGenerator.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotFilenameGenerator.cpp @@ -68,8 +68,10 @@ QString RicSnapshotFilenameGenerator::generateSnapshotFilenameForRimView(RimView .arg(rimView->name()) .arg(resultName(rimView)); - if ( timeSteps.size() ) fileName += QString("_%1_%2").arg(timeStep, 2, 10, QChar('0')) - .arg(timeSteps[timeStep].replace(".", "-")); + if ( !timeSteps.empty() ) fileName += QString("_%1_%2").arg(timeStep, 2, 10, QChar('0')) + .arg(timeSteps[timeStep]); + + fileName.replace("-", "_"); fileName = caf::Utils::makeValidFileBasename(fileName);