Commit 401df599 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port foreach/emit

parent fa9a7f9e
......@@ -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
......
......@@ -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);
}
}
......
......@@ -185,7 +185,7 @@ public Q_SLOTS:
void slotTriggered()
{
// trigger();
emit slotActivated(phrase);
Q_EMIT slotActivated(phrase);
}
Q_SIGNALS:
......
......@@ -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;
foreach (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);
}
......
......@@ -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;
......
......@@ -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);
}
}
}
......
......@@ -68,7 +68,7 @@ private Q_SLOTS:
*/
void configChanged()
{
emit changed(true);
Q_EMIT changed(true);
}
private:
......
Markdown is supported
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