SVN commit 781415 by gladhorn: typos and const refs M +8 -8 practice/answervalidator.cpp M +3 -3 practice/answervalidator.h M +2 -3 settings/parleyprefs.h M +1 -1 vocabulary/vocabularymodel.cpp --- trunk/KDE/kdeedu/parley/src/practice/answervalidator.cpp #781414:781415 @@ -22,7 +22,7 @@ #include #include -/// temporary namespace for string manipulation fuctions +/// temporary namespace for string manipulation functions /// could move into KStringHandler eventually namespace ParleyStringHandler { QString stripAccents(const QString& original){ @@ -79,7 +79,7 @@ if ( !m_speller->isValid() ) { kDebug() << "No spellchecker for current language found: " << m_doc->identifier(m_translation).locale(); - kDebug() << "Avaliable dictionaries: " << m_speller->availableLanguages() + kDebug() << "Available dictionaries: " << m_speller->availableLanguages() << "\n names: " << m_speller->availableLanguageNames() << "\n backends: " << m_speller->availableBackends(); m_spellerAvailable = false; @@ -97,7 +97,7 @@ } } -int AnswerValidator::levenshteinDistance(QString s, QString t) +int AnswerValidator::levenshteinDistance(const QString& s, const QString& t) { int m = s.length(); int n = t.length(); @@ -139,7 +139,7 @@ return m_d[m + n*dWidth]; } -bool AnswerValidator::spellcheckerMisspelled(QString userAnswer) +bool AnswerValidator::spellcheckerMisspelled(const QString& userAnswer) { if (!m_spellerAvailable) { return true; @@ -147,7 +147,7 @@ return m_speller->isMisspelled(userAnswer); } -bool AnswerValidator::spellcheckerInSuggestionList(QString solution, QString userAnswer) +bool AnswerValidator::spellcheckerInSuggestionList(const QString& solution, const QString& userAnswer) { if ( !m_spellerAvailable ) { return false; @@ -302,7 +302,7 @@ void AnswerValidator::checkUserAnswer(const QString & solution, const QString & userAnswer, const QString& language) { -kDebug() << "CheckUserAnswer with two strings. The one string version is prefered."; +kDebug() << "CheckUserAnswer with two strings. The one string version is preferred."; if ( !language.isEmpty() ) { } else { @@ -350,7 +350,7 @@ errorTypes = TestEntry::SpellingMistake; return; } - // this is a different word but sounds similiar! + // this is a different word but sounds similar! if ( !isMisspelled && inSuggestions ) { grade = FALSE_FRIEND_GRADE; // htmlCorrection = QString::fromLatin1("NOOOO! That was a false friend! "); @@ -371,7 +371,7 @@ errorTypes = TestEntry::SpellingMistake; return; } else { -// htmlCorrection = QString::fromLatin1("I don't know that word and it is not similiar to the solution. "); +// htmlCorrection = QString::fromLatin1("I don't know that word and it is not similar to the solution. "); errorTypes = TestEntry::UnknownMistake; return; } --- trunk/KDE/kdeedu/parley/src/practice/answervalidator.h #781414:781415 @@ -76,11 +76,11 @@ * @param t * @return the Levenshtein Distance measure */ - int levenshteinDistance(QString s, QString t); + int levenshteinDistance(const QString& s, const QString& t); - bool spellcheckerMisspelled(QString s); + bool spellcheckerMisspelled(const QString& s); - bool spellcheckerInSuggestionList(QString solution, QString userAnswer); + bool spellcheckerInSuggestionList(const QString& solution, const QString& userAnswer); /** * Evaluate the closeness of two words. This is probably the most common case. --- trunk/KDE/kdeedu/parley/src/settings/parleyprefs.h #781414:781415 @@ -15,12 +15,11 @@ * * ***************************************************************************/ -#ifndef KVOCTRAINPREFS_H -#define KVOCTRAINPREFS_H +#ifndef PARLEYPREFS_H +#define PARLEYPREFS_H #include - /** *@author Peter Hedlund */ --- trunk/KDE/kdeedu/parley/src/vocabulary/vocabularymodel.cpp #781414:781415 @@ -105,7 +105,7 @@ if ( !m_container ) { return 0; } - // only the root index has children because we have no hierachical model. + // only the root index has children because we have no hierarchical model. if (index == QModelIndex()) { return m_container->entryCount(m_recursive); }