]> Git trees. - libqmvoc.git/commitdiff
Commit just to be able to resync
authorCarsten Niehaus <cniehaus@gmx.de>
Tue, 4 Mar 2008 16:01:50 +0000 (16:01 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Tue, 4 Mar 2008 16:01:50 +0000 (16:01 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=782222

libscience/chemicaldataobject.h
libscience/isotopeparser.cpp
libscience/tests/isotopereadingtest.cpp

index 5e6021451ef1f474f6cd0dc812e5b9723aac9829..c8443395732623ec9e519c54eacfb6c3635251bd 100644 (file)
@@ -96,7 +96,7 @@ class SCIENCE_EXPORT ChemicalDataObject
                        pm/**< picometer */,
                        y/**< years */,
                        s/**< seconds */,
-      ang/**< angstrom */,
+                        ang/**< angstrom */,
                        noUnit/**< no unit */
                };
 
index e082065a0a4f1e296ed4fb30020b10a65cf30363..676214621167f52dab1c7ec4254eb01f9b54cb11 100644 (file)
@@ -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")
index cba651f09a706635ee8d819760c6319e2ea5938a..5c89846aed4dfe86d8fb6647aca005a83f1cec2a 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "isotopeparser.h"
 #include "isotope.h"
-#include <kdebug.h>
+#include <QDebug>
 #include <iostream>
 
 int main(int argc, char *argv[])
@@ -40,15 +40,17 @@ int main(int argc, char *argv[])
 
     QList<Isotope*> 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( );
+            }
         }
     }