From 82cb91798800f95458c8b3830b863af93b5a40d5 Mon Sep 17 00:00:00 2001 From: Carsten Niehaus Date: Sun, 23 Oct 2005 16:11:58 +0000 Subject: [PATCH] * Albert had a look at this file, I moved things around. Thanks :-) svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=473411 --- libscience/Makefile.am | 3 ++ libscience/chemicaldataobject.cpp | 53 +++++++++++++++++++++++++------ libscience/chemicaldataobject.h | 38 +++++++--------------- 3 files changed, 59 insertions(+), 35 deletions(-) diff --git a/libscience/Makefile.am b/libscience/Makefile.am index 879fdd7..a79ce23 100644 --- a/libscience/Makefile.am +++ b/libscience/Makefile.am @@ -17,3 +17,6 @@ libscience_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 4:0:0 libscience_la_LIBADD = $(LIB_KDEUI) METASOURCES = AUTO + +include $(top_srcdir)/admin/Doxyfile.am + diff --git a/libscience/chemicaldataobject.cpp b/libscience/chemicaldataobject.cpp index 34c2775..afb9089 100644 --- a/libscience/chemicaldataobject.cpp +++ b/libscience/chemicaldataobject.cpp @@ -34,12 +34,7 @@ ChemicalDataObject::ChemicalDataObject() m_unit = ChemicalDataObject::noUnit; } -QString ChemicalDataObject::valueAsString() -{ - return m_value.toString(); -} - -bool ChemicalDataObject::operator==( const int v ) +bool ChemicalDataObject::operator==( const int v ) const { kdDebug() << "ChemicalDataObject::operator==() with int" << endl; if ( m_value.type() != QVariant::Int ) @@ -48,7 +43,7 @@ bool ChemicalDataObject::operator==( const int v ) return m_value.toInt() == v; } -bool ChemicalDataObject::operator==( const bool v ) +bool ChemicalDataObject::operator==( const bool v ) const { kdDebug() << "ChemicalDataObject::operator==() with bool" << endl; if ( m_value.type() != QVariant::Bool ) @@ -57,7 +52,7 @@ bool ChemicalDataObject::operator==( const bool v ) return m_value.toBool() == v; } -bool ChemicalDataObject::operator==( const double v ) +bool ChemicalDataObject::operator==( const double v ) const { kdDebug() << "ChemicalDataObject::operator==() with double" << endl; if ( m_value.type() != QVariant::Double ) @@ -66,7 +61,7 @@ bool ChemicalDataObject::operator==( const double v ) return m_value.toDouble() == v; } -bool ChemicalDataObject::operator==( const QString& v ) +bool ChemicalDataObject::operator==( const QString& v ) const { kdDebug() << "ChemicalDataObject::operator==() with QString" << endl; if ( m_value.type() != QVariant::String ) @@ -78,6 +73,46 @@ bool ChemicalDataObject::operator==( const QString& v ) ChemicalDataObject::~ChemicalDataObject() {} +QString ChemicalDataObject::valueAsString() const +{ + return m_value.toString(); +} + +ChemicalDataObject::BlueObelisk ChemicalDataObject::type() const +{ + return m_type; +} + +QVariant ChemicalDataObject::value() const +{ + return m_value; +} + +void ChemicalDataObject::setUnit( ChemicalDataObject::BlueObeliskUnit unit ) +{ + m_unit = unit; +} + +ChemicalDataObject::BlueObeliskUnit ChemicalDataObject::unit() const +{ + return m_unit; +} + +void ChemicalDataObject::setData( QVariant v ) +{ + m_value = v; +} + +void ChemicalDataObject::setType( BlueObelisk type ) +{ + m_type = type; +} + +void ChemicalDataObject::setType( int type ) +{ + m_type = ( ChemicalDataObject::BlueObelisk ) type; +} + QString ChemicalDataObject::dictRef() { QString botype; diff --git a/libscience/chemicaldataobject.h b/libscience/chemicaldataobject.h index b5b442c..823bf67 100644 --- a/libscience/chemicaldataobject.h +++ b/libscience/chemicaldataobject.h @@ -92,9 +92,7 @@ class ChemicalDataObject * Set the data of this object to @p v * @param v the value of the object */ - void setData( QVariant v ){ - m_value = v; - } + void setData( QVariant v ); /** * Destructor. @@ -112,7 +110,7 @@ class ChemicalDataObject * * @return the value as a QString */ - QString valueAsString(); + QString valueAsString() const; /** * Every ChemicalDataObject contains one data. For example a @@ -121,50 +119,42 @@ class ChemicalDataObject * * @return the value as a QVariant */ - QVariant value() const{ - return m_value; - } + QVariant value() const; /** * @return the type of dataset of this object */ - BlueObelisk type() const{ - return m_type; - } + BlueObelisk type() const; /** * @param type the type of this object */ - void setType( BlueObelisk type ){ - m_type = type; - } + void setType( BlueObelisk type ); /** * @overload */ - void setType( int type ){ - m_type = ( BlueObelisk ) type; - } + void setType( int type ); /** * Compare the value @p v with the data of this object */ - bool operator== ( const int v ); + bool operator== ( const int v ) const; /** * Compare the value @p v with the data of this object */ - bool operator== ( const double v ); + bool operator== ( const double v ) const; /** * Compare the value @p v with the data of this object */ - bool operator== ( const bool v ); + bool operator== ( const bool v ) const; /** * Compare the value @p v with the data of this object */ - bool operator== ( const QString& v ); + bool operator== ( const QString& v ) const; /** * @return the dictRef attribute of the XML. This is an @@ -181,17 +171,13 @@ class ChemicalDataObject /** * @return the unit of the object */ - BlueObeliskUnit unit() const{ - return m_unit; - } + BlueObeliskUnit unit() const; /** * set the unit of this object to @p unit * @param the BlueObeliskUnit of this object */ - void setUnit( BlueObeliskUnit unit ){ - m_unit = unit; - } + void setUnit( BlueObeliskUnit unit ); /** * @return the BlueObeliskUnit of a ChemicalDataObject corresponding to @p text -- 2.47.3