#5147 RimWellLogFile::m_fileName ->FilePath

This commit is contained in:
Jacob Støren
2019-12-11 08:38:31 +01:00
parent 7f1ccc0169
commit b1942e0844
2 changed files with 13 additions and 13 deletions

View File

@@ -151,9 +151,9 @@ bool RimWellLogFile::readFile( QString* errorMessage )
m_wellLogDataFile = new RigWellLogFile;
}
m_name = QFileInfo( m_fileName ).fileName();
m_name = QFileInfo( m_fileName().path() ).fileName();
if ( !m_wellLogDataFile->open( m_fileName, errorMessage ) )
if ( !m_wellLogDataFile->open( m_fileName().path(), errorMessage ) )
{
m_wellLogDataFile = nullptr;
return false;
@@ -242,15 +242,15 @@ bool RimWellLogFile::hasFlowData() const
//--------------------------------------------------------------------------------------------------
void RimWellLogFile::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
{
bool foundFile = false;
std::vector<QString> searchedPaths;
QString fileNameCandidate =
RimTools::relocateFile( m_fileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
if ( foundFile )
{
m_fileName = fileNameCandidate;
}
// bool foundFile = false;
// std::vector<QString> searchedPaths;
//
// QString fileNameCandidate =
// RimTools::relocateFile( m_fileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
// if ( foundFile )
// {
// m_fileName = fileNameCandidate;
// }
}
//--------------------------------------------------------------------------------------------------

View File

@@ -51,7 +51,7 @@ public:
void setFileName( const QString& fileName );
QString fileName() const
{
return m_fileName;
return m_fileName().path();
}
QString name() const
{
@@ -109,7 +109,7 @@ private:
private:
cvf::ref<RigWellLogFile> m_wellLogDataFile;
caf::PdmField<QString> m_wellName;
caf::PdmField<QString> m_fileName;
caf::PdmField<caf::FilePath> m_fileName;
caf::PdmField<QString> m_name;
caf::PdmField<QDateTime> m_date;
bool m_lasFileHasValidDate;