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