From: Albert Astals Cid Date: Sun, 23 Oct 2005 16:33:12 +0000 (+0000) Subject: some more const X-Git-Tag: v3.80.2~263 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=41c70369854e57e740476200d8eeaf99afe73fca;p=libqmvoc.git some more const svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=473420 --- diff --git a/libscience/element.cpp b/libscience/element.cpp index e69b84b..8006dbd 100644 --- a/libscience/element.cpp +++ b/libscience/element.cpp @@ -35,7 +35,7 @@ Element::Element() { } -ChemicalDataObject& Element::data(ChemicalDataObject::BlueObelisk type) +ChemicalDataObject& Element::data(ChemicalDataObject::BlueObelisk type) const { foreach( ChemicalDataObject*o, dataList ) { if ( o->type() == type ) @@ -45,7 +45,7 @@ ChemicalDataObject& Element::data(ChemicalDataObject::BlueObelisk type) return cdo; } -QVariant Element::dataAsVariant( ChemicalDataObject::BlueObelisk type ) +QVariant Element::dataAsVariant( ChemicalDataObject::BlueObelisk type ) const { foreach( ChemicalDataObject* o, dataList ) { if ( o->type() == type ) @@ -54,7 +54,7 @@ QVariant Element::dataAsVariant( ChemicalDataObject::BlueObelisk type ) return QVariant(); } -QString Element::dataAsString(ChemicalDataObject::BlueObelisk type) +QString Element::dataAsString(ChemicalDataObject::BlueObelisk type) const { foreach( ChemicalDataObject*o, dataList ) { if ( o->type() == type ) @@ -63,7 +63,7 @@ QString Element::dataAsString(ChemicalDataObject::BlueObelisk type) return ""; } -Isotope* Element::isotopeByNucleons( int numberOfNucleons ) +Isotope* Element::isotopeByNucleons( int numberOfNucleons ) const { QList::ConstIterator it = m_isotopeList.begin(); const QList::ConstIterator itEnd = m_isotopeList.end(); diff --git a/libscience/element.h b/libscience/element.h index 7bb9528..0bdb3f7 100644 --- a/libscience/element.h +++ b/libscience/element.h @@ -49,7 +49,7 @@ class Element{ * @returns a pointer to the istope with @p numberOfNucleons * nucleons */ - Isotope* isotopeByNucleons( int numberOfNucleons ); + Isotope* isotopeByNucleons( int numberOfNucleons ) const; enum RADIUSTYPE { @@ -67,7 +67,7 @@ class Element{ return m_spectrumList; } - void setIsotopeList( QList list ){ + void setIsotopeList( const QList &list ){ m_isotopeList = list; } @@ -171,17 +171,17 @@ class Element{ * of the type @p type * @param type the type of the requested data */ - ChemicalDataObject& data( ChemicalDataObject::BlueObelisk type ); + ChemicalDataObject& data( ChemicalDataObject::BlueObelisk type ) const; /** * @return the requested data of the type @p type as a QVariant */ - QVariant dataAsVariant( ChemicalDataObject::BlueObelisk type ); + QVariant dataAsVariant( ChemicalDataObject::BlueObelisk type ) const; /** * @return the requested data of the type @p type as a QString */ - QString dataAsString( ChemicalDataObject::BlueObelisk type ); + QString dataAsString( ChemicalDataObject::BlueObelisk type ) const; /** * @return the data of the Element