# HG changeset patch # User Chris Cannam # Date 1429521026 -3600 # Node ID dc1a360f2b694d73d4bc858b708db44249e2cddc # Parent 12d982e52190ded18b3b3560ea7f2883ef8667fb Allow layers to be loaded without models if their layer class explicitly says it's OK (otherwise default template won't load, as it has an empty waveform layer) diff -r 12d982e52190 -r dc1a360f2b69 framework/SVFileReader.cpp --- a/framework/SVFileReader.cpp Mon Apr 20 09:21:08 2015 +0100 +++ b/framework/SVFileReader.cpp Mon Apr 20 10:10:26 2015 +0100 @@ -886,12 +886,14 @@ } else { cerr << "WARNING: SV-XML: Unknown model id " << modelId << " in layer definition" << endl; - - // Don't add a layer with an unknown model id - m_document->deleteLayer(layer); - m_layers[id] = layer = 0; - return false; - } + if (!layer->canExistWithoutModel()) { + // Don't add a layer with an unknown model id + // unless it explicitly supports this state + m_document->deleteLayer(layer); + m_layers[id] = layer = 0; + return false; + } + } } if (layer) layer->setProperties(attributes);