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
02ffbb49
Commit
02ffbb49
authored
Aug 28, 2021
by
Andreas Cord-Landwehr
Browse files
Fix several trivial clazy warnings
parent
cd96c580
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/collection/vocabularymimedata.cpp
View file @
02ffbb49
...
...
@@ -29,7 +29,8 @@ void VocabularyMimeData::setTranslations(const QList<KEduVocTranslation *> &tran
// copy word types
// this sucks but there is not really a better was. copying pointers is not a good idea because copy and paste can be done between different documents.
for
(
int
i
:
expression
->
translationIndices
())
{
const
QList
<
int
>
translationIndices
=
expression
->
translationIndices
();
for
(
int
i
:
translationIndices
)
{
// generate text string representation
m_text
.
append
(
expression
->
translation
(
i
)
->
text
());
m_text
.
append
(
" - "
);
...
...
src/editor/conjugationwidget.cpp
View file @
02ffbb49
...
...
@@ -53,8 +53,7 @@ ConjugationWidget::ConjugationWidget(QWidget *parent)
void
ConjugationWidget
::
textChanged
(
const
QString
&
text
)
{
int
valueIndex
=
m_conjugationLineEdits
.
values
().
indexOf
(
qobject_cast
<
QLineEdit
*>
(
sender
()));
int
key
=
m_conjugationLineEdits
.
keys
().
value
(
valueIndex
);
int
key
=
m_conjugationLineEdits
.
key
(
qobject_cast
<
QLineEdit
*>
(
sender
()));
KEduVocTranslation
*
translation
=
m_entry
->
translation
(
m_identifier
);
KEduVocConjugation
conjugation
=
translation
->
getConjugation
(
tenseComboBox
->
currentText
());
conjugation
.
setConjugation
(
text
,
(
KEduVocWordFlag
::
Flags
)
key
);
...
...
src/editor/declensionwidget.cpp
View file @
02ffbb49
...
...
@@ -40,8 +40,7 @@ DeclensionWidget::DeclensionWidget(QWidget *parent)
void
DeclensionWidget
::
textChanged
(
const
QString
&
text
)
{
int
valueIndex
=
m_DeclensionLineEdits
.
values
().
indexOf
(
qobject_cast
<
QLineEdit
*>
(
sender
()));
int
key
=
m_DeclensionLineEdits
.
keys
().
value
(
valueIndex
)
|
currentAdditionalWordFlag
();
int
key
=
m_DeclensionLineEdits
.
key
(
qobject_cast
<
QLineEdit
*>
(
sender
()))
|
currentAdditionalWordFlag
();
m_entry
->
translation
(
m_identifier
)
->
declension
()
->
setDeclension
(
text
,
(
KEduVocWordFlag
::
Flags
)
key
);
emit
sigModified
();
}
...
...
src/editor/vocabularyview.cpp
View file @
02ffbb49
...
...
@@ -317,7 +317,7 @@ void VocabularyView::slotEditPaste()
qDebug
()
<<
"Clipboard contains text data."
;
// split at newline
QStringList
lines
=
clipboard
->
text
().
split
(
'\n'
);
for
(
QString
line
:
qAsConst
(
lines
))
{
for
(
const
QString
&
line
:
qAsConst
(
lines
))
{
// split at tabs or semicolon:
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
m_model
->
appendEntry
(
new
KEduVocExpression
(
line
.
split
(
QRegExp
(
QStringLiteral
(
"[
\t
;]"
)),
QString
::
KeepEmptyParts
)));
...
...
src/practice/abstractfrontend.h
View file @
02ffbb49
...
...
@@ -84,7 +84,7 @@ public Q_SLOTS:
virtual
void
showSynonym
()
=
0
;
/** switch between different modes such as written, flash card, etc */
virtual
void
setMode
(
Mode
mode
)
=
0
;
virtual
void
setMode
(
Practise
::
AbstractFrontend
::
Mode
mode
)
=
0
;
virtual
void
setBoxes
(
grade_t
currentBox
,
grade_t
newBoxIfCorrect
,
grade_t
newBoxIfWrong
)
=
0
;
Q_SIGNALS:
...
...
src/settings/languagepropertiespage.cpp
View file @
02ffbb49
...
...
@@ -344,10 +344,10 @@ void LanguagePropertiesPage::slotNewTense()
{
bool
ok
;
QString
getTense
=
QInputDialog
::
getText
(
this
,
i18n
(
"Tense Name"
),
i18n
(
"Enter name of tense:"
),
QLineEdit
::
Normal
,
QString
(),
&
ok
);
if
(
!
ok
)
if
(
!
ok
)
{
return
;
}
QString
str
;
int
i
=
tenseList
->
count
()
+
1
;
tenseList
->
addItem
(
QStringLiteral
(
"%1"
).
arg
(
i
,
2
).
append
(
TENSE_TAG
).
append
(
getTense
.
simplified
()));
tenseIndex
.
append
(
-
(
i
-
1
));
...
...
@@ -390,7 +390,7 @@ void LanguagePropertiesPage::slotDeleteTense()
if
(
tenseList
->
count
()
>
0
&&
(
int
)
tenseList
->
count
()
>
act
)
{
QString
t
=
tenseList
->
item
(
act
)
->
text
();
QList
<
KEduVocExpression
*>
entries
=
m_doc
->
lesson
()
->
entries
(
KEduVocLesson
::
Recursive
);
const
QList
<
KEduVocExpression
*>
entries
=
m_doc
->
lesson
()
->
entries
(
KEduVocLesson
::
Recursive
);
for
(
KEduVocExpression
*
exp
:
entries
)
{
for
(
int
lang
=
0
;
lang
<
m_doc
->
identifierCount
();
lang
++
)
{
if
(
exp
->
translation
(
lang
)
->
conjugationTenses
().
contains
(
t
))
{
...
...
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