comparison framework/SVFileReader.cpp @ 220:0b1886cee2cf templating

Merge from default branch
author Chris Cannam
date Wed, 27 Apr 2011 11:33:48 +0100
parents fe83e6e68683
children 67cea66bd588
comparison
equal deleted inserted replaced
210:143e1b56e81b 220:0b1886cee2cf
410 } 410 }
411 } 411 }
412 412
413 for (std::set<Model *>::iterator i = unaddedModels.begin(); 413 for (std::set<Model *>::iterator i = unaddedModels.begin();
414 i != unaddedModels.end(); ++i) { 414 i != unaddedModels.end(); ++i) {
415 m_document->addImportedModel(*i); 415 Model *model = *i;
416 m_addedModels.insert(*i); 416 // don't want to add these models, because their lifespans
417 // are entirely dictated by the models that "own" them even
418 // though they were read independently from the .sv file.
419 // (pity we don't have a nicer way)
420 if (!dynamic_cast<PathModel *>(model) &&
421 !dynamic_cast<AlignmentModel *>(model)) {
422 m_document->addImportedModel(model);
423 }
424 // but we add all models here, so they don't get deleted
425 // when the file loader is destroyed
426 m_addedModels.insert(model);
417 } 427 }
418 } 428 }
419 429
420 bool 430 bool
421 SVFileReader::readModel(const QXmlAttributes &attributes) 431 SVFileReader::readModel(const QXmlAttributes &attributes)