From: Frederik Gladhorn Date: Sun, 6 Jan 2008 22:03:59 +0000 (+0000) Subject: Usages begone. X-Git-Tag: v4.0.71~85 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=48625148d63fd97b676701d2c1886022632a3941;p=libqmvoc.git Usages begone. Also some cleanup. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=758101 --- diff --git a/keduvocdocument/keduvockvtml2reader.cpp b/keduvocdocument/keduvockvtml2reader.cpp index 444e873..e1279b3 100644 --- a/keduvocdocument/keduvockvtml2reader.cpp +++ b/keduvocdocument/keduvockvtml2reader.cpp @@ -346,13 +346,6 @@ bool KEduVocKvtml2Reader::readTranslation( QDomElement &translationElement, expr->translation(index)->setExample( currentElement.text() ); } - // 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 ); - } - // currentElement = translationElement.firstChildElement( KVTML_PARAPHRASE ); if ( !currentElement.isNull() ) { diff --git a/keduvocdocument/keduvockvtml2writer.cpp b/keduvocdocument/keduvockvtml2writer.cpp index dca6256..e198639 100644 --- a/keduvocdocument/keduvockvtml2writer.cpp +++ b/keduvocdocument/keduvockvtml2writer.cpp @@ -416,11 +416,6 @@ kDebug() << "write tranlation:" << translation->text(); translationElement.appendChild( newTextElement( KVTML_EXAMPLE, translation->example() ) ); } - // - foreach( const QString &usage, translation->usages() ) { - translationElement.appendChild( newTextElement( KVTML_USAGE, usage ) ); - } - // if ( !translation->paraphrase().isEmpty() ) { translationElement.appendChild( newTextElement( KVTML_PARAPHRASE, translation->paraphrase() ) ); diff --git a/keduvocdocument/keduvockvtmlreader.cpp b/keduvocdocument/keduvockvtmlreader.cpp index b1f1e37..186736d 100644 --- a/keduvocdocument/keduvockvtmlreader.cpp +++ b/keduvocdocument/keduvockvtmlreader.cpp @@ -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() ) diff --git a/keduvocdocument/keduvoctranslation.cpp b/keduvocdocument/keduvoctranslation.cpp index 291733d..7f11ecd 100644 --- a/keduvocdocument/keduvoctranslation.cpp +++ b/keduvocdocument/keduvoctranslation.cpp @@ -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 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 & usages ) -{ - d->m_usages = usages; -} - - -QSet& KEduVocTranslation::usages() -{ - return d->m_usages; -} - - void KEduVocTranslation::setParaphrase( const QString & expr ) { d->m_paraphrase = expr.simplified(); diff --git a/keduvocdocument/keduvoctranslation.h b/keduvocdocument/keduvoctranslation.h index a57a127..b41e8a9 100644 --- a/keduvocdocument/keduvoctranslation.h +++ b/keduvocdocument/keduvoctranslation.h @@ -120,18 +120,6 @@ public: */ QString example() const; - - /** sets usages this expression - * @param usage usage labels of this index - */ - void setUsages( const QSet & usage ); - - - /** returns usages of this expression - * @return usages - */ - QSet& usages(); - /** sets paraphrase of this expression * @param expression paraphrase of this index */