Mercurial > hg > tony
diff src/Analyser.cpp @ 446:abd0dea16584
When loading a session, do not import any layers for which the identified models can't be found
author | Chris Cannam |
---|---|
date | Tue, 31 Mar 2015 17:46:46 +0100 |
parents | 692852208b6c |
children | 7665cc683dd1 |
line wrap: on
line diff
--- a/src/Analyser.cpp Tue Mar 31 17:27:28 2015 +0100 +++ b/src/Analyser.cpp Tue Mar 31 17:46:46 2015 +0100 @@ -77,6 +77,8 @@ m_paneStack = paneStack; m_pane = pane; + if (!m_fileModel) return "Internal error: Analyser::newFileLoaded() called with no model present"; + connect(doc, SIGNAL(layerAboutToBeDeleted(Layer *)), this, SLOT(layerAboutToBeDeleted(Layer *))); @@ -95,6 +97,8 @@ if (!m_pane) return "Internal error: Analyser::analyseExistingFile() called with no pane present"; + if (!m_fileModel) return "Internal error: Analyser::analyseExistingFile() called with no model present"; + if (m_layers[PitchTrack]) { m_document->removeLayerFromView(m_pane, m_layers[PitchTrack]); m_layers[PitchTrack] = 0; @@ -225,6 +229,8 @@ QString Analyser::addVisualisations() { + if (!m_fileModel) return "Internal error: Analyser::addVisualisations() called with no model present"; + // A spectrogram, off by default. Must go at the back because it's // opaque