]> Git trees. - libqmvoc.git/commitdiff
read discorvery date from data
authorPino Toscano <pino@kde.org>
Mon, 24 Oct 2005 22:24:06 +0000 (22:24 +0000)
committerPino Toscano <pino@kde.org>
Mon, 24 Oct 2005 22:24:06 +0000 (22:24 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=473897

libscience/elementparser.cpp
libscience/elementparser.h

index 3f9083afa9c11aa1cc66070e1f537ec3c286b238..7cd97dda49149977702dafe69c3cfca8075b946c 100644 (file)
@@ -36,6 +36,7 @@ ElementSaxParser::ElementSaxParser()
        inMeltingPoint_(false),
        inPeriodTableBlock_(false),
        inNameOrigin_(false),
+       inDiscoveryDate_(false),
        inPeriod_(false)
 {
 }
@@ -84,6 +85,8 @@ bool ElementSaxParser::startElement(const QString&, const QString &localName, co
                                inPeriodTableBlock_ = true;
                        else if (attrs.value(i) == "bo:nameOrigin")
                                inNameOrigin_ = true;
+                       else if (attrs.value(i) == "bo:discoveryDate")
+                               inDiscoveryDate_ = true;
                        else if (attrs.value(i) == "bo:period")
                                inPeriod_ = true;
                }
@@ -188,6 +191,11 @@ bool ElementSaxParser::characters(const QString &ch)
                type = ChemicalDataObject::nameOrigin; 
                inNameOrigin_ = false;
        }
+       else if (inDiscoveryDate_) {
+               value = ch;
+               type = ChemicalDataObject::date;
+               inDiscoveryDate_ = false;
+       }
        else if (inPeriod_) {
                value = ch.toInt();
                type = ChemicalDataObject::period; 
index 0d82c2e3faa8bfb2c11ddf003f01153ebc21a235..02e30519fdaf36086cf265dc8ac6ddbf38845d1e 100644 (file)
@@ -61,6 +61,7 @@ class ElementSaxParser : public QXmlDefaultHandler
                         inMeltingPoint_,
                         inPeriodTableBlock_,
                         inNameOrigin_,
+                        inDiscoveryDate_,
                         inPeriod_;
 };
 #endif // ELEMENTPARSER_H