Move updatedFilePathFromPathId() to private

File paths are now updated in initAfterRead()
This commit is contained in:
Magne Sjaastad 2024-06-05 09:32:44 +02:00
parent a952fbce7e
commit beccd2454e
3 changed files with 5 additions and 8 deletions

View File

@ -111,8 +111,7 @@ void RimAnnotationCollection::initAfterRead()
RimPolygonFile* newPoly = new RimPolygonFile();
newPoly->setName( oldPoly->uiName() );
QString fileName = RimProject::current()->updatedFilePathFromPathId( oldPoly->fileName() );
newPoly->setFileName( fileName );
newPoly->setFileName( oldPoly->fileName() );
polycoll->addPolygonFile( newPoly );
}

View File

@ -194,7 +194,6 @@ public:
RimPlotTemplateFolderItem* rootPlotTemplateItem() const;
std::vector<caf::FilePath*> allFilePaths() const;
QString updatedFilePathFromPathId( QString filePath, RiaVariableMapper* pathListMapper = nullptr ) const;
protected:
void beforeInitAfterRead() override;
@ -206,6 +205,7 @@ protected:
private:
void transferPathsToGlobalPathList();
void distributePathsFromGlobalPathList();
QString updatedFilePathFromPathId( QString filePath, RiaVariableMapper* pathListMapper = nullptr ) const;
private:
caf::PdmChildField<RimMainPlotCollection*> m_mainPlotCollection;

View File

@ -871,12 +871,10 @@ void RimVfpPlot::initAfterRead()
auto filePath = m_filePath_OBSOLETE.v().path();
if ( filePath.isEmpty() ) return;
QString fileName = RimProject::current()->updatedFilePathFromPathId( filePath );
auto vfpDataCollection = RimVfpDataCollection::instance();
if ( vfpDataCollection )
{
auto tableData = vfpDataCollection->appendTableDataObject( fileName );
auto tableData = vfpDataCollection->appendTableDataObject( filePath );
if ( tableData )
{
setDataSource( tableData );