# HG changeset patch # User Chris Cannam # Date 1406298141 -3600 # Node ID a4c2a4685cf17c199085f6fb1db10591bbd3560a # Parent 105b4e237434518f2ae7cbe2ddf81492133b5846 Debug out diff -r 105b4e237434 -r a4c2a4685cf1 framework/Document.cpp --- a/framework/Document.cpp Thu Jul 24 17:43:49 2014 +0100 +++ b/framework/Document.cpp Fri Jul 25 15:22:21 2014 +0100 @@ -565,6 +565,7 @@ } if (m_autoAlignment) { + SVDEBUG << "Document::setMainModel: auto-alignment is on, aligning model if possible" << endl; alignModel(m_mainModel); } @@ -641,7 +642,12 @@ cerr << endl; #endif - if (m_autoAlignment) alignModel(model); + if (m_autoAlignment) { + SVDEBUG << "Document::addImportedModel: auto-alignment is on, aligning model if possible" << endl; + alignModel(model); + } else { + SVDEBUG << "Document(" << this << "): addImportedModel: auto-alignment is off" << endl; + } emit modelAdded(model); } @@ -671,7 +677,10 @@ cerr << endl; #endif - if (m_autoAlignment) alignModel(model); + if (m_autoAlignment) { + SVDEBUG << "Document::addAdditionalModel: auto-alignment is on, aligning model if possible" << endl; + alignModel(model); + } emit modelAdded(model); } @@ -1044,14 +1053,22 @@ void Document::alignModel(Model *model) { - if (!m_mainModel) return; + SVDEBUG << "Document::alignModel(" << model << ")" << endl; + + if (!m_mainModel) { + SVDEBUG << "(no main model to align to)" << endl; + return; + } RangeSummarisableTimeValueModel *rm = dynamic_cast(model); - if (!rm) return; + if (!rm) { + SVDEBUG << "(main model is not alignable-to)" << endl; + return; + } if (rm->getAlignmentReference() == m_mainModel) { - SVDEBUG << "Document::alignModel: model " << rm << " is already aligned to main model " << m_mainModel << endl; + SVDEBUG << "(model " << rm << " is already aligned to main model " << m_mainModel << ")" << endl; return; }