ChemicalDataObject::BlueObeliskUnit ChemicalDataObject::unit( const QString& unit )
{
- if ( unit == "bo:kelvin" )
- return ChemicalDataObject::kelvin;
- else if ( unit == "bo:ev" )
- return ChemicalDataObject::ev;
- else if ( unit == "bo:nm" )
- return ChemicalDataObject::nm;
- else if ( unit == "bo:pm" )
- return ChemicalDataObject::pm;
- else if ( unit == "bo:y" )
- return ChemicalDataObject::y;
- else if ( unit == "bo:s" )
- return ChemicalDataObject::s;
- else if ( unit == "bo:noUnit" )
- return ChemicalDataObject::noUnit;
- else
- return ChemicalDataObject::noUnit;
+ if ( unit == "siUnits:kelvin" )
+ return ChemicalDataObject::kelvin;
+ else if ( unit == "units:ev" )
+ return ChemicalDataObject::ev;
+ else if ( unit == "units:ang" )
+ return ChemicalDataObject::ang;
+ else if ( unit == "bo:noUnit" )
+ return ChemicalDataObject::noUnit;
+ else
+ return ChemicalDataObject::noUnit;
}
{
for (int i = 0; i < attrs.length(); ++i)
{
- if ( attrs.localName( i ) == "unit" )
+ if ( attrs.localName( i ) == "units" )
{
+ //kDebug() << "value of the unit: " << attrs.value(i) << endl;
d->currentUnit = ChemicalDataObject::unit( attrs.value( i ) );
+ //kDebug() << "Took " << d->currentUnit << endl;
continue;
}
}
else if ( localName == "scalar" || localName == "label" || localName == "array" )
{
- if ( d->currentUnit != ChemicalDataObject::noUnit )
- d->currentDataObject->setUnit( d->currentUnit );
-
- d->currentUnit = ChemicalDataObject::noUnit;
+ //kDebug() << "Check unit " << d->currentUnit << endl;
+ d->currentDataObject->setUnit( d->currentUnit );
}
return true;
}