Commit e061509b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix cppcheck warning

parent 611747b0
......@@ -209,11 +209,11 @@ KSieveUi::Util::AccountInfo KSieveUi::Util::findAccountInfo(const QString &ident
const QString resultCustomAuthentication = interface->sieveCustomAuthentification();
if (resultCustomAuthentication == QLatin1String("ImapUserPassword")) {
u.setUserName(interface->userName());
const QString pwd = provider->password(identifier);
u.setPassword(pwd);
const QString imapPwd = provider->password(identifier);
u.setPassword(imapPwd);
} else if (resultCustomAuthentication == QLatin1String("CustomUserPassword")) {
const QString pwd = provider->sieveCustomPassword(identifier);
u.setPassword(pwd);
const QString customPwd = provider->sieveCustomPassword(identifier);
u.setPassword(customPwd);
u.setUserName(interface->sieveCustomUsername());
} else {
qCWarning(LIBKSIEVE_LOG) << "resultCustomAuthentication undefined " << resultCustomAuthentication;
......
......@@ -121,9 +121,8 @@ void VacationCreateScriptJob::slotGetScript(KManageSieve::SieveJob *job, bool su
Q_UNUSED(active)
Q_ASSERT(job == mSieveJob);
mSieveJob = nullptr;
QString script = mScript;
if (success || !oldScript.trimmed().isEmpty()) {
script = VacationUtils::mergeRequireLine(oldScript, mScript);
QString script = VacationUtils::mergeRequireLine(oldScript, mScript);
script = VacationUtils::updateVacationBlock(oldScript, script);
}
if (mKep14Support) {
......
......@@ -100,7 +100,7 @@ VacationEditWidget::VacationEditWidget(QWidget *parent)
mStartTime = new KTimeComboBox(this);
mStartTime->setObjectName(QStringLiteral("mStartTime"));
mStartTime->setOptions(KTimeComboBox::EditTime | KTimeComboBox::SelectTime | KTimeComboBox::EditTime | KTimeComboBox::WarnOnInvalid);
mStartTime->setOptions(KTimeComboBox::EditTime | KTimeComboBox::SelectTime | KTimeComboBox::WarnOnInvalid);
mStartTime->setEnabled(false); // Disable by default - we need an extension to support this
connect(mStartTime, &KTimeComboBox::timeChanged, this, &VacationEditWidget::setWasChanged);
connect(mStartTime, &KTimeComboBox::timeEdited, this, &VacationEditWidget::setWasChanged);
......@@ -131,7 +131,7 @@ VacationEditWidget::VacationEditWidget(QWidget *parent)
mEndTime = new KTimeComboBox(this);
mEndTime->setObjectName(QStringLiteral("mEndTime"));
mEndTime->setOptions(KTimeComboBox::EditTime | KTimeComboBox::SelectTime | KTimeComboBox::EditTime | KTimeComboBox::WarnOnInvalid);
mEndTime->setOptions(KTimeComboBox::EditTime | KTimeComboBox::SelectTime | KTimeComboBox::WarnOnInvalid);
mEndTime->setEnabled(false); // Disable by default - we need an extension to support this
connect(mEndTime, &KTimeComboBox::timeChanged, this, &VacationEditWidget::setWasChanged);
connect(mEndTime, &KTimeComboBox::timeEdited, this, &VacationEditWidget::setWasChanged);
......
......@@ -205,10 +205,10 @@ VacationUtils::Vacation VacationUtils::parseScript(const QString &script)
if (!vacation.active && !vdx.ifComment().isEmpty()) {
const QByteArray newScript = QByteArrayLiteral("if ") + vdx.ifComment().toUtf8() + QByteArrayLiteral("{vacation;}");
tsb = KSieveExt::MultiScriptBuilder(&sdx, &drdx, &dx);
KSieve::Parser parser(newScript.begin(),
KSieve::Parser activeScriptParser(newScript.begin(),
newScript.begin() + newScript.length());
parser.setScriptBuilder(&tsb);
if (!parser.parse()) {
activeScriptParser.setScriptBuilder(&tsb);
if (!activeScriptParser.parse()) {
vacation.valid = false;
return vacation;
}
......
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