comparison base/Layer.cpp @ 6:44bbf5793d84

* Rework handling of layer properties in file I/O -- we now get the individual layers to load and save them rather than doing it via generic property lists in the base class, so as to ensure we read and write meaningful values rather than generic int values requiring conversion.
author Chris Cannam
date Thu, 19 Jan 2006 12:54:38 +0000
parents 31c4ed2d5da6
children f67ddc287bc3
comparison
equal deleted inserted replaced
5:31c4ed2d5da6 6:44bbf5793d84
39 { 39 {
40 QString s; 40 QString s;
41 41
42 s += indent; 42 s += indent;
43 43
44 s += QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5>\n") 44 s += QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5/>\n")
45 .arg(LayerFactory::instance()->getLayerTypeName 45 .arg(LayerFactory::instance()->getLayerTypeName
46 (LayerFactory::instance()->getLayerType(this))) 46 (LayerFactory::instance()->getLayerType(this)))
47 .arg(getObjectExportId(this)) 47 .arg(getObjectExportId(this))
48 .arg(objectName()) 48 .arg(objectName())
49 .arg(getObjectExportId(getModel())) 49 .arg(getObjectExportId(getModel()))
50 .arg(extraAttributes); 50 .arg(extraAttributes);
51
52 PropertyList properties = getProperties();
53
54 for (PropertyList::const_iterator i = properties.begin();
55 i != properties.end(); ++i) {
56
57 int pv = getPropertyRangeAndValue(*i, 0, 0);
58 s += indent + "";
59 s += QString("<property name=\"%1\" value=\"%2\"/>\n").arg(*i).arg(pv);
60 }
61
62 s += indent + "</layer>\n";
63 51
64 return s; 52 return s;
65 } 53 }
66 54
67 #ifdef INCLUDE_MOCFILES 55 #ifdef INCLUDE_MOCFILES