Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 14554669 authored by Rahul Chowdhury's avatar Rahul Chowdhury

Update deprecated code for accessing libkeduvocdocument

REVIEW:122186
parent 54ccfd8a
......@@ -560,7 +560,7 @@ void EntryFilter::cleanupInvalid(int setNo)
(((*i)->translation(m_toTranslation)->wordType()->wordType() != KEduVocWordFlag::Adjective)
&& ((*i)->translation(m_toTranslation)->wordType()->wordType() != KEduVocWordFlag::Adverb))
// at least one comparison forms is there
|| ((*i)->translation(m_toTranslation)->comparative().isEmpty() || (*i)->translation(m_toTranslation)->superlative().isEmpty())) {
|| ((*i)->translation(m_toTranslation)->comparativeForm().text().isEmpty() || (*i)->translation(m_toTranslation)->superlativeForm().text().isEmpty())) {
i = m_entries[setNo].erase(i);
continue;
}
......
......@@ -60,8 +60,8 @@ void ComparisonWidget::setTranslation(KEduVocExpression * entry, int translation
comparativeLineEdit->setEnabled(true);
superlativeLineEdit->setEnabled(true);
comparativeLineEdit->setText(m_translation->comparative());
superlativeLineEdit->setText(m_translation->superlative());
comparativeLineEdit->setText(m_translation->comparativeForm().text());
superlativeLineEdit->setText(m_translation->superlativeForm().text());
}
}
} else {
......@@ -115,10 +115,10 @@ void ComparisonWidget::setDocument(KEduVocDocument * doc)
void ComparisonWidget::slotComparativeChanged()
{
m_translation->setComparative(comparativeLineEdit->text());
m_translation->setComparativeForm(comparativeLineEdit->text());
}
void ComparisonWidget::slotSuperlativeChanged()
{
m_translation->setSuperlative(superlativeLineEdit->text());
m_translation->setSuperlativeForm(superlativeLineEdit->text());
}
......@@ -40,8 +40,8 @@ bool ComparisonBackendMode::setTestEntry(TestEntry* current)
m_frontend->setQuestion(m_current->entry()->translation(languageFrom)->text());
QStringList answers;
answers.append(m_current->entry()->translation(languageTo)->text());
answers.append(m_current->entry()->translation(languageTo)->comparative());
answers.append(m_current->entry()->translation(languageTo)->superlative());
answers.append(m_current->entry()->translation(languageTo)->comparativeForm().text());
answers.append(m_current->entry()->translation(languageTo)->superlativeForm().text());
m_frontend->setSolution(answers);
m_frontend->setQuestionSound(m_current->entry()->translation(m_current->languageFrom())->soundUrl());
......@@ -63,8 +63,8 @@ void ComparisonBackendMode::checkAnswer()
}
bool absoluteCorrect = answers.at(0) == m_current->entry()->translation(m_current->languageTo())->text();
bool comparativeCorrect = answers.at(1) == m_current->entry()->translation(m_current->languageTo())->comparative();
bool superlativeCorrect = answers.at(2) == m_current->entry()->translation(m_current->languageTo())->superlative();
bool comparativeCorrect = answers.at(1) == m_current->entry()->translation(m_current->languageTo())->comparativeForm().text();
bool superlativeCorrect = answers.at(2) == m_current->entry()->translation(m_current->languageTo())->superlativeForm().text();
if (absoluteCorrect && comparativeCorrect && superlativeCorrect) {
m_frontend->setFeedback(i18n("All comparison forms were right."));
......@@ -100,8 +100,8 @@ void ComparisonBackendMode::updateGrades()
QStringList answers = m_frontend->userInput().toStringList();
bool absoluteCorrect = answers.at(0) == m_current->entry()->translation(m_current->languageTo())->text();
bool comparativeCorrect = answers.at(1) == m_current->entry()->translation(m_current->languageTo())->comparative();
bool superlativeCorrect = answers.at(2) == m_current->entry()->translation(m_current->languageTo())->superlative();
bool comparativeCorrect = answers.at(1) == m_current->entry()->translation(m_current->languageTo())->comparativeForm().text();
bool superlativeCorrect = answers.at(2) == m_current->entry()->translation(m_current->languageTo())->superlativeForm().text();
// TODO way too much duplicated code here
......
......@@ -186,16 +186,16 @@ public:
* Comparison forms of adjectives/adverbs.
*/
QString comparative() const {
return m_translation->comparative();
return m_translation->comparativeForm().text();
}
void setComparative(const QString& comparative) {
m_translation->setComparative(comparative);
m_translation->setComparativeForm(comparative);
}
QString superlative() const {
return m_translation->superlative();
return m_translation->superlativeForm().text();
}
void setSuperlative(const QString& superlative) {
m_translation->setSuperlative(superlative);
m_translation->setSuperlativeForm(superlative);
}
/* sets multiple choice
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment