]> Git trees. - libqmvoc.git/commitdiff
translation writes conjugations in it, also doesnt write empty tags except name,... v3.92.0
authorJeremy Paul Whiting <jpwhiting@kde.org>
Thu, 26 Jul 2007 13:57:59 +0000 (13:57 +0000)
committerJeremy Paul Whiting <jpwhiting@kde.org>
Thu, 26 Jul 2007 13:57:59 +0000 (13:57 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=692884

kdeeducore/keduvockvtml2writer.cpp
kdeeducore/kvtml2todo

index 554bf7d19a38c3e9f6c3572a99c8a3ed583d5248..1a1c240e450045ddcb88259dfaba8cae479c2da2 100644 (file)
@@ -547,31 +547,58 @@ bool KEduVocKvtml2Writer::writeTranslation(QDomElement &translationElement, cons
   translationElement.appendChild(newTextElement(KVTML_COMMENT, translation.comment()));
 
   // <pronunciation></pronunciation>
-  translationElement.appendChild(newTextElement(KVTML_PRONUNCIATION, translation.pronunciation()));
+  if (!translation.pronunciation().isEmpty())
+  {
+    translationElement.appendChild(newTextElement(KVTML_PRONUNCIATION, translation.pronunciation()));
+  }
   
   // TODO
   // <falsefriend fromid="0"></falsefriend>
 
   // <antonym></antonym>
-  translationElement.appendChild(newTextElement(KVTML_ANTONYM, translation.antonym()));
+  if (!translation.antonym().isEmpty())
+  {
+    translationElement.appendChild(newTextElement(KVTML_ANTONYM, translation.antonym()));
+  }
   
   // <synonym></synonym>
-  translationElement.appendChild(newTextElement(KVTML_SYNONYM, translation.synonym()));
+  if (!translation.synonym().isEmpty())
+  {
+    translationElement.appendChild(newTextElement(KVTML_SYNONYM, translation.synonym()));
+  }
   
   // <example></example>
-  translationElement.appendChild(newTextElement(KVTML_EXAMPLE, translation.example()));
+  if (!translation.example().isEmpty())
+  {
+    translationElement.appendChild(newTextElement(KVTML_EXAMPLE, translation.example()));
+  }
   
   // <usage></usage>
-  translationElement.appendChild(newTextElement(KVTML_USAGE, translation.usageLabel()));
+  if (!translation.usageLabel().isEmpty())
+  {
+    translationElement.appendChild(newTextElement(KVTML_USAGE, translation.usageLabel()));
+  }
   
   // <paraphrase></paraphrase>
-  translationElement.appendChild(newTextElement(KVTML_USAGE, translation.paraphrase()));
+  if (!translation.paraphrase().isEmpty())
+  {
+    translationElement.appendChild(newTextElement(KVTML_USAGE, translation.paraphrase()));
+  }
   
   // grades
   // TODO
   
   // conjugation
-  // TODO
+  if (!translation.conjugation().entryCount() > 0)
+  {
+    KEduVocConjugation conjugation = translation.conjugation();
+    for (int i = 0; i < conjugation.entryCount(); ++i)
+    {
+      QDomElement thisElement = m_domDoc.createElement(KVTML_CONJUGATION);
+      writeConjugation(thisElement, conjugation, conjugation.getType(i));
+      translationElement.appendChild(thisElement);
+    }
+  }
   
   // comparison
   if (!translation.comparison().isEmpty())
index 10d463705213456b866a67fd30095495abf775db..45c2dbf33431f063c1510b9359fea965431683d1 100644 (file)
@@ -5,6 +5,6 @@ reader:
   store identifier name, sizehint and type? (need a place to store it first)
 
 writer:
-  write translation sub-parts: comparisons, conjugations, multiplechoices, grades
+  write translation sub-parts: grades
   write lesson entryids