From: Carsten Niehaus Date: Sat, 22 Oct 2005 10:30:28 +0000 (+0000) Subject: Pino: This adds the reading of the bo:periodTableBlock X-Git-Tag: v3.80.2~278 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=67facd6e1bd3730a096e4972fd4e4040e787535f;p=libqmvoc.git Pino: This adds the reading of the bo:periodTableBlock svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=472979 --- diff --git a/libscience/chemicaldataobject.cpp b/libscience/chemicaldataobject.cpp index fb79b40..e9aded5 100644 --- a/libscience/chemicaldataobject.cpp +++ b/libscience/chemicaldataobject.cpp @@ -115,6 +115,9 @@ QString ChemicalDataObject::dictRef() case boilingpoint: botype = "boilingpoint"; break; + case periodTableBlock: + botype = "periodTableBlock"; + break; } botype = botype.prepend( "bo:" ); diff --git a/libscience/chemicaldataobject.h b/libscience/chemicaldataobject.h index 04d5a1b..7177879 100644 --- a/libscience/chemicaldataobject.h +++ b/libscience/chemicaldataobject.h @@ -53,7 +53,8 @@ class ChemicalDataObject radiusCovalent/**< the covalent radius */, radiusVDW/**< the van der Waals radius */, meltingpoint, - boilingpoint + boilingpoint, + periodTableBlock }; /** diff --git a/libscience/elementparser.cpp b/libscience/elementparser.cpp index f9370ff..aea08b3 100644 --- a/libscience/elementparser.cpp +++ b/libscience/elementparser.cpp @@ -33,7 +33,8 @@ ElementSaxParser::ElementSaxParser() inRadiusCovalent_(false), inRadiusVDW_(false), inBoilingPoint_(false), - inMeltingPoint_(false) + inMeltingPoint_(false), + inPeriodTableBlock_(false) { } @@ -69,6 +70,8 @@ bool ElementSaxParser::startElement(const QString&, const QString &localName, co inMeltingPoint_ = true; else if (attrs.value(i) == "bo:boilingpoint") inBoilingPoint_ = true; + else if (attrs.value(i) == "bo:periodTableBlock") + inPeriodTableBlock_ = true; } } return true; @@ -152,6 +155,11 @@ bool ElementSaxParser::characters(const QString &ch) type = ChemicalDataObject::boilingpoint; inBoilingPoint_ = false; } + else if (inPeriodTableBlock_) { + value = ch; + type = ChemicalDataObject::periodTableBlock; + inPeriodTableBlock_ = false; + } else//it is a non known value. Do not create a wrong object but return return true; diff --git a/libscience/elementparser.h b/libscience/elementparser.h index 8c388e9..74602a2 100644 --- a/libscience/elementparser.h +++ b/libscience/elementparser.h @@ -46,6 +46,7 @@ class ElementSaxParser : public QXmlDefaultHandler inRadiusCovalent_, inRadiusVDW_, inBoilingPoint_, - inMeltingPoint_; + inMeltingPoint_, + inPeriodTableBlock_; }; #endif // ELEMENTPARSER_H