Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Parley
Commits
6431930f
Commit
6431930f
authored
Aug 29, 2021
by
Andreas Cord-Landwehr
Browse files
Minor code improvements
parent
10cf6ea4
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/editor/vocabularydelegate.cpp
View file @
6431930f
...
...
@@ -29,7 +29,7 @@ using namespace Editor;
VocabularyDelegate
::
VocabularyDelegate
(
QObject
*
parent
)
:
QItemDelegate
(
parent
)
,
m_translator
(
0
)
,
m_translator
(
nullptr
)
{
}
...
...
src/scripts/scripting/translation.cpp
View file @
6431930f
...
...
@@ -24,10 +24,6 @@ Translation::Translation(KEduVocTranslation *translation)
{
}
Translation
::~
Translation
()
{
}
QString
Translation
::
wordType
()
const
{
if
(
m_translation
->
wordType
())
...
...
src/scripts/scripting/translation.h
View file @
6431930f
...
...
@@ -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
;
...
...
src/scripts/translator.cpp
View file @
6431930f
...
...
@@ -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
);
...
...
src/scripts/translator.h
View file @
6431930f
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment