Commit 6431930f authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Minor code improvements

parent 10cf6ea4
......@@ -29,7 +29,7 @@ using namespace Editor;
VocabularyDelegate::VocabularyDelegate(QObject *parent)
: QItemDelegate(parent)
, m_translator(0)
, m_translator(nullptr)
{
}
......
......@@ -24,10 +24,6 @@ Translation::Translation(KEduVocTranslation *translation)
{
}
Translation::~Translation()
{
}
QString Translation::wordType() const
{
if (m_translation->wordType())
......
......@@ -5,14 +5,12 @@
#ifndef SCRIPTINGSCRIPTOBJECTTRANSLATION_H
#define SCRIPTINGSCRIPTOBJECTTRANSLATION_H
#include <KEduVocConjugation>
#include <KEduVocDeclension>
#include "expression.h"
#include "text.h"
#include <KEduVocConjugation>
#include <KEduVocDeclension>
#include <KEduVocTranslation>
#include <KEduVocWordtype>
#include <QObject>
namespace Scripting
......@@ -61,8 +59,6 @@ public:
*/
explicit Translation(KEduVocTranslation *translation);
~Translation();
KEduVocTranslation *kEduVocTranslation()
{
return m_translation;
......
......@@ -4,27 +4,18 @@
*/
#include "translator.h"
#include "scripting/parley.h"
#include <QDebug>
Translator::Translator()
: m_parent(nullptr)
{
}
Translator::Translator(QObject *parent)
: m_parent(parent)
{
}
Translator::~Translator()
{
}
void Translator::addTranslation(const QString &word, const QString &fromLanguage, const QString &toLanguage, const QString &translation)
{
if (word.trimmed() == QLatin1String(""))
if (word.trimmed().isEmpty()) {
return;
}
QString t = word + fromLanguage + toLanguage;
qDebug() << "Translation for " << word << "in cache: " << m_translations.contains(t);
......
......@@ -64,10 +64,7 @@ Keeps the translated words
class Translator
{
public:
Translator();
explicit Translator(QObject *parent);
~Translator();
explicit Translator(QObject *parent = nullptr);
/**
* Stores the translation of @p word from language @p fromLanguage, to language @p toLanguage.
......
Supports Markdown
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