From 684918fe5b144c3612fe680b5b4b54ac2bee7428 Mon Sep 17 00:00:00 2001 From: Carsten Niehaus Date: Sun, 10 Feb 2008 16:43:19 +0000 Subject: [PATCH] * Make use of the SpectrumParser svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=773252 --- libscience/element.cpp | 4 ---- libscience/element.h | 10 ---------- libscience/spectrumparser.cpp | 6 +++--- 3 files changed, 3 insertions(+), 17 deletions(-) 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); } -- 2.47.3