Add debug output to pinpoint strange path origin

This commit is contained in:
Jacob Støren 2020-03-31 11:20:01 +02:00
parent 773fa0fcd5
commit 8167167bc9

View File

@ -1538,6 +1538,40 @@ private:
std::map<QString, QString> m_oldPathToPathIdMap;
};
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void reportOnStrangePath( caf::PdmObjectHandle* object )
{
if ( !object ) return;
std::vector<caf::PdmField<caf::FilePath>*> fields;
std::vector<caf::PdmFieldHandle*> allFieldsInObject;
object->fields( allFieldsInObject );
std::vector<caf::PdmObjectHandle*> children;
for ( const auto& field : allFieldsInObject )
{
caf::PdmField<caf::FilePath>* typedField = dynamic_cast<caf::PdmField<caf::FilePath>*>( field );
if ( typedField && ( ( *typedField )().path() == "/private/hhgs" ) )
{
fields.push_back( typedField );
std::cout << "Found path: " << typedField->ownerObject()->xmlCapability()->classKeyword().toStdString()
<< "." << typedField->keyword().toStdString() << ": " << ( *typedField )().path().toStdString()
<< std::endl;
}
field->childObjects( &children );
}
for ( const auto& child : children )
{
reportOnStrangePath( child );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -1545,6 +1579,8 @@ void RimProject::transferPathsToGlobalPathList()
{
GlobalPathListMapper pathListMapper( m_globalPathList() );
reportOnStrangePath( this );
std::vector<caf::FilePath*> filePaths;
fieldContentsByType( this, filePaths );