]> Git trees. - libqmvoc.git/commitdiff
Usages begone.
authorFrederik Gladhorn <gladhorn@kde.org>
Sun, 6 Jan 2008 22:03:59 +0000 (22:03 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Sun, 6 Jan 2008 22:03:59 +0000 (22:03 +0000)
Also some cleanup.

svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=758101

keduvocdocument/keduvockvtml2reader.cpp
keduvocdocument/keduvockvtml2writer.cpp
keduvocdocument/keduvockvtmlreader.cpp
keduvocdocument/keduvoctranslation.cpp
keduvocdocument/keduvoctranslation.h

index 444e8736bcb7b544cb4c7fd304c3a11eda45437b..e1279b3ff8845de9c30135213e99c607c3a36e75 100644 (file)
@@ -346,13 +346,6 @@ bool KEduVocKvtml2Reader::readTranslation( QDomElement &translationElement,
         expr->translation(index)->setExample( currentElement.text() );
     }
 
-    //<usage></usage> can be as often as there are usage labels
-    currentElement = translationElement.firstChildElement( KVTML_USAGE );
-    while ( !currentElement.isNull() ) {
-        expr->translation(index)->usages().insert( currentElement.text() );
-        currentElement = currentElement.nextSiblingElement( KVTML_USAGE );
-    }
-
     //<paraphrase></paraphrase>
     currentElement = translationElement.firstChildElement( KVTML_PARAPHRASE );
     if ( !currentElement.isNull() ) {
index dca6256ffddb83a307e1e3869fe95194c184afbd..e19863970a3223154283bc0d066af42ddd581bee 100644 (file)
@@ -416,11 +416,6 @@ kDebug() << "write tranlation:" << translation->text();
         translationElement.appendChild( newTextElement( KVTML_EXAMPLE, translation->example() ) );
     }
 
-    // <usage></usage>
-    foreach( const QString &usage, translation->usages() ) {
-        translationElement.appendChild( newTextElement( KVTML_USAGE, usage ) );
-    }
-
     // <paraphrase></paraphrase>
     if ( !translation->paraphrase().isEmpty() ) {
         translationElement.appendChild( newTextElement( KVTML_PARAPHRASE, translation->paraphrase() ) );
index b1f1e37eecc53600f6096e77eb1ab4749fe1e599..186736d423cbe74454e638cd728be55af6c4afda 100644 (file)
@@ -1027,8 +1027,6 @@ bool KEduVocKvtmlReader::readExpression( QDomElement &domElementParent )
             entry->translation( i )->setSynonym( synonym );
         if ( !example.isEmpty() )
             entry->translation( i )->setExample( example );
-        if ( !usage.isEmpty() )
-            entry->translation( i )->setUsages( usage );
         if ( !paraphrase.isEmpty() )
             entry->translation( i )->setParaphrase( paraphrase );
         if ( !antonym.isEmpty() )
index 291733dc57f504bdfd0b74ecae2268fd8e77a128..7f11ecd51043951e55dfa6dbb6e9c7090221f5f5 100644 (file)
@@ -55,8 +55,7 @@ public:
     KUrl m_imageUrl;
     /// Sound url
     KUrl m_soundUrl;
-    /// Usages give a context (eg. this word is usually used in [biology])
-    QSet<QString> m_usages;
+
     /// When creating multiple choice tests, these are possible answers. (otherwise other words are added randomly)
     QStringList m_multipleChoice;
 
@@ -100,7 +99,6 @@ KEduVocTranslation::KEduVocTranslation( const KEduVocTranslation &other ) : d( n
 {
     d->m_translation = other.d->m_translation;
     d->m_wordType = other.d->m_wordType;
-    d->m_usages = other.d->m_usages;
     d->m_comment = other.d->m_comment;
     d->m_paraphrase = other.d->m_paraphrase;
     d->m_synonym = other.d->m_synonym;
@@ -131,7 +129,6 @@ bool KEduVocTranslation::operator == ( const KEduVocTranslation & translation )
     return d->m_entry == translation.d->m_entry &&
            d->m_translation == translation.d->m_translation &&
            d->m_wordType == translation.d->m_wordType &&
-           d->m_usages == translation.d->m_usages &&
            d->m_comment == translation.d->m_comment &&
            d->m_paraphrase == translation.d->m_paraphrase &&
            d->m_synonym == translation.d->m_synonym &&
@@ -154,7 +151,6 @@ KEduVocTranslation & KEduVocTranslation::operator = ( const KEduVocTranslation &
     d->m_entry = translation.d->m_entry;
     d->m_translation = translation.d->m_translation;
     d->m_wordType = translation.d->m_wordType;
-    d->m_usages = translation.d->m_usages;
     d->m_comment = translation.d->m_comment;
     d->m_paraphrase = translation.d->m_paraphrase;
     d->m_synonym = translation.d->m_synonym;
@@ -233,18 +229,6 @@ QString KEduVocTranslation::example() const
 }
 
 
-void KEduVocTranslation::setUsages( const QSet<QString> & usages )
-{
-    d->m_usages = usages;
-}
-
-
-QSet<QString>& KEduVocTranslation::usages()
-{
-    return d->m_usages;
-}
-
-
 void KEduVocTranslation::setParaphrase( const QString & expr )
 {
     d->m_paraphrase = expr.simplified();
index a57a127314308a8c6e0ff2c1c5558deaffc40944..b41e8a9a70d949ffee817fba8fcae47125fb7a93 100644 (file)
@@ -120,18 +120,6 @@ public:
     */
     QString example() const;
 
-
-    /** sets usages this expression
-    * @param usage            usage labels of this index
-    */
-    void setUsages( const QSet<QString> & usage );
-
-
-    /** returns usages of this expression
-    * @return                 usages
-    */
-    QSet<QString>& usages();
-
     /** sets paraphrase of this expression
     * @param expression       paraphrase of this index
     */