]> Git trees. - libqmvoc.git/commitdiff
Add (so far) unused subtype to keduvocexpression.
authorFrederik Gladhorn <gladhorn@kde.org>
Fri, 24 Aug 2007 09:54:32 +0000 (09:54 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Fri, 24 Aug 2007 09:54:32 +0000 (09:54 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=704208

keduvocdocument/keduvocdocument.cpp
keduvocdocument/keduvocdocument.h
keduvocdocument/keduvoctranslation.cpp
keduvocdocument/keduvoctranslation.h

index 8443ee5713e770af37d795273b306e8a82ec689e..b135fc6b79f5a20fd683594112f034e382097d95 100644 (file)
@@ -4,6 +4,7 @@
     copyright      : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
                      (C) 2001 The KDE-EDU team
                      (C) 2005-2007 Peter Hedlund <peter.hedlund@kdemail.net>
+                     (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
  ***************************************************************************/
 
 /***************************************************************************
@@ -86,7 +87,7 @@ public:
 
   QList<KEduVocArticle>     m_articles;
   QList<KEduVocConjugation> m_conjugations;
-  
+
   // make this a map so removals don't require renumbering :)
   QMap<int, KEduVocLesson*>            m_lessons;
 
@@ -994,7 +995,7 @@ int KEduVocDocument::addLesson(const QString &lessonName, int position)
       ++position;
     }
   }
-  
+
   KEduVocLesson *lesson = new KEduVocLesson;
   lesson->setDescription(lessonName);
   d->m_lessons.insert(position, lesson);
index 6658cea5e9632c50dbdf1af84cbc5c8d7ec173b9..4388c560baddcedd0eee60d133f3e2edb88c1583 100644 (file)
@@ -4,6 +4,7 @@
     copyright     : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
                     (C) 2001 The KDE-EDU team
                     (C) 2005, 2007 Peter Hedlund <peter.hedlund@kdemail.net>
+                    (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
  ***************************************************************************/
 
 /***************************************************************************
@@ -73,7 +74,7 @@ public:
   ~KEduVocDocument();
 
   // *** whole document methods ***
-  
+
   /**
    * Open a document file
    *
@@ -148,7 +149,7 @@ public:
   /** @returns the license of the file */
   QString license() const;
 
-  /** set the remark of the file 
+  /** set the remark of the file
    * @param rem remark to set */
   void setDocumentRemark(const QString & rem);
 
@@ -205,7 +206,7 @@ public:
    * @returns                 number of removed entries
    */
   int cleanUp();
-  
+
   /**
    * @returns the number of entries
    */
@@ -228,7 +229,7 @@ public:
   void setSizeHint (int index, const int width);
 
   // *** identifier methods ***
-  
+
   /**
    * @returns the number of different identifiers (usually languages)
    */
@@ -286,7 +287,7 @@ public:
   int indexOfIdentifier(const QString &lang) const;
 
   // *** type methods ***
-  
+
   /**
    * Sets attribute string
    *
@@ -342,7 +343,7 @@ public:
   QStringList tenseDescriptions() const;
 
   // *** usage methods ***
-  
+
   /**
    * Sets usage string
    *
@@ -418,7 +419,7 @@ public:
   void setQueryIdentifier(const QString &org, const QString &trans);
 
   // *** lesson methods ***
-  
+
   /**
    * @returns the current lesson index
    */
@@ -434,7 +435,7 @@ public:
    * @returns a pointer to the lesson object at the specified index or NULL if there isn't one
    */
   KEduVocLesson *lesson(int index);
-  
+
   /** get all lesson objects
    * @returns a map of pointers to lesson objects
    */
@@ -554,7 +555,7 @@ public:
   int conjugationCount() const;
 
   // *** article methods ***
-  
+
   /**
    * @param index            index of translation
    * @returns                a pointer to articles if available
index cb35500307d4e7da2e64d4b0490e04e48f4715a8..edd8dcf41454df08a23d4ef50c84d859e7fa6098 100644 (file)
@@ -38,7 +38,8 @@ public:
     // This is the word itself. The vocabulary. This is what it is all about.
     QString m_translation;
     /// noun:male etc (language dependent)
-    QString m_types;
+    QString m_type;
+    QString m_subType;
     QString m_usageLabel;
     QString m_comment;
     QString m_paraphrase;
@@ -75,7 +76,8 @@ void KEduVocTranslation::KEduVocTranslationPrivate::init()
 bool KEduVocTranslation::KEduVocTranslationPrivate::operator== ( const KEduVocTranslation::KEduVocTranslationPrivate &other ) const
 {
     return     m_translation == other.m_translation &&
-               m_types == other.m_types &&
+               m_type == other.m_type &&
+        m_subType == other.m_subType &&
                m_usageLabel == other.m_usageLabel &&
                m_comment == other.m_comment &&
                m_paraphrase == other.m_paraphrase &&
@@ -106,7 +108,8 @@ KEduVocTranslation::KEduVocTranslation( const QString &translation ) : d ( new K
 KEduVocTranslation::KEduVocTranslation( const KEduVocTranslation &other) : d ( new KEduVocTranslationPrivate )
 {
        d->m_translation = other.d->m_translation;
-    d->m_types = other.d->m_types;
+    d->m_type = other.d->m_type;
+    d->m_subType = other.d->m_subType;
     d->m_usageLabel = other.d->m_usageLabel;
     d->m_comment = other.d->m_comment;
     d->m_paraphrase = other.d->m_paraphrase;
@@ -277,15 +280,25 @@ void KEduVocTranslation::setPronunciation (  const QString & expr )
 
 QString KEduVocTranslation::type() const
 {
-    return d->m_types;
+    return d->m_type;
 }
 
 
 void KEduVocTranslation::setType (  const QString &type )
 {
-    d->m_types = type;
+    d->m_type = type;
 }
 
+QString KEduVocTranslation::subType() const
+{
+    return d->m_subType;
+}
+
+
+void KEduVocTranslation::setSubType (  const QString &type )
+{
+    d->m_subType = type;
+}
 
 void KEduVocTranslation::resetGrades(){
     d->m_grades.clear();
@@ -300,7 +313,8 @@ QList< int > KEduVocTranslation::conjugationTenses() const
 bool KEduVocTranslation::operator ==(const KEduVocTranslation & translation) const
 {
     return d->m_translation == translation.d->m_translation &&
-        d->m_types == translation.d->m_types &&
+        d->m_type == translation.d->m_type &&
+        d->m_subType == translation.d->m_subType &&
         d->m_usageLabel == translation.d->m_usageLabel &&
         d->m_comment == translation.d->m_comment &&
         d->m_paraphrase == translation.d->m_paraphrase &&
@@ -320,7 +334,8 @@ bool KEduVocTranslation::operator ==(const KEduVocTranslation & translation) con
 KEduVocTranslation & KEduVocTranslation::operator =(const KEduVocTranslation & translation)
 {
     d->m_translation = translation.d->m_translation;
-    d->m_types = translation.d->m_types;
+    d->m_type = translation.d->m_type;
+    d->m_subType = translation.d->m_subType;
     d->m_usageLabel = translation.d->m_usageLabel;
     d->m_comment = translation.d->m_comment;
     d->m_paraphrase = translation.d->m_paraphrase;
index dd267a3825738984ecfc15506be1f5d9b44266be..ec01595e1d7427ad2131a39fcdd9beb3d6f70950 100644 (file)
@@ -160,10 +160,21 @@ public:
    */
   void setType( const QString &type);
 
+  /** returns subtype of this expression
+   *
+   * @return                 type or "" if no type available
+   */
+  QString subType() const;
+
+ /** sets subtype of this expression
+   * @param type             type of this expression ("" = none)
+   */
+  void setSubType( const QString &type);
+
   /** reset the grades for this translation */
   void resetGrades();
 
-  /** get the gradeobject from given identifier 
+  /** get the gradeobject from given identifier
    * @param indexFrom which identifier to get the grade from
    * @returns the grade object
    */