From: Carsten Niehaus Date: Tue, 4 Mar 2008 16:01:50 +0000 (+0000) Subject: Commit just to be able to resync X-Git-Tag: v4.0.71~30 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=61f6f9732978891aa77eeedac209e6c0be23c35f;p=libqmvoc.git Commit just to be able to resync svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=782222 --- diff --git a/libscience/chemicaldataobject.h b/libscience/chemicaldataobject.h index 5e60214..c844339 100644 --- a/libscience/chemicaldataobject.h +++ b/libscience/chemicaldataobject.h @@ -96,7 +96,7 @@ class SCIENCE_EXPORT ChemicalDataObject pm/**< picometer */, y/**< years */, s/**< seconds */, - ang/**< angstrom */, + ang/**< angstrom */, noUnit/**< no unit */ }; diff --git a/libscience/isotopeparser.cpp b/libscience/isotopeparser.cpp index e082065..6762146 100644 --- a/libscience/isotopeparser.cpp +++ b/libscience/isotopeparser.cpp @@ -132,15 +132,21 @@ bool IsotopeParser::startElement(const QString&, const QString &localName, const else if (attrs.value(i) == "bo:halfLife"){ for (int i = 0; i < attrs.length(); ++i) { - if ( attrs.localName( i ) == "unit" ) - { - d->currentDataObject.setUnit( d->currentUnit ); - } - else - { - d->currentUnit = ChemicalDataObject::noUnit; + qDebug() << attrs.localName( i ); + if (attrs.localName(i) == "units") { + if ( attrs.value(i) == "siUnits:s" ) + { + d->currentUnit = ChemicalDataObject::s; + } + else if ( attrs.value(i) == "siUnits:y" ) + { + d->currentUnit = ChemicalDataObject::y; + } else { + d->currentUnit = ChemicalDataObject::noUnit; + } } } + d->currentDataObject.setUnit( d->currentUnit ); d->inHalfLife = true; } else if (attrs.value(i) == "bo:alphaDecay") diff --git a/libscience/tests/isotopereadingtest.cpp b/libscience/tests/isotopereadingtest.cpp index cba651f..5c89846 100644 --- a/libscience/tests/isotopereadingtest.cpp +++ b/libscience/tests/isotopereadingtest.cpp @@ -19,7 +19,7 @@ #include "isotopeparser.h" #include "isotope.h" -#include +#include #include int main(int argc, char *argv[]) @@ -40,15 +40,17 @@ int main(int argc, char *argv[]) QList v = parser->getIsotopes(); - kDebug() << "Found " << v.count() << " isotopes.";; + qDebug() << "Found " << v.count() << " isotopes.";; - kDebug() << "As a test I am now issuing all isotopes with 50 nuclueons: "; + qDebug() << "As a test I am now issuing all isotopes with 50 nuclueons: "; foreach( Isotope* i, v ){ if ( i ) { - if (i->nucleons() == 50 ) - kDebug() << " Isotope of " << i->parentElementSymbol() << " with a mass of " << i->mass(); + if (i->nucleons() == 50 ){ + qDebug() << " Isotope of " << i->parentElementSymbol() << " with a mass of " << i->mass(); + qDebug() << " Halflife: " << i->halflife() << i->halflifeObject().unitAsString( ); + } } }