]> Git trees. - libqmvoc.git/commitdiff
Fix bugs when reading the inQuery attribute (no default value).
authorFrederik Gladhorn <gladhorn@kde.org>
Thu, 6 Sep 2007 13:42:06 +0000 (13:42 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Thu, 6 Sep 2007 13:42:06 +0000 (13:42 +0000)
Make copy ctor, operator=/== complete for the lesson class.

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

keduvocdocument/keduvockvtml2reader.cpp
keduvocdocument/keduvockvtmlreader.cpp
keduvocdocument/keduvoclesson.cpp

index 52e9e3cce3fb67df27d74c4ce4ed5ffedfd0d8cf..5890fb1be8ca924d4daa97542ceacda6b776ea4f 100644 (file)
@@ -449,9 +449,7 @@ bool KEduVocKvtml2Reader::readLesson( QDomElement &lessonElement )
 
     //<query>true</query>
     currentElement = lessonElement.firstChildElement( KVTML_QUERY );
-    if ( !currentElement.isNull() ) {
-        m_doc->lesson(lessonId).setInQuery(currentElement.text() == KVTML_TRUE);
-    }
+    m_doc->lesson(lessonId).setInQuery(currentElement.text() == KVTML_TRUE);
 
     //<current>true</current>
     currentElement = lessonElement.firstChildElement( KVTML_CURRENT );
index 03f5b96050a827bd90781d248c2641bb711d3be8..43af42ee00ce9ea1c836682dc665d84737ee7440 100644 (file)
@@ -237,10 +237,10 @@ bool KEduVocKvtmlReader::readLesson( QDomElement &domElementParent )
                 }
             }
 
-            bool inQuery;
+            bool inQuery = false;
             attribute = currentElement.attributeNode( KV_LESS_QUERY );
             if ( !attribute.isNull() ) {
-                inQuery =  attribute.value().toInt() != 0;
+                inQuery = (attribute.value().toInt() != 0);
             }
 
             s = currentElement.text();
index df3346fd47dfad8cb53eef9d2f16ae1ce8797791..665e7604848704aac653956b893f676bcb788035 100644 (file)
@@ -40,6 +40,7 @@ KEduVocLesson::KEduVocLesson( const KEduVocLesson &other )
 {
     d->m_entries = other.d->m_entries;
     d->m_name = other.d->m_name;
+    d->m_inQuery = other.d->m_inQuery;
 }
 
 KEduVocLesson::~KEduVocLesson()
@@ -51,12 +52,15 @@ KEduVocLesson& KEduVocLesson::operator= ( const KEduVocLesson &other )
 {
     d->m_entries = other.d->m_entries;
     d->m_name = other.d->m_name;
+    d->m_inQuery = other.d->m_inQuery;
     return *this;
 }
 
 bool KEduVocLesson::operator==(const KEduVocLesson &other)
 {
-    return d->m_entries == other.d->m_entries && d->m_name == other.d->m_name;
+    return d->m_entries == other.d->m_entries &&
+        d->m_name == other.d->m_name &&
+        d->m_inQuery == other.d->m_inQuery;;
 }
 
 void KEduVocLesson::setName( const QString &name )