domElementKvtml.appendChild(currentElement);
}
- //** NOTE: everything below this point has not been updated to use kvtml2 format****
- //if (!writeLesson(m_domDoc, domElementKvtml))
- // return false;
-
- //QList<KEduVocConjugation> conjugations;
- //for (int i = 0; i < m_doc->conjugationCount(); i++)
- // conjugations.append(m_doc->conjugation(i));
- //if (conjugations.count() > 0) {
- // if (!writeConjugHeader(m_domDoc, domElementKvtml, conjugations))
- // return false;
- //}
-
- //if (!writeOption(m_domDoc, domElementKvtml))
- // return false;
-
- //if (!writeType(m_domDoc, domElementKvtml))
- // return false;
-
- //if (!writeTense(m_domDoc, domElementKvtml))
- // return false;
-
- //if (!writeUsage(m_domDoc, domElementKvtml))
- // return false;
-
- //QString q_org, q_trans;
- //m_doc->queryIdentifier(q_org, q_trans);
-
- //int entryCount = m_doc->entryCount();
-
- //for (int i = 0; i < entryCount; i++)
- //{
- // KEduVocExpression *entry = m_doc->entry(i);
- // QDomElement domElementExpression = m_domDoc.createElement(KV_EXPR);
-
- // if (entry->lesson() != 0)
- // {
- // int lm = entry->lesson();
- // if (lm > m_doc->lessonDescriptions().count())
- // {
- // // should not be
- // kError() << "index of lesson member too high: " << lm << endl;
- // lm = 0;
- // }
- // domElementExpression.setAttribute(KV_LESS_MEMBER, lm);
- // }
-
- // if (entry->isInQuery())
- // domElementExpression.setAttribute(KV_SELECTED, 1);
-
- // if (!entry->isActive())
- // domElementExpression.setAttribute (KV_INACTIVE, 1);
-
- // if (entry->uniqueType() && !entry->translation(0).type().isEmpty())
- // domElementExpression.setAttribute (KV_EXPRTYPE, entry->translation(0).type());
-
- // QDomElement domElementOriginal = m_domDoc.createElement(KV_ORG);
- // if (first_expr)
- // {
- // // save space, only tell language in first entry
- // QString s;
- // domElementOriginal.setAttribute(KV_SIZEHINT, m_doc->sizeHint(0));
-
- // s = m_doc->identifier(0).simplified();
- // if (s.isEmpty() )
- // s = "original";
- // domElementOriginal.setAttribute(KV_LANG, s);
- // if (s == q_org)
- // domElementOriginal.setAttribute(KV_QUERY, (QString) KV_O);
- // else if (s == q_trans)
- // domElementOriginal.setAttribute(KV_QUERY, (QString) KV_T);
- // }
-
- // if (!entry->translation(0).comment().isEmpty() )
- // domElementOriginal.setAttribute(KV_REMARK, entry->translation(0).comment());
-
- // if (!entry->translation(0).synonym().isEmpty() )
- // domElementOriginal.setAttribute(KV_SYNONYM, entry->translation(0).synonym());
-
- // if (!entry->translation(0).example().isEmpty() )
- // domElementOriginal.setAttribute(KV_EXAMPLE, entry->translation(0).example());
-
- // if (!entry->translation(0).usageLabel().isEmpty() )
- // domElementOriginal.setAttribute(KV_USAGE, entry->translation(0).usageLabel());
-
- // if (!entry->translation(0).paraphrase().isEmpty() )
- // domElementOriginal.setAttribute(KV_PARAPHRASE, entry->translation(0).paraphrase());
-
- // if (!entry->translation(0).antonym().isEmpty() )
- // domElementOriginal.setAttribute(KV_ANTONYM, entry->translation(0).antonym());
-
- // if (!entry->translation(0).pronunciation().isEmpty() )
- // domElementOriginal.setAttribute(KV_PRONUNCE, entry->translation(0).pronunciation());
-
- // if (!entry->uniqueType() && !entry->translation(0).type().isEmpty())
- // domElementOriginal.setAttribute(KV_EXPRTYPE, entry->translation(0).type());
-
- // if (!writeMultipleChoice(m_domDoc, domElementOriginal, entry->translation(0).multipleChoice()))
- // return false;
-
- // QString s;
- // QString entype = s = entry->translation(0).type();
- // int pos;
- // if (pos >= 0)
- // entype = s.left(pos);
- // else
- // entype = s;
-
- // if (entry->translation(0).conjugation().entryCount() > 0)
- // {
- // KEduVocConjugation conj = entry->translation(0).conjugation();
- // if (!writeConjugEntry(m_domDoc, domElementOriginal, conj))
- // return false;
- // }
- // else if (!entry->translation(0).comparison().isEmpty())
- // {
- // KEduVocComparison comp = entry->translation(0).comparison();
- // if (!writeComparison(m_domDoc, domElementOriginal, comp))
- // return false;
- // }
-
- // QDomText domTextOriginal = m_domDoc.createTextNode(entry->translation(0).translation());
- // domElementOriginal.appendChild(domTextOriginal);
- // domElementExpression.appendChild(domElementOriginal);
-
- // int trans = 1;
- // while (trans < m_doc->identifierCount())
- // {
- // QDomElement domElementTranslation = m_domDoc.createElement(KV_TRANS);
- // if (first_expr)
- // {
- // // save space, only tell language in first entry
- // QString s;
- // domElementTranslation.setAttribute(KV_SIZEHINT, m_doc->sizeHint(trans));
-
- // s = m_doc->identifier(trans).simplified();
- // if (s.isEmpty() )
- // {
- // s.setNum(trans);
- // s.prepend("translation ");
- // }
- // domElementTranslation.setAttribute(KV_LANG, s);
- // if (s == q_org)
- // domElementTranslation.setAttribute(KV_QUERY, (QString) KV_O);
- // else if (s == q_trans)
- // domElementTranslation.setAttribute(KV_QUERY, (QString) KV_T);
- // }
-
- // if (entry->translation(trans).gradeFrom(0).grade() != 0 || entry->translation(0).gradeFrom(trans).grade() != 0)
- // domElementTranslation.setAttribute(KV_GRADE, QString::number(entry->translation(trans).gradeFrom(0).grade()) + ';' + QString::number(entry->translation(0).gradeFrom(trans).grade()));
-
- // if (entry->translation(trans).gradeFrom(0).queryCount() != 0 || entry->translation(0).gradeFrom(trans).queryCount() != 0)
- // domElementTranslation.setAttribute(KV_COUNT, QString::number(entry->translation(trans).gradeFrom(0).queryCount()) + ';' + QString::number(entry->translation(0).gradeFrom(trans).queryCount()));
-
- // if (entry->translation(trans).gradeFrom(0).badCount() != 0 || entry->translation(0).gradeFrom(trans).badCount() != 0)
- // domElementTranslation.setAttribute(KV_BAD, QString::number(entry->translation(trans).gradeFrom(0).badCount()) + ';' + QString::number(entry->translation(0).gradeFrom(trans).badCount()));
-
- // if (entry->translation(trans).gradeFrom(0).queryDate().toTime_t() != 0 || entry->translation(0).gradeFrom(trans).queryDate().toTime_t() != 0)
- // domElementTranslation.setAttribute(KV_DATE, QString::number(entry->translation(trans).gradeFrom(0).queryDate().toTime_t()) + ';' + QString::number(entry->translation(0).gradeFrom(trans).queryDate().toTime_t()));
-
- // if (!entry->translation(trans).comment().isEmpty() )
- // domElementTranslation.setAttribute(KV_REMARK, entry->translation(trans).comment());
-
- // if (!entry->translation(trans).falseFriend(0).isEmpty() )
- // domElementTranslation.setAttribute(KV_FAUX_AMI_F, entry->translation(trans).falseFriend(0));
-
- // if (!entry->translation(0).falseFriend(trans).isEmpty() )
- // domElementTranslation.setAttribute(KV_FAUX_AMI_T, entry->translation(0).falseFriend(trans));
-
- // if (!entry->translation(trans).synonym().isEmpty() )
- // domElementTranslation.setAttribute(KV_SYNONYM, entry->translation(trans).synonym());
-
- // if (!entry->translation(trans).example().isEmpty() )
- // domElementTranslation.setAttribute(KV_EXAMPLE, entry->translation(trans).example());
-
- // if (!entry->translation(trans).usageLabel().isEmpty() )
- // domElementTranslation.setAttribute(KV_USAGE, entry->translation(trans).usageLabel());
-
- // if (!entry->translation(trans).paraphrase().isEmpty() )
- // domElementTranslation.setAttribute(KV_PARAPHRASE, entry->translation(trans).paraphrase());
-
- // if (!entry->translation(trans).antonym().isEmpty() )
- // domElementTranslation.setAttribute(KV_ANTONYM, entry->translation(trans).antonym());
-
- // if (!entry->translation(trans).pronunciation().isEmpty() )
- // domElementTranslation.setAttribute(KV_PRONUNCE, entry->translation(trans).pronunciation());
-
- // if (!entry->uniqueType() && !entry->translation(trans).type().isEmpty())
- // domElementTranslation.setAttribute(KV_EXPRTYPE, entry->translation(trans).type());
-
- // if (!writeMultipleChoice(m_domDoc, domElementTranslation, entry->translation(trans).multipleChoice()))
- // return false;
-
- // QString s;
- // QString entype = s = entry->translation(0).type();
- // int pos;
- // if (pos >= 0)
- // entype = s.left (pos);
- // else
- // entype = s;
-
- // if (entry->translation(trans).conjugation().entryCount() > 0)
- // {
- // KEduVocConjugation conj = entry->translation(trans).conjugation();
- // if (!writeConjugEntry(m_domDoc, domElementTranslation, conj))
- // return false;
- // }
-
- // if (!entry->translation(trans).comparison().isEmpty())
- // {
- // KEduVocComparison comp = entry->translation(trans).comparison();
- // if (!writeComparison(m_domDoc, domElementTranslation, comp))
- // return false;
- // }
-
- // QDomText domTextTranslation = m_domDoc.createTextNode(entry->translation(trans).translation());
- // domElementTranslation.appendChild(domTextTranslation);
- // domElementExpression.appendChild(domElementTranslation);
-
- // trans++;
- // }
-
- // domElementKvtml.appendChild(domElementExpression);
-
- // first_expr = false;
- //}
-
m_domDoc.appendChild(domElementKvtml);
QTextStream ts(m_outputFile);