From: Carsten Niehaus Date: Sat, 16 Jun 2007 21:06:42 +0000 (+0000) Subject: Part II of II of the 'ancient' bug: If the discovery country equals 'ancient' that... X-Git-Tag: v3.91.0~12 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=0c3222b69ea760a0cad7353fc9c0b126c3994f55;p=libqmvoc.git Part II of II of the 'ancient' bug: If the discovery country equals 'ancient' that means that the element was know since forever. Therefore set the date of the discovery to the magic number -1. '0' means 'Unknown', '-1' ancient and every other numbers means the name of the discovery svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=676418 --- diff --git a/libscience/elementparser.cpp b/libscience/elementparser.cpp index e18cf41..6da22c6 100644 --- a/libscience/elementparser.cpp +++ b/libscience/elementparser.cpp @@ -354,8 +354,13 @@ bool ElementSaxParser::characters(const QString &ch) d->inSPhrase = false; } else if (d->inCountry){ - value = ch; - type = ChemicalDataObject::discoveryCountry; + if ( ch == "ancient" ) { + value = -1; + type = ChemicalDataObject::date; + } else { + value = ch; + type = ChemicalDataObject::discoveryCountry; + } d->inCountry = false; } else//it is a non known value. Do not create a wrong object but return