From 0993452a17f71582716cdece136f32cbb1728064 Mon Sep 17 00:00:00 2001 From: Jeremy Paul Whiting Date: Thu, 26 Jul 2007 13:57:59 +0000 Subject: [PATCH] translation writes conjugations in it, also doesnt write empty tags except name, type and comment anymore svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=692884 --- kdeeducore/keduvockvtml2writer.cpp | 41 +++++++++++++++++++++++++----- kdeeducore/kvtml2todo | 2 +- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/kdeeducore/keduvockvtml2writer.cpp b/kdeeducore/keduvockvtml2writer.cpp index 554bf7d..1a1c240 100644 --- a/kdeeducore/keduvockvtml2writer.cpp +++ b/kdeeducore/keduvockvtml2writer.cpp @@ -547,31 +547,58 @@ bool KEduVocKvtml2Writer::writeTranslation(QDomElement &translationElement, cons translationElement.appendChild(newTextElement(KVTML_COMMENT, translation.comment())); // - translationElement.appendChild(newTextElement(KVTML_PRONUNCIATION, translation.pronunciation())); + if (!translation.pronunciation().isEmpty()) + { + translationElement.appendChild(newTextElement(KVTML_PRONUNCIATION, translation.pronunciation())); + } // TODO // // - translationElement.appendChild(newTextElement(KVTML_ANTONYM, translation.antonym())); + if (!translation.antonym().isEmpty()) + { + translationElement.appendChild(newTextElement(KVTML_ANTONYM, translation.antonym())); + } // - translationElement.appendChild(newTextElement(KVTML_SYNONYM, translation.synonym())); + if (!translation.synonym().isEmpty()) + { + translationElement.appendChild(newTextElement(KVTML_SYNONYM, translation.synonym())); + } // - translationElement.appendChild(newTextElement(KVTML_EXAMPLE, translation.example())); + if (!translation.example().isEmpty()) + { + translationElement.appendChild(newTextElement(KVTML_EXAMPLE, translation.example())); + } // - translationElement.appendChild(newTextElement(KVTML_USAGE, translation.usageLabel())); + if (!translation.usageLabel().isEmpty()) + { + translationElement.appendChild(newTextElement(KVTML_USAGE, translation.usageLabel())); + } // - 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()) diff --git a/kdeeducore/kvtml2todo b/kdeeducore/kvtml2todo index 10d4637..45c2dbf 100644 --- a/kdeeducore/kvtml2todo +++ b/kdeeducore/kvtml2todo @@ -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 -- 2.47.3