From: Frederik Gladhorn Date: Fri, 15 Aug 2008 12:35:11 +0000 (+0000) Subject: Make language selection work somewhat. X-Git-Tag: v4.1.80~14 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=9cc0edfcebf1de48693c8d0aff616843f71fc92e;p=libqmvoc.git Make language selection work somewhat. config does not yet save it correctly though. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=847466 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d52cc99..1d296a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ project(libkdeedu) +#add_definitions( -Wall -fprofile-arcs -ftest-coverage ) + add_subdirectory(keduvocdocument) add_subdirectory(kdeeduui) add_subdirectory(libscience) diff --git a/keduvocdocument/keduvocdocument.cpp b/keduvocdocument/keduvocdocument.cpp index 03b6bf7..ceaa9b1 100644 --- a/keduvocdocument/keduvocdocument.cpp +++ b/keduvocdocument/keduvocdocument.cpp @@ -666,19 +666,6 @@ void KEduVocDocument::setIdentifier( int idx, const KEduVocIdentifier &id ) setModified(true); } -QString KEduVocDocument::tenseName( int index ) const -{ - if ( index >= d->m_tenseDescriptions.size() ) - return ""; - else - return d->m_tenseDescriptions[index]; -} - -QStringList KEduVocDocument::tenseDescriptions() const -{ - return d->m_tenseDescriptions; -} - // works if const is removed int KEduVocDocument::indexOfIdentifier( const QString &name ) const { diff --git a/keduvocdocument/keduvocdocument.h b/keduvocdocument/keduvocdocument.h index 58b15a8..dcbf2d7 100644 --- a/keduvocdocument/keduvocdocument.h +++ b/keduvocdocument/keduvocdocument.h @@ -256,22 +256,6 @@ public: */ int indexOfIdentifier( const QString &name ) const; - // *** tense methods *** - - /** - * Returns the tense string - * - * @param index number of tense - * @returns string - */ - QString tenseName( int index ) const; - - /** - * Gets the descriptions of the tenses - */ - QStringList tenseDescriptions() const; - - // *** grade methods *** /** diff --git a/keduvocdocument/keduvocidentifier.cpp b/keduvocdocument/keduvocidentifier.cpp index f6dea7b..86e766a 100644 --- a/keduvocdocument/keduvocidentifier.cpp +++ b/keduvocdocument/keduvocidentifier.cpp @@ -55,8 +55,9 @@ KEduVocIdentifier::~KEduVocIdentifier() } KEduVocIdentifier::KEduVocIdentifier( const KEduVocIdentifier &other ) -: d( new Private ) +: d( new Private( *other.d ) ) { +#if 0 d->m_locale = other.d->m_locale; d->m_name = other.d->m_name; d->m_articles = other.d->m_articles; @@ -64,6 +65,7 @@ KEduVocIdentifier::KEduVocIdentifier( const KEduVocIdentifier &other ) d->m_comment = other.d->m_comment; d->m_tenses = other.d->m_tenses; d->m_type = other.d->m_type; +#endif } KEduVocIdentifier& KEduVocIdentifier::operator= ( const KEduVocIdentifier &other ) diff --git a/keduvocdocument/keduvockvtml2reader.cpp b/keduvocdocument/keduvockvtml2reader.cpp index a16b7b7..d09a3b8 100644 --- a/keduvocdocument/keduvockvtml2reader.cpp +++ b/keduvocdocument/keduvockvtml2reader.cpp @@ -270,8 +270,9 @@ bool KEduVocKvtml2Reader::readIdentifier( QDomElement &identifierElement ) m_doc->identifier(id).setPersonalPronouns( personalPronoun ); } - QStringList tenses = readTenses(identifierElement); +kDebug() << tenses; + m_doc->identifier(id).setTenseList(tenses); return result; @@ -609,7 +610,7 @@ bool KEduVocKvtml2Reader::readWordType( KEduVocWordType* parentContainer, QDomEl return true; } -const QStringList& KEduVocKvtml2Reader::readTenses( QDomElement &tensesElement ) +QStringList KEduVocKvtml2Reader::readTenses( QDomElement &tensesElement ) { QStringList tenses; diff --git a/keduvocdocument/keduvockvtml2reader.h b/keduvocdocument/keduvockvtml2reader.h index 9d082dc..ec476c1 100644 --- a/keduvocdocument/keduvockvtml2reader.h +++ b/keduvocdocument/keduvockvtml2reader.h @@ -106,7 +106,7 @@ private: /** read the tenses * @param tensesElement QDomElement for the tenses group */ - const QStringList& readTenses( QDomElement &tensesElement ); + QStringList readTenses( QDomElement &tensesElement ); /** read the usages * @param usagesElement QDomElement for the usages group diff --git a/keduvocdocument/keduvockvtml2writer.cpp b/keduvocdocument/keduvockvtml2writer.cpp index c8ddfcd..2f24209 100644 --- a/keduvocdocument/keduvockvtml2writer.cpp +++ b/keduvocdocument/keduvockvtml2writer.cpp @@ -181,7 +181,7 @@ bool KEduVocKvtml2Writer::writeIdentifiers( QDomElement &identifiersElement ) } // tenses - foreach(const QString &tense, m_doc->tenseDescriptions() ) { + foreach(const QString &tense, m_doc->identifier(i).tenseList() ) { if ( !( tense.isNull() ) ) { identifier.appendChild( newTextElement( KVTML_TENSE, tense ) ); }