]> Git trees. - libqmvoc.git/commitdiff
* Add some API-docs
authorCarsten Niehaus <cniehaus@gmx.de>
Sun, 17 Jul 2005 13:36:23 +0000 (13:36 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Sun, 17 Jul 2005 13:36:23 +0000 (13:36 +0000)
* change some QString to bool

svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=435569

kalzium/src/element.cpp
kalzium/src/element.h

index 5f6bb6f5ea1b627e519aec4b93b622a0a3bb02f8..bc41ca5b9e51916271be86914bc3386d59996d60 100644 (file)
@@ -612,7 +612,14 @@ EList KalziumDataObject::readData(  QDomDocument &dataDocument )
                        QString spin = iso.attributeNode( "spin" ).value();
                        double magmoment = iso.attributeNode( "magmoment" ).value().toDouble(); 
 
-                       Isotope *isotope = new Isotope( neutrons, percentage, weight, halflife, format, alphadecay, betaplusdecay, betaminusdecay, ecdecay, decayenergy, spin, magmoment );
+                       bool alphadecay_ = false, betaminusdecay_ = false, betaplusdecay_ = false, ecdecay_ = false;
+                       if ( betaplusdecay == "true" ) betaplusdecay_ = true;
+                       if ( betaminusdecay == "true" ) betaminusdecay_ = true;
+                       if ( ecdecay == "true" ) ecdecay_ = true;
+                       if ( alphadecay == "true" ) alphadecay_ = true;
+                       
+
+                       Isotope *isotope = new Isotope( neutrons, percentage, weight, halflife, format, alphadecay_, betaplusdecay_, betaminusdecay_, ecdecay_, decayenergy, spin, magmoment );
                        isolist.append( isotope );
                }
 
@@ -676,7 +683,7 @@ const int KalziumDataObject::numberOfElements() const
        return m_numOfElements;
 }
 
-Isotope::Isotope(  int neutrons, double percentage, double weight, double halflife, QString format, QString alphadecay, QString betaplusdecay, QString betaminusdecay, QString ecdecay, double decayenergy, QString spin, double magmoment )
+Isotope::Isotope(  int neutrons, double percentage, double weight, double halflife, QString format, bool alphadecay, bool betaplusdecay, bool betaminusdecay, bool ecdecay, double decayenergy, QString spin, double magmoment )
 {
        m_neutrons = neutrons;
        m_percentage = percentage;
index c843faa4be231e498dd0ddae4725b36f064e92af..7d919ce3d357aba441052791483c1eca2b49daed 100644 (file)
@@ -45,7 +45,7 @@ typedef QValueList<double> doubleList;
 class Isotope
 {
        public:
-               Isotope( int neutrons, double percentage, double weight, double halflife, QString format, QString alphadecay, QString betaplusdecay, QString betaminusdecay, QString ecdecay, double decayenergy, QString spin, double magmoment);
+               Isotope( int neutrons, double percentage, double weight, double halflife, QString format, bool alphadecay, bool betaplusdecay, bool betaminusdecay, bool ecdecay, double decayenergy, QString spin, double magmoment);
 
                bool seconds() const{
                        if ( m_format == "seconds" )
@@ -54,6 +54,10 @@ class Isotope
                                return false;
                }
 
+               /**
+                * @return the halflife period of the isotope it if has one. The format
+                * is defined by seconds()
+                */
                double halflife() const{
                        return m_halflife;
                }
@@ -62,6 +66,9 @@ class Isotope
                        return m_percentage;
                }
 
+               /**
+                * @return the number of neutrons the isotope has
+                */
                int neutrons() const{
                        return m_neutrons;
                }
@@ -71,31 +78,19 @@ class Isotope
                }
                
                bool alphadecay() const{
-                       if ( m_alphadecay == "true" )
-                               return true;
-                       else
-                               return false;
+                       return m_alphadecay;
                }
                
                bool betaplusdecay() const{
-                       if ( m_betaplusdecay == "true" )
-                               return true;
-                       else
-                               return false;
+                       return m_betaplusdecay;
                }
                
                bool betaminusdecay() const{
-                       if ( m_betaminusdecay == "true" )
-                               return true;
-                       else
-                               return false;
+                       return m_betaminusdecay;
                }
                
                bool ecdecay() const{
-                       if ( m_ecdecay == "true" )
-                               return true;
-                       else
-                               return false;
+                       return m_ecdecay;
                }
                
                double decayenergy() const{
@@ -142,14 +137,15 @@ class Isotope
                 */
                int m_neutrons;
                
-               /**
-               * Theese variables specify the kind of decay
-               * and the decay-energy
-               */
-               QString m_alphadecay;
-               QString m_betaplusdecay;
-               QString m_betaminusdecay;
-               QString m_ecdecay;
+               ///Specify if the decay is of this kind
+               bool  m_alphadecay;
+               ///Specify if the decay is of this kind
+               bool  m_betaplusdecay;
+               ///Specify if the decay is of this kind
+               bool  m_betaminusdecay;
+               ///Specify if the decay is of this kind
+               bool  m_ecdecay;
+               
                double m_decayenergy;
                
                /**