#6765 Test System : Add flag from regression dialog to invalidate external files

This commit is contained in:
Magne Sjaastad
2020-10-12 13:17:47 +02:00
parent 1204403448
commit c8862ea83c
7 changed files with 71 additions and 12 deletions

View File

@@ -445,9 +445,7 @@ void RimProject::setProjectFileNameAndUpdateDependencies( const QString& project
QFileInfo fileInfoOld( oldProjectFileName );
QString oldProjectPath = fileInfoOld.path();
std::vector<caf::FilePath*> filePaths;
fieldContentsByType( this, filePaths );
std::vector<caf::FilePath*> filePaths = allFilePaths();
for ( caf::FilePath* filePath : filePaths )
{
bool foundFile = false;
@@ -1342,6 +1340,17 @@ RimPlotTemplateFolderItem* RimProject::rootPlotTemlateItem() const
return m_plotTemplateFolderItem;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<caf::FilePath*> RimProject::allFilePaths() const
{
std::vector<caf::FilePath*> filePaths;
fieldContentsByType( this, filePaths );
return filePaths;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1629,9 +1638,7 @@ void RimProject::transferPathsToGlobalPathList()
{
GlobalPathListMapper pathListMapper( m_globalPathList() );
std::vector<caf::FilePath*> filePaths;
fieldContentsByType( this, filePaths );
std::vector<caf::FilePath*> filePaths = allFilePaths();
for ( caf::FilePath* filePath : filePaths )
{
QString path = filePath->path();
@@ -1652,9 +1659,7 @@ void RimProject::distributePathsFromGlobalPathList()
{
GlobalPathListMapper pathListMapper( m_globalPathList() );
std::vector<caf::FilePath*> filePaths;
fieldContentsByType( this, filePaths );
std::vector<caf::FilePath*> filePaths = allFilePaths();
for ( caf::FilePath* filePath : filePaths )
{
QString pathIdCandidate = filePath->path().trimmed();

View File

@@ -190,6 +190,8 @@ public:
RimPlotTemplateFolderItem* rootPlotTemlateItem() const;
std::vector<caf::FilePath*> allFilePaths() const;
protected:
// Overridden methods
void initAfterRead() override;
@@ -199,7 +201,7 @@ protected:
private:
template <typename T>
void fieldContentsByType( caf::PdmObjectHandle* object, std::vector<T*>& fieldContents );
static void fieldContentsByType( const caf::PdmObjectHandle* object, std::vector<T*>& fieldContents );
void transferPathsToGlobalPathList();
void distributePathsFromGlobalPathList();
@@ -233,7 +235,7 @@ private:
///
//--------------------------------------------------------------------------------------------------
template <typename T>
void RimProject::fieldContentsByType( caf::PdmObjectHandle* object, std::vector<T*>& fieldContents )
void RimProject::fieldContentsByType( const caf::PdmObjectHandle* object, std::vector<T*>& fieldContents )
{
if ( !object ) return;