]> Git trees. - libqmvoc.git/commitdiff
Throw out the uniqueType() method (not necessary) and enable writing of types for...
authorFrederik Gladhorn <gladhorn@kde.org>
Tue, 28 Aug 2007 15:36:40 +0000 (15:36 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Tue, 28 Aug 2007 15:36:40 +0000 (15:36 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=705789

keduvocdocument/keduvocexpression.cpp
keduvocdocument/keduvocexpression.h
keduvocdocument/keduvockvtmlwriter.cpp
keduvocdocument/keduvockvtmlwriter.h

index 6f0054974496949411aa46a6886fbe52fed204ab..1a5b7d0b12e8a301103af733593209432c34db2d 100644 (file)
@@ -148,17 +148,6 @@ void KEduVocExpression::setTranslation(int index, const QString & expr)
   d->m_translations[index] = expr.simplified();
 }
 
-bool KEduVocExpression::uniqueType() const
-{
-  bool unique = true;
-  QString type0 = d->m_translations[0].type();
-  foreach (int i, translationIndices()) {
-    if (type0 != d->m_translations[i].type()) {
-      unique = false;
-    }
-  }
-  return unique;
-}
 
 int KEduVocExpression::lesson() const
 {
index 60f6ad4b4686810041ebba1d6455da0764536411..616936e3681e312d429b212a9607e0ed692d7017 100644 (file)
@@ -70,12 +70,6 @@ public:
      */
     void resetGrades(int index);
 
-  /** all langs have same type ?
-   *
-   * @return                 true if all have same type
-   */
-  bool uniqueType () const;
-
   /** returns flag if entry is "selected" for queries
    */
   bool isInQuery() const;
index 79acf2184fcb4b28115a10306d2f7f8f5c773f59..551ff199e4f57defc17e66ff58f4b4d3db17706f 100644 (file)
@@ -120,9 +120,6 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator
     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 = domDoc.createElement(KV_ORG);
     if (first_expr)
     {
@@ -162,8 +159,8 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator
     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 (!entry->translation(0).type().isEmpty())
+      domElementOriginal.setAttribute(KV_EXPRTYPE, m_compability.oldType(entry->translation(0).type(), entry->translation(0).subType()));
 
     if (!writeMultipleChoice(domDoc, domElementOriginal, entry->translation(0).multipleChoice()))
       return false;
@@ -257,8 +254,8 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator
       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 (!entry->translation(trans).type().isEmpty())
+        domElementTranslation.setAttribute(KV_EXPRTYPE, m_compability.oldType(entry->translation(trans).type(), entry->translation(trans).subType()));
 
       if (!writeMultipleChoice(domDoc, domElementTranslation, entry->translation(trans).multipleChoice()))
         return false;
index bcaee0e375de60f5d118a393574b8cfebbb612e3..830402254411bddd65b6ebd993cfa489a5adccef 100644 (file)
@@ -55,6 +55,8 @@ public:
 private:
   QFile *m_outputFile;
   KEduVocDocument *m_doc;
+
+  KEduVocKvtmlCompability m_compability;
 };
 
 #endif