]> Git trees. - libqmvoc.git/commitdiff
make it static: static BlueObeliskUnit unit( const QString& unitname );
authorCarsten Niehaus <cniehaus@gmx.de>
Sun, 23 Oct 2005 15:26:53 +0000 (15:26 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Sun, 23 Oct 2005 15:26:53 +0000 (15:26 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=473392

libscience/chemicaldataobject.cpp
libscience/chemicaldataobject.h
libscience/elementparser.cpp
libscience/elementparser.h

index 20c62bcd26bb80c82b69985208d27e1c5f9b6680..34c27755a4edee5288928158a767a3e54cc5ac47 100644 (file)
@@ -168,3 +168,19 @@ QString ChemicalDataObject::unitAsString()
        return bounit;
 }
        
+
+ChemicalDataObject::BlueObeliskUnit ChemicalDataObject::unit( const QString& unit )
+{
+       if ( unit == "bo:kelvin" ) 
+               return ChemicalDataObject::kelvin;
+       else if ( unit == "bo:ev" )
+               return ChemicalDataObject::ev;
+       else if ( unit == "bo:nm" )
+               return ChemicalDataObject::nm;
+       else if ( unit == "bo:pm" )
+               return ChemicalDataObject::pm;
+       else if ( unit == "bo:noUnit" )
+               return ChemicalDataObject::noUnit;
+       else
+               return ChemicalDataObject::noUnit;
+}
index 02eb03f7ad66eb72677a42d24cd193511dfda676..b5b442cc9597fb90532dca0a06397f5d94b822d0 100644 (file)
@@ -192,6 +192,12 @@ class ChemicalDataObject
                void setUnit( BlueObeliskUnit unit ){
                        m_unit = unit;
                }
+
+               /**
+                * @return the BlueObeliskUnit of a ChemicalDataObject corresponding to @p text
+                * @param text the attribute-text of the XML parsed
+                */
+               static BlueObeliskUnit unit( const QString& unitname );
                
        private:
                QVariant m_value;
index 89a4f4a1c71022a14283a124983db51ac0339b9d..3f9083afa9c11aa1cc66070e1f537ec3c286b238 100644 (file)
@@ -52,7 +52,7 @@ bool ElementSaxParser::startElement(const QString&, const QString &localName, co
                {
                        if ( attrs.localName( i ) == "unit" )
                        {
-                               currentUnit_ = unit( attrs.value( i ) );
+                               currentUnit_ = ChemicalDataObject::unit( attrs.value( i ) );
                                continue;
                        }
 
@@ -209,19 +209,3 @@ QList<Element*> ElementSaxParser::getElements()
 {
        return elements_;
 }
-
-ChemicalDataObject::BlueObeliskUnit ElementSaxParser::unit( const QString& unit )
-{
-       if ( unit == "bo:kelvin" ) 
-               return ChemicalDataObject::kelvin;
-       else if ( unit == "bo:ev" )
-               return ChemicalDataObject::ev;
-       else if ( unit == "bo:nm" )
-               return ChemicalDataObject::nm;
-       else if ( unit == "bo:pm" )
-               return ChemicalDataObject::pm;
-       else if ( unit == "bo:noUnit" )
-               return ChemicalDataObject::noUnit;
-       else
-               return ChemicalDataObject::noUnit;
-}
index f815ac9477b8a6596743c46cf2c7a27ff742e205..0d82c2e3faa8bfb2c11ddf003f01153ebc21a235 100644 (file)
@@ -43,12 +43,6 @@ class ElementSaxParser : public QXmlDefaultHandler
        private:
                ChemicalDataObject *currentDataObject_;
                ChemicalDataObject::BlueObeliskUnit currentUnit_;
-
-               /**
-                * @return the BlueObeliskUnit of a ChemicalDataObject corresponding to @p text
-                * @param text the attribute-text of the XML parsed
-                */
-               ChemicalDataObject::BlueObeliskUnit unit( const QString& text );
                
                Element *currentElement_;
                QList<Element*> elements_;