]> Git trees. - libqmvoc.git/commitdiff
some fixes
authorPino Toscano <pino@kde.org>
Mon, 20 Feb 2006 16:54:54 +0000 (16:54 +0000)
committerPino Toscano <pino@kde.org>
Mon, 20 Feb 2006 16:54:54 +0000 (16:54 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=511674

libscience/isotope.cpp
libscience/isotope.h
libscience/isotopeparser.cpp

index 7260899dde527609375911cc87a87c7b1b4dbf4c..883dc8b20c4f2245d55c3b049b965d3535e8360b 100644 (file)
@@ -30,8 +30,8 @@ Isotope::Isotope()
 
 Isotope::Isotope( ChemicalDataObject* mass, ChemicalDataObject* ID )
        : m_parentElementSymbol( 0 ), m_mass( 0 ), m_identifier( 0 ),
-       m_spin( 0 ), m_magmoment( 0 ), m_halflife( 0 ), m_ecdecay( 0 ), m_betaminus( 0 ),
-       m_betaplus( 0 ), m_alpha( 0 )
+       m_spin( 0 ), m_magmoment( 0 ), m_halflife( 0 ), m_ecdecay( 0 ),
+       m_betaplus( 0 ), m_betaminus( 0 ), m_alpha( 0 )
 {
        addData( mass );
        addData( ID );
@@ -61,18 +61,14 @@ void Isotope::addData( ChemicalDataObject* o )
                m_halflife = o;
        
        //FIXME in the future there should be real CDOs. But CDO only supports one datavalue...
-       if ( o->type() == ChemicalDataObject::betaplusDecay || o->type() == ChemicalDataObject::betaminusDecay
-                       || o->type() == ChemicalDataObject::alphaDecay || o->type() == ChemicalDataObject::ecDecay )
-       {
-               if ( o->type() == ChemicalDataObject::betaplusDecay )
-                       m_betaplus = o;
-               if (  o->type() == ChemicalDataObject::betaminusDecay )
-                       m_betaminus = o;
-               if ( o->type() == ChemicalDataObject::alphaDecay )
-                       m_alpha = o;
-               if ( o->type() == ChemicalDataObject::ecDecay )
-                       m_ecdecay = o;
-       }
+       if ( o->type() == ChemicalDataObject::betaplusDecay )
+               m_betaplus = o;
+       else if (  o->type() == ChemicalDataObject::betaminusDecay )
+               m_betaminus = o;
+       else if ( o->type() == ChemicalDataObject::alphaDecay )
+               m_alpha = o;
+       else if ( o->type() == ChemicalDataObject::ecDecay )
+               m_ecdecay = o;
 }
 
 double Isotope::mass() const
index 7720b79a18d325aa1ccaa696a16c04981cae0123..603a7a8b4dd31e5b99f4e4fee4340510b93af49c 100644 (file)
@@ -92,11 +92,6 @@ class Isotope
                        return m_alpha;
                }
        private:
-               ChemicalDataObject* m_ecdecay;
-               ChemicalDataObject* m_betaplus;
-               ChemicalDataObject* m_betaminus; 
-               ChemicalDataObject* m_alpha;
-               
                /**
                 * the symbol of the element the isotope belongs to
                 */
@@ -128,6 +123,11 @@ class Isotope
                ChemicalDataObject* m_halflife;
                
                int m_nucleons;
+
+               ChemicalDataObject* m_ecdecay;
+               ChemicalDataObject* m_betaplus;
+               ChemicalDataObject* m_betaminus; 
+               ChemicalDataObject* m_alpha;
 };
 
 #endif // ISOTOPE_H
index c8b156eeec819cac62b6ca7b459cc9e6baa852f1..565516df092d6a8e461f0b1477ddae476d1d2e03 100644 (file)
@@ -107,29 +107,29 @@ bool IsotopeParser::startElement(const QString&, const QString &localName, const
                        if ( attrs.localName( i ) == "number" )
                                d->currentIsotope->setNucleons( attrs.value( i ).toInt() );
                }
-       } else if (d->inIsotope && localName == "bo:spin") {
+       } else if (d->inIsotope && localName == "spin") {
 //X            kDebug() << "bo:spin" << endl;
                d->inSpin = true;
-       } else if (d->inIsotope && localName == "bo:magneticMoment") {
+       } else if (d->inIsotope && localName == "magmoment") {
 //X            kDebug() << "bo:magneticMoment" << endl;
                d->inMagMoment = true;
-       } else if (d->inIsotope && localName == "bo:halfLife") {
+       } else if (d->inIsotope && localName == "halflife") {
 //X            kDebug() << "bo:halfLife" << endl;
                d->inHalfLife = true;
                if ( d->currentUnit != ChemicalDataObject::noUnit )
                        d->currentDataObject->setUnit( d->currentUnit );
 
                d->currentUnit = ChemicalDataObject::noUnit;
-       } else if (d->inIsotope && localName == "bo:alphaDecay"){
+       } else if (d->inIsotope && localName == "alphadecay"){
 //X            kDebug() << "bo:alphaDecay" << endl;
                d->inAlphaDecay = true;
-       } else if (d->inIsotope && localName == "bo:betaplusDecay"){
+       } else if (d->inIsotope && localName == "betaplusdecay"){
 //X            kDebug() << "bo:betaplusDecay" << endl;
                d->inBetaplusDecay = true;
-       } else if (d->inIsotope && localName == "bo:betaminusDecay"){
+       } else if (d->inIsotope && localName == "betaminusdecay"){
 //X            kDebug() << "bo:betaminusDecay" << endl;
                d->inBetaminusDecay = true;
-       } else if (d->inIsotope && localName == "bo:ecDecay"){
+       } else if (d->inIsotope && localName == "ecdecay"){
 //X            kDebug() << "bo:ecDecay" << endl;
                d->inECDecay = true;
        } else if (d->inIsotope && localName == "scalar")