]> Git trees. - libqmvoc.git/commitdiff
Make language selection work somewhat.
authorFrederik Gladhorn <gladhorn@kde.org>
Fri, 15 Aug 2008 12:35:11 +0000 (12:35 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Fri, 15 Aug 2008 12:35:11 +0000 (12:35 +0000)
config does not yet save it correctly though.

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

CMakeLists.txt
keduvocdocument/keduvocdocument.cpp
keduvocdocument/keduvocdocument.h
keduvocdocument/keduvocidentifier.cpp
keduvocdocument/keduvockvtml2reader.cpp
keduvocdocument/keduvockvtml2reader.h
keduvocdocument/keduvockvtml2writer.cpp

index d52cc99cc328f0d84e105372ef3cd51d749c6ee7..1d296a771644650e5461ec0e5215da01f0aeb45c 100644 (file)
@@ -1,5 +1,7 @@
 project(libkdeedu)
 
+#add_definitions( -Wall -fprofile-arcs -ftest-coverage )
+
 add_subdirectory(keduvocdocument)
 add_subdirectory(kdeeduui)
 add_subdirectory(libscience)
index 03b6bf7aaf581c7b257e82597e37343f2a989de8..ceaa9b1f8470ee5803161afaedb87c95a1bc73b2 100644 (file)
@@ -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
 {
index 58b15a8f0137ec5ed6205952da02a810e3baf026..dcbf2d78594d588398e6b9865063c9d7a03708c2 100644 (file)
@@ -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 ***
 
     /**
index f6dea7b095f9b5b572b5493984833581eefc9e66..86e766a479d100942c3991320c38b433bbec4939 100644 (file)
@@ -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 )
index a16b7b772be83eb457b69d4ecb148d41c6b1ad13..d09a3b8b6eccde5e5fb812410af8f96eb730cd49 100644 (file)
@@ -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;
 
index 9d082dc1e3d22790f9df8c859c741514710ecb3e..ec476c1ecbd94bc5e5e0bcff22f147aa14979e70 100644 (file)
@@ -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
index c8ddfcdf42aa3950a07c38215f17a2ae20b91847..2f24209cf320db27f0b0394722ec97e1444fdc12 100644 (file)
@@ -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 ) );
             }