mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve fault reactivation file names (#11005)
Use model name in exported file name. Add model name to include file names.
This commit is contained in:
@@ -376,3 +376,22 @@ bool RiaFilePathTools::isFirstOlderThanSecond( const std::string& firstFileName,
|
||||
|
||||
return ( timeFirstFile < timeSecondFile );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RiaFilePathTools::makeSuitableAsFileName( const std::string candidateName )
|
||||
{
|
||||
if ( candidateName.empty() ) return "noname";
|
||||
|
||||
QString tmp = QString::fromStdString( candidateName );
|
||||
|
||||
tmp.replace( ' ', '_' );
|
||||
tmp.replace( '/', '_' );
|
||||
tmp.replace( '\\', '_' );
|
||||
tmp.replace( ':', '_' );
|
||||
tmp.replace( '&', '_' );
|
||||
tmp.replace( '|', '_' );
|
||||
|
||||
return tmp.toStdString();
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
static QString removeDuplicatePathSeparators( const QString& path );
|
||||
static QString rootSearchPathFromSearchFilter( const QString& searchFilter );
|
||||
static QString commonRootOfFileNames( const QStringList& filePaths );
|
||||
static std::string makeSuitableAsFileName( const std::string candidateName );
|
||||
|
||||
static QStringList splitPathIntoComponents( const QString& path, bool splitExtensionIntoSeparateEntry = false );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user