Mercurial > hg > svgui
comparison layer/Layer.cpp @ 363:6167a28d25fc sv1-v1.2pre3
* line up overview widget nicely with main pane (at least on first startup)
* fix #1878396 renaming layer seems to have no visible effect
* comment out some debug output
author | Chris Cannam |
---|---|
date | Wed, 06 Feb 2008 17:40:53 +0000 |
parents | d58701996fae |
children | e1a9e478b7f2 |
comparison
equal
deleted
inserted
replaced
362:a9dfa2d6d5ac | 363:6167a28d25fc |
---|---|
66 { | 66 { |
67 return LayerFactory::getInstance()->getLayerIconName | 67 return LayerFactory::getInstance()->getLayerIconName |
68 (LayerFactory::getInstance()->getLayerType(this)); | 68 (LayerFactory::getInstance()->getLayerType(this)); |
69 } | 69 } |
70 | 70 |
71 void | |
72 Layer::setPresentationName(QString name) | |
73 { | |
74 m_presentationName = name; | |
75 } | |
76 | |
71 QString | 77 QString |
72 Layer::getLayerPresentationName() const | 78 Layer::getLayerPresentationName() const |
73 { | 79 { |
74 // QString layerName = objectName(); | 80 if (m_presentationName != "") return m_presentationName; |
75 | 81 |
76 LayerFactory *factory = LayerFactory::getInstance(); | 82 LayerFactory *factory = LayerFactory::getInstance(); |
77 QString layerName = factory->getLayerPresentationName | 83 QString layerName = factory->getLayerPresentationName |
78 (factory->getLayerType(this)); | 84 (factory->getLayerType(this)); |
79 | 85 |
586 Layer::toXml(QTextStream &stream, | 592 Layer::toXml(QTextStream &stream, |
587 QString indent, QString extraAttributes) const | 593 QString indent, QString extraAttributes) const |
588 { | 594 { |
589 stream << indent; | 595 stream << indent; |
590 | 596 |
597 if (m_presentationName != "") { | |
598 extraAttributes = QString("%1 presentationName=\"%2\"") | |
599 .arg(extraAttributes).arg(encodeEntities(m_presentationName)); | |
600 } | |
601 | |
591 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5") | 602 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5") |
592 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName | 603 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName |
593 (LayerFactory::getInstance()->getLayerType(this)))) | 604 (LayerFactory::getInstance()->getLayerType(this)))) |
594 .arg(getObjectExportId(this)) | 605 .arg(getObjectExportId(this)) |
595 .arg(encodeEntities(objectName())) | 606 .arg(encodeEntities(objectName())) |
615 Layer::toBriefXml(QTextStream &stream, | 626 Layer::toBriefXml(QTextStream &stream, |
616 QString indent, QString extraAttributes) const | 627 QString indent, QString extraAttributes) const |
617 { | 628 { |
618 stream << indent; | 629 stream << indent; |
619 | 630 |
631 if (m_presentationName != "") { | |
632 extraAttributes = QString("%1 presentationName=\"%2\"") | |
633 .arg(extraAttributes).arg(encodeEntities(m_presentationName)); | |
634 } | |
635 | |
620 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5/>\n") | 636 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5/>\n") |
621 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName | 637 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName |
622 (LayerFactory::getInstance()->getLayerType(this)))) | 638 (LayerFactory::getInstance()->getLayerType(this)))) |
623 .arg(getObjectExportId(this)) | 639 .arg(getObjectExportId(this)) |
624 .arg(encodeEntities(objectName())) | 640 .arg(encodeEntities(objectName())) |