]> Git trees. - libqmvoc.git/commitdiff
read the info about the discoverers of an element
authorPino Toscano <pino@kde.org>
Thu, 27 Oct 2005 15:01:05 +0000 (15:01 +0000)
committerPino Toscano <pino@kde.org>
Thu, 27 Oct 2005 15:01:05 +0000 (15:01 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=474890

libscience/chemicaldataobject.cpp
libscience/chemicaldataobject.h
libscience/elementparser.cpp
libscience/elementparser.h

index 347d1c9a8ce4c2ea48fcabef08730a523ef7db23..5719ca4da4f45bfb5669aa33d264b8200ae6dc94 100644 (file)
@@ -188,8 +188,8 @@ QString ChemicalDataObject::dictRef() const
                case date:
                        botype = "date";
                        break;
-               case discoverer:
-                       botype = "discoverer";
+               case discoverers:
+                       botype = "discoverers";
                        break;
                case period:
                        botype = "period";
index baeb344b0e43d53c7adb2eb7ead9a615043acb41..7bebebd217ba01ed39da5807f71a35df17232ebd 100644 (file)
@@ -61,7 +61,7 @@ class ChemicalDataObject
                        orbit/**< the quantumorbit of the element */,
                        period/**< the period of the element */,
                        date/**< date of discovery of the element. When 0, the element has been known in ancient times. */,
-                       discoverer/** The name of the discoverer(s) */,
+                       discoverers/** The name of the discoverers, separated by semicolomns */,
                        relativeAbundance/** The abundance, relative to 100 */
                };
 
index 8f348096ed5a95b745a62b37262253cecf2e88bc..bc888f362b8fb3e71c7629c1b5b7d6ec6a5f46c6 100644 (file)
@@ -37,6 +37,7 @@ ElementSaxParser::ElementSaxParser()
        inPeriodTableBlock_(false),
        inNameOrigin_(false),
        inDiscoveryDate_(false),
+       inDiscoverers_(false),
        inPeriod_(false)
 {
 }
@@ -87,6 +88,8 @@ bool ElementSaxParser::startElement(const QString&, const QString &localName, co
                                inNameOrigin_ = true;
                        else if (attrs.value(i) == "bo:discoveryDate")
                                inDiscoveryDate_ = true;
+                       else if (attrs.value(i) == "bo:discoverers")
+                               inDiscoverers_ = true;
                        else if (attrs.value(i) == "bo:period")
                                inPeriod_ = true;
                }
@@ -196,6 +199,11 @@ bool ElementSaxParser::characters(const QString &ch)
                type = ChemicalDataObject::date;
                inDiscoveryDate_ = false;
        }
+       else if (inDiscoverers_) {
+               value = ch;
+               type = ChemicalDataObject::discoverers;
+               inDiscoverers_ = false;
+       }
        else if (inPeriod_) {
                value = ch.toInt();
                type = ChemicalDataObject::period; 
index 02e30519fdaf36086cf265dc8ac6ddbf38845d1e..655b8808737a88f603cf3673877c588b0549fcd5 100644 (file)
@@ -62,6 +62,7 @@ class ElementSaxParser : public QXmlDefaultHandler
                         inPeriodTableBlock_,
                         inNameOrigin_,
                         inDiscoveryDate_,
+                        inDiscoverers_,
                         inPeriod_;
 };
 #endif // ELEMENTPARSER_H