Commit 93927f22 authored by Laurent Montel's avatar Laurent Montel 😁

Fix some clazy warning

parent b2da0479
Pipeline #22501 passed with stage
in 38 minutes and 33 seconds
......@@ -267,7 +267,7 @@ void SieveActionWidget::setLocaleVariable(const SieveGlobalVariableActionWidget:
if (index != -1) {
mComboBox->setCurrentIndex(index);
slotActionChanged(index);
KSieveUi::SieveActionSetVariable *localVar = dynamic_cast<KSieveUi::SieveActionSetVariable *>(mActionList.at(index));
KSieveUi::SieveActionSetVariable *localVar = qobject_cast<KSieveUi::SieveActionSetVariable *>(mActionList.at(index));
if (localVar) {
localVar->setLocalVariable(this, var);
}
......
......@@ -41,7 +41,7 @@ public:
void updateAddRemoveButton(bool addButtonEnabled, bool removeButtonEnabled);
void generatedScript(QString &script, QStringList &required, bool onlyActions, bool inForEveryPartLoop);
Q_REQUIRED_RESULT void setAction(const QString &actionName, QXmlStreamReader &element, const QString &comment, QString &error);
void setAction(const QString &actionName, QXmlStreamReader &element, const QString &comment, QString &error);
Q_REQUIRED_RESULT bool isConfigurated() const;
void clear();
......
......@@ -154,12 +154,12 @@ void SieveDebugDialog::slotDiagNextScript()
return;
}
QString scriptFile = mScriptList.first();
QString scriptFile = mScriptList.constFirst();
mScriptList.pop_front();
mEdit->editor()->appendPlainText(i18n("Contents of script '%1':\n", scriptFile));
const KSieveUi::Util::AccountInfo info = KSieveUi::Util::fullAccountInfo(mResourceIdentifier.first(), mPasswordProvider);
const KSieveUi::Util::AccountInfo info = KSieveUi::Util::fullAccountInfo(mResourceIdentifier.constFirst(), mPasswordProvider);
mUrl = info.sieveUrl;
mUrl = mUrl.adjusted(QUrl::RemoveFilename);
......
......@@ -62,8 +62,8 @@ int main(int argc, char **argv)
}
//qDebug() << "scriptUtf8 = \"" + script +"\"";
KSieve::Parser sieveParser(script.begin(),
script.begin() + script.length());
KSieve::Parser sieveParser(script.constBegin(),
script.constBegin() + script.length());
KSieveUi::XMLPrintingScriptBuilder psb(1);
sieveParser.setScriptBuilder(&psb);
if (sieveParser.parse()) {
......
......@@ -182,7 +182,7 @@ void VacationCreateScriptJob::slotGotActiveScripts(ParseUserScriptJob *job)
}
mCreateJob = new GenerateGlobalScriptJob(mUrl, this);
mCreateJob->addUserActiveScripts(list);
connect(mCreateJob, &GenerateGlobalScriptJob::success, [=]() {
connect(mCreateJob, &GenerateGlobalScriptJob::success, this, [=]() {
this->slotGenerateDone();
});
connect(mCreateJob, &GenerateGlobalScriptJob::error, this, &VacationCreateScriptJob::slotGenerateDone);
......
......@@ -399,7 +399,7 @@ QString KSieveUi::VacationUtils::mergeRequireLine(const QString &script, const Q
req.sort();
lines.insert(insert, QStringLiteral("require [\"%1\"];").arg(req.join(QStringLiteral("\", \""))));
} else if (requirementscount == 1) {
lines.insert(insert, QStringLiteral("require \"%1\";").arg(requirements.values().at(0)));
lines.insert(insert, QStringLiteral("require \"%1\";").arg(requirements.values().constFirst()));
}
return lines.join(QLatin1Char('\n'));
......
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