mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5147 RimFormationNames::m_formationNamesFileName -> FilePath
This commit is contained in:
parent
b1942e0844
commit
37b32c4e8a
@ -42,7 +42,7 @@ RimFormationNames::RimFormationNames()
|
||||
{
|
||||
CAF_PDM_InitObject( "Formation Names", ":/Formations16x16.png", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_formationNamesFileName, "FormationNamesFileName", QString( "" ), "File Name", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_formationNamesFileName, "FormationNamesFileName", "File Name", "", "", "" );
|
||||
|
||||
m_formationNamesFileName.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
}
|
||||
@ -92,9 +92,9 @@ void RimFormationNames::setFileName( const QString& fileName )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString& RimFormationNames::fileName()
|
||||
QString RimFormationNames::fileName()
|
||||
{
|
||||
return m_formationNamesFileName();
|
||||
return m_formationNamesFileName().path();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -102,7 +102,7 @@ const QString& RimFormationNames::fileName()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFormationNames::fileNameWoPath()
|
||||
{
|
||||
QFileInfo fnameFileInfo( m_formationNamesFileName() );
|
||||
QFileInfo fnameFileInfo( m_formationNamesFileName().path() );
|
||||
return fnameFileInfo.fileName();
|
||||
}
|
||||
|
||||
@ -142,18 +142,19 @@ void RimFormationNames::updateConnectedViews()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFormationNames::readFormationNamesFile( QString* errorMessage )
|
||||
{
|
||||
QFile dataFile( m_formationNamesFileName() );
|
||||
QFile dataFile( m_formationNamesFileName().path() );
|
||||
|
||||
if ( !dataFile.open( QFile::ReadOnly ) )
|
||||
{
|
||||
if ( errorMessage ) ( *errorMessage ) += "Could not open the File: " + ( m_formationNamesFileName() ) + "\n";
|
||||
if ( errorMessage )
|
||||
( *errorMessage ) += "Could not open the File: " + ( m_formationNamesFileName().path() ) + "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
m_formationNamesData = new RigFormationNames;
|
||||
QTextStream stream( &dataFile );
|
||||
|
||||
QFileInfo fileInfo( m_formationNamesFileName() );
|
||||
QFileInfo fileInfo( m_formationNamesFileName().path() );
|
||||
|
||||
if ( fileInfo.fileName() == RimFormationNames::layerZoneTableFileName() )
|
||||
{
|
||||
@ -170,8 +171,8 @@ void RimFormationNames::readFormationNamesFile( QString* errorMessage )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFormationNames::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
|
||||
{
|
||||
m_formationNamesFileName =
|
||||
RimTools::relocateFile( m_formationNamesFileName(), newProjectPath, oldProjectPath, nullptr, nullptr );
|
||||
// m_formationNamesFileName =
|
||||
// RimTools::relocateFile( m_formationNamesFileName(), newProjectPath, oldProjectPath, nullptr, nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -297,8 +298,9 @@ void RimFormationNames::readFmuFormationNameFile( QTextStream& stream, QString*
|
||||
|
||||
if ( lineStream.status() != QTextStream::Ok )
|
||||
{
|
||||
*errorMessage =
|
||||
QString( "Failed to parse line %1 of '%2'" ).arg( lineNumber ).arg( m_formationNamesFileName() );
|
||||
*errorMessage = QString( "Failed to parse line %1 of '%2'" )
|
||||
.arg( lineNumber )
|
||||
.arg( m_formationNamesFileName().path() );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -36,9 +36,9 @@ public:
|
||||
RimFormationNames();
|
||||
~RimFormationNames() override;
|
||||
|
||||
void setFileName( const QString& fileName );
|
||||
const QString& fileName();
|
||||
QString fileNameWoPath();
|
||||
void setFileName( const QString& fileName );
|
||||
QString fileName();
|
||||
QString fileNameWoPath();
|
||||
|
||||
RigFormationNames* formationNamesData()
|
||||
{
|
||||
@ -63,7 +63,7 @@ private:
|
||||
void readFmuFormationNameFile( QTextStream& stream, QString* errorMessage );
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_formationNamesFileName;
|
||||
caf::PdmField<caf::FilePath> m_formationNamesFileName;
|
||||
|
||||
cvf::ref<RigFormationNames> m_formationNamesData;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user