From: Carsten Niehaus Date: Sun, 10 Feb 2008 16:43:19 +0000 (+0000) Subject: * Make use of the SpectrumParser X-Git-Tag: v4.0.71~56 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=684918fe5b144c3612fe680b5b4b54ac2bee7428;p=libqmvoc.git * Make use of the SpectrumParser svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=773252 --- diff --git a/libscience/element.cpp b/libscience/element.cpp index c186433..79a735b 100644 --- a/libscience/element.cpp +++ b/libscience/element.cpp @@ -19,12 +19,10 @@ ***************************************************************************/ #include "element.h" -#include "spectrum.h" #include Element::Element() { - m_spectrum = 0; } QVariant Element::dataAsVariant( ChemicalDataObject::BlueObelisk type ) const @@ -47,8 +45,6 @@ QString Element::dataAsString(ChemicalDataObject::BlueObelisk type) const Element::~Element() { - delete m_spectrum; - m_spectrum = 0; } void Element::addData( const ChemicalDataObject& o ) diff --git a/libscience/element.h b/libscience/element.h index 5ce247b..1681ef7 100644 --- a/libscience/element.h +++ b/libscience/element.h @@ -76,21 +76,11 @@ class SCIENCE_EXPORT Element return dataList; } - void setSpectrum( Spectrum * spec ){ - m_spectrum = spec; - } - - Spectrum * spectrum() const{ - return m_spectrum; - } - private: /** * this QList stores all information about an element */ QList dataList; - - Spectrum *m_spectrum; }; #endif diff --git a/libscience/spectrumparser.cpp b/libscience/spectrumparser.cpp index 50250bf..0e9e02f 100644 --- a/libscience/spectrumparser.cpp +++ b/libscience/spectrumparser.cpp @@ -78,11 +78,11 @@ bool SpectrumParser::startElement(const QString&, const QString &localName, cons for (int i = 0; i < attrs.length(); ++i) { if (attrs.localName(i) == "xValue"){ - d->wavelenght = attrs.value(i).toDouble(); - } - else if (attrs.localName(i) == "yValue"){ d->intensity = attrs.value(i).toInt(); } + else if (attrs.localName(i) == "yValue"){ + d->wavelenght = attrs.value(i).toDouble(); + } } d->currentPeak = new Spectrum::peak(d->wavelenght, d->intensity); }