From 77c29689a7642ace983c308d244e48bd0fc8b006 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 24 Aug 2007 09:54:32 +0000 Subject: [PATCH] Add (so far) unused subtype to keduvocexpression. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=704208 --- keduvocdocument/keduvocdocument.cpp | 5 +++-- keduvocdocument/keduvocdocument.h | 19 +++++++++-------- keduvocdocument/keduvoctranslation.cpp | 29 +++++++++++++++++++------- keduvocdocument/keduvoctranslation.h | 13 +++++++++++- 4 files changed, 47 insertions(+), 19 deletions(-) diff --git a/keduvocdocument/keduvocdocument.cpp b/keduvocdocument/keduvocdocument.cpp index 8443ee5..b135fc6 100644 --- a/keduvocdocument/keduvocdocument.cpp +++ b/keduvocdocument/keduvocdocument.cpp @@ -4,6 +4,7 @@ copyright : (C) 1999-2001 Ewald Arnold (C) 2001 The KDE-EDU team (C) 2005-2007 Peter Hedlund + (C) 2007 Frederik Gladhorn ***************************************************************************/ /*************************************************************************** @@ -86,7 +87,7 @@ public: QList m_articles; QList m_conjugations; - + // make this a map so removals don't require renumbering :) QMap 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); diff --git a/keduvocdocument/keduvocdocument.h b/keduvocdocument/keduvocdocument.h index 6658cea..4388c56 100644 --- a/keduvocdocument/keduvocdocument.h +++ b/keduvocdocument/keduvocdocument.h @@ -4,6 +4,7 @@ copyright : (C) 1999-2001 Ewald Arnold (C) 2001 The KDE-EDU team (C) 2005, 2007 Peter Hedlund + (C) 2007 Frederik Gladhorn ***************************************************************************/ /*************************************************************************** @@ -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 diff --git a/keduvocdocument/keduvoctranslation.cpp b/keduvocdocument/keduvoctranslation.cpp index cb35500..edd8dcf 100644 --- a/keduvocdocument/keduvoctranslation.cpp +++ b/keduvocdocument/keduvoctranslation.cpp @@ -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; diff --git a/keduvocdocument/keduvoctranslation.h b/keduvocdocument/keduvoctranslation.h index dd267a3..ec01595 100644 --- a/keduvocdocument/keduvoctranslation.h +++ b/keduvocdocument/keduvoctranslation.h @@ -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 */ -- 2.47.3