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
Accessibility
KMouth
Commits
401df599
Commit
401df599
authored
May 19, 2021
by
Laurent Montel
😁
Browse files
Port foreach/emit
parent
fa9a7f9e
Changes
7
Hide whitespace changes
Inline
Side-by-side
optionsdialog.cpp
View file @
401df599
...
...
@@ -184,7 +184,7 @@ void OptionsDialog::slotOk()
commandWidget
->
ok
();
behaviourWidget
->
ok
();
completionWidget
->
save
();
emit
configurationChanged
();
Q_EMIT
configurationChanged
();
}
void
OptionsDialog
::
slotApply
()
...
...
@@ -193,7 +193,7 @@ void OptionsDialog::slotApply()
commandWidget
->
ok
();
behaviourWidget
->
ok
();
completionWidget
->
save
();
emit
configurationChanged
();
Q_EMIT
configurationChanged
();
}
TextToSpeechSystem
*
OptionsDialog
::
getTTSSystem
()
const
...
...
phrasebook/phrasebook.cpp
View file @
401df599
...
...
@@ -377,12 +377,12 @@ StandardBookList PhraseBook::standardPhraseBooks()
QStringList
bookPaths
;
const
QStringList
dirs
=
QStandardPaths
::
locateAll
(
QStandardPaths
::
AppDataLocation
,
QStringLiteral
(
"books"
),
QStandardPaths
::
LocateDirectory
);
Q_FOREACH
(
const
QString
&
dir
,
dirs
)
{
for
(
const
QString
&
dir
:
dirs
)
{
const
QStringList
locales
=
QDir
(
dir
).
entryList
(
QDir
::
Dirs
|
QDir
::
NoDotAndDotDot
);
Q_FOREACH
(
const
QString
&
locale
,
locales
)
{
for
(
const
QString
&
locale
:
locales
)
{
const
QStringList
fileNames
=
QDir
(
dir
+
QLatin1Char
(
'/'
)
+
locale
).
entryList
(
QStringList
()
<<
QStringLiteral
(
"*.phrasebook"
));
Q_FOREACH
(
const
QString
&
file
,
fileNames
)
{
for
(
const
QString
&
file
:
fileNames
)
{
bookPaths
.
append
(
dir
+
QLatin1Char
(
'/'
)
+
locale
+
QLatin1Char
(
'/'
)
+
file
);
}
}
...
...
phrasebook/phrasebook.h
View file @
401df599
...
...
@@ -185,7 +185,7 @@ public Q_SLOTS:
void
slotTriggered
()
{
// trigger();
emit
slotActivated
(
phrase
);
Q_EMIT
slotActivated
(
phrase
);
}
Q_SIGNALS:
...
...
phrasebook/phrasebookdialog.cpp
View file @
401df599
...
...
@@ -70,7 +70,7 @@ StandardPhraseBookInsertAction::~StandardPhraseBookInsertAction()
void
StandardPhraseBookInsertAction
::
slotActivated
()
{
emit
slotActivated
(
url
);
Q_EMIT
slotActivated
(
url
);
}
...
...
@@ -537,9 +537,9 @@ void PhraseBookDialog::slotCut()
void
PhraseBookDialog
::
slotCopy
()
{
QList
<
QModelIndex
>
selected
=
m_ui
->
treeView
->
selectionModel
()
->
selectedRows
();
const
QList
<
QModelIndex
>
selected
=
m_ui
->
treeView
->
selectionModel
()
->
selectedRows
();
QString
xml
;
for
each
(
const
QModelIndex
index
,
selected
)
{
for
(
const
QModelIndex
index
:
selected
)
{
xml
+=
serializeBook
(
index
);
}
QMimeData
*
data
=
new
QMimeData
();
...
...
@@ -622,7 +622,7 @@ void PhraseBookDialog::slotSave()
file
.
open
(
QIODevice
::
WriteOnly
);
file
.
write
(
serializeBook
(
QModelIndex
()).
toUtf8
());
file
.
close
();
emit
phrasebookConfirmed
();
Q_EMIT
phrasebookConfirmed
();
phrasebookChanged
=
false
;
fileSave
->
setEnabled
(
false
);
}
...
...
wordcompletion/wordcompletion.cpp
View file @
401df599
...
...
@@ -155,8 +155,8 @@ void WordCompletion::configure()
d
->
blockCurrentListSignal
=
true
;
setWordList
(
d
->
current
);
d
->
blockCurrentListSignal
=
false
;
emit
wordListsChanged
(
wordLists
());
emit
currentListChanged
(
d
->
current
);
Q_EMIT
wordListsChanged
(
wordLists
());
Q_EMIT
currentListChanged
(
d
->
current
);
}
bool
WordCompletion
::
setWordList
(
const
QString
&
wordlist
)
...
...
@@ -197,7 +197,7 @@ bool WordCompletion::setWordList(const QString &wordlist)
file
.
close
();
}
if
(
!
d
->
blockCurrentListSignal
)
emit
currentListChanged
(
d
->
current
);
Q_EMIT
currentListChanged
(
d
->
current
);
d
->
lastText
.
clear
();
d
->
wordsToSave
=
false
;
return
result
;
...
...
wordcompletion/wordcompletionwidget.cpp
View file @
401df599
...
...
@@ -250,7 +250,7 @@ void WordCompletionWidget::nameChanged(const QString &text)
QStandardItem
*
newItem
=
new
QStandardItem
(
text
);
newItem
->
setData
(
nameItem
->
data
());
model
->
setItem
(
dictionaryView
->
currentIndex
().
row
(),
0
,
newItem
);
emit
changed
(
true
);
Q_EMIT
changed
(
true
);
}
}
}
...
...
@@ -266,7 +266,7 @@ void WordCompletionWidget::languageSelected()
if
(
old
!=
text
)
{
QStandardItem
*
newItem
=
new
QStandardItem
(
text
);
model
->
setItem
(
dictionaryView
->
currentIndex
().
row
(),
1
,
newItem
);
emit
changed
(
true
);
Q_EMIT
changed
(
true
);
}
}
}
...
...
wordcompletion/wordcompletionwidget.h
View file @
401df599
...
...
@@ -68,7 +68,7 @@ private Q_SLOTS:
*/
void
configChanged
()
{
emit
changed
(
true
);
Q_EMIT
changed
(
true
);
}
private:
...
...
Write
Preview
Markdown
is supported
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