]> Git trees. - libqmvoc.git/commitdiff
Have to store the total number of nuclons for SAX2-reasons...
authorCarsten Niehaus <cniehaus@gmx.de>
Tue, 21 Feb 2006 17:24:31 +0000 (17:24 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Tue, 21 Feb 2006 17:24:31 +0000 (17:24 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=512050

libscience/isotope.cpp
libscience/isotope.h

index 452eed193cf39546892c8b3af29817248a5c9547..0d38c38f35fc7fc4424c9f72e1228fa11bd43ac9 100644 (file)
@@ -101,20 +101,21 @@ QString Isotope::parentElementSymbol() const
 
 void Isotope::setNucleons( int number )
 {
-       int protons = m_identifier->value().toInt();
-       int neutrons = number - protons;
-       m_nucleons.protons = protons;
-       m_nucleons.neutrons = neutrons;
+       m_numberOfNucleons = number;
 }
 
 int Isotope::nucleons() const
 {
-       return m_nucleons.neutrons + m_nucleons.protons;
+       return m_numberOfNucleons;
 }
 
 Isotope::Nucleons Isotope::nucleonsAfterDecay( Decay kind )
 {
-       Nucleons n = m_nucleons;
+       Isotope::Nucleons n;
+       int protons = m_identifier->value().toInt();
+       int neutrons = m_numberOfNucleons - protons;
+       n.protons = protons;
+       n.neutrons = neutrons;
 
        switch ( kind )
        {
index dae6b7a4385aa338eb277d9d23b3d8455bef2651..db6789eb989685f5b297e8ea4987622b93da3187 100644 (file)
@@ -148,8 +148,7 @@ class Isotope
                ChemicalDataObject* m_betaminus; 
                ChemicalDataObject* m_alpha;
        
-               Isotope::Nucleons m_nucleons;
-               
+               int m_numberOfNucleons;
 };
 
 #endif // ISOTOPE_H