Commit 6bc45dca authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

fix shadow variables etc.

parent 2730222f
Pipeline #83156 passed with stage
in 45 minutes and 8 seconds
......@@ -196,7 +196,6 @@ void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content,
if (combined) {
QCOMPARE(nh->signatureState(resultMessage.data()), MimeTreeParser::KMMsgFullySigned);
} else {
QVector<KMime::Content *> extra = nh->extraContents(resultMessage.data());
QCOMPARE(extra.size(), 1);
QCOMPARE(nh->signatureState(extra[0]), MimeTreeParser::KMMsgFullySigned);
}
......
......@@ -245,9 +245,9 @@ void SignEncryptTest::testProtectedHeaders()
{
QByteArray plainText;
auto job = QGpgME::openpgp()->decryptVerifyJob();
auto result = job->exec(encPart->encodedBody(), plainText);
auto jobResult = job->exec(encPart->encodedBody(), plainText);
auto signature = result.second.signatures()[0];
auto signature = jobResult.second.signatures()[0];
QCOMPARE(signature.fingerprint(), "1BA323932B3FAA826132C79E8D9860C58F246DE6");
QCOMPARE(signature.status().code(), 0);
......
......@@ -146,7 +146,6 @@ bool RichTextComposerSignatures::replaceSignature(const KIdentityManagement::Sig
}
// Select the signature
QTextCursor cursor(d->richTextComposer->document());
cursor.setPosition(currentMatch);
// If the new signature is completely empty, we also want to remove the
......
......@@ -550,7 +550,7 @@ MessageFactoryNG::createRedirect(const QString &toStr, const QString &ccStr, con
const bool fccIsDisabled = ident.disabledFcc();
if (fccIsDisabled) {
auto header = new KMime::Headers::Generic("X-KMail-FccDisabled");
header = new KMime::Headers::Generic("X-KMail-FccDisabled");
header->fromUnicodeString(QStringLiteral("true"), "utf-8");
msg->setHeader(header);
} else {
......
......@@ -91,8 +91,8 @@ void SaveContactPreferenceJob::slotSearchContact(KJob *job)
item.setPayload<KContacts::Addressee>(contact);
auto job = new Akonadi::ItemModifyJob(item);
connect(job, &Akonadi::ContactSearchJob::result, this, &SaveContactPreferenceJob::slotModifyCreateItem);
auto itemModifyJob = new Akonadi::ItemModifyJob(item);
connect(itemModifyJob, &Akonadi::ContactSearchJob::result, this, &SaveContactPreferenceJob::slotModifyCreateItem);
}
}
......
......@@ -274,9 +274,9 @@ QString ConvertSnippetVariablesJob::getLastNameFromEmail(const QString &address)
const QStringList lst = address.split(QStringLiteral(", "));
QStringList resultName;
for (const QString &str : lst) {
KMime::Types::Mailbox address;
address.fromUnicodeString(KEmailAddress::normalizeAddressesAndEncodeIdn(str));
const QString lastName = TemplateParser::Util::getLastNameFromEmail(address.name());
KMime::Types::Mailbox newAddress;
newAddress.fromUnicodeString(KEmailAddress::normalizeAddressesAndEncodeIdn(str));
const QString lastName = TemplateParser::Util::getLastNameFromEmail(newAddress.name());
if (!lastName.isEmpty()) {
resultName << lastName;
}
......
......@@ -549,7 +549,7 @@ QString smartQuote(const QString &msg, int maxLineLength)
if (lineStart == 0) {
line = msg;
needToContinue = false;
} else if (lineStart != 0 && lineStart != msg.length()) {
} else if (lineStart != msg.length()) {
line = msg.mid(lineStart, msg.length() - lineStart);
needToContinue = false;
} else {
......@@ -650,13 +650,13 @@ QString formatQuotePrefix(const QString &wildString, const QString &fromDisplayS
}
int j = 0;
const int strLength(fromDisplayString.length());
for (; j < strLength && fromDisplayString[j] > QLatin1Char(' '); ++j) { }
for (; j < strLength && fromDisplayString[j] <= QLatin1Char(' '); ++j) { }
const int strLengthFromDisplayString(fromDisplayString.length());
for (; j < strLengthFromDisplayString && fromDisplayString[j] > QLatin1Char(' '); ++j) { }
for (; j < strLengthFromDisplayString && fromDisplayString[j] <= QLatin1Char(' '); ++j) { }
result += fromDisplayString[0];
if (j < strLength && fromDisplayString[j] > QLatin1Char(' ')) {
if (j < strLengthFromDisplayString && fromDisplayString[j] > QLatin1Char(' ')) {
result += fromDisplayString[j];
} else if (strLength > 1) {
} else if (strLengthFromDisplayString > 1) {
if (fromDisplayString[1] > QLatin1Char(' ')) {
result += fromDisplayString[1];
}
......
......@@ -519,17 +519,17 @@ static Theme::Column *add_theme_simple_text_column(Theme *s,
c->addMessageRow(r);
if (addGroupHeaderItem) {
auto r = new Theme::Row();
auto row = new Theme::Row();
auto i = new Theme::ContentItem(type);
auto iRow = new Theme::ContentItem(type);
if (alignRight) {
r->addRightItem(i);
row->addRightItem(iRow);
} else {
r->addLeftItem(i);
row->addLeftItem(iRow);
}
c->addGroupHeaderRow(r);
c->addGroupHeaderRow(row);
}
s->addColumn(c);
......
......@@ -33,8 +33,8 @@ void QuickSearchWarning::setSearchText(const QString &text)
if (!MessageList::MessageListSettings::quickSearchWarningDoNotShowAgain()) {
const QStringList lstText = text.split(QLatin1Char(' '), Qt::SkipEmptyParts);
bool foundLessThanThreeCharacters = false;
for (const QString &text : lstText) {
if (text.trimmed().size() < 3) {
for (const QString &splitText : lstText) {
if (splitText.trimmed().size() < 3) {
foundLessThanThreeCharacters = true;
break;
}
......
......@@ -69,11 +69,11 @@ void ContactDisplayMessageMemento::slotSearchJobFinished(KJob *job)
}
} else {
QByteArray imageData;
KIO::TransferJob *job = KIO::get(url, KIO::NoReload);
QObject::connect(job, &KIO::TransferJob::data, [&imageData](KIO::Job *, const QByteArray &data) {
KIO::TransferJob *jobTransfert = KIO::get(url, KIO::NoReload);
QObject::connect(jobTransfert, &KIO::TransferJob::data, [&imageData](KIO::Job *, const QByteArray &data) {
imageData.append(data);
});
if (job->exec()) {
if (jobTransfert->exec()) {
if (image.loadFromData(imageData)) {
ok = true;
}
......
......@@ -689,9 +689,9 @@ bool AttachmentURLHandler::handleShiftClick(const QUrl &url, ViewerPrivate *wind
item.setPayload<KMime::Message::Ptr>(message);
Akonadi::MessageFlags::copyMessageFlags(*message, item);
item.setMimeType(KMime::Message::mimeType());
QUrl url;
if (MessageViewer::Util::saveMessageInMboxAndGetUrl(url, Akonadi::Item::List() << item, window->viewer())) {
window->viewer()->showOpenAttachmentFolderWidget(QList<QUrl>() << url);
QUrl newUrl;
if (MessageViewer::Util::saveMessageInMboxAndGetUrl(newUrl, Akonadi::Item::List() << item, window->viewer())) {
window->viewer()->showOpenAttachmentFolderWidget(QList<QUrl>() << newUrl);
}
} else {
QList<QUrl> urlList;
......
......@@ -539,9 +539,7 @@ void ViewerPrivate::showAttachmentPopup(KMime::Content *node, const QString &nam
connect(action, &QAction::triggered, this, [this]() {
slotHandleAttachment(Viewer::Open);
});
if (!deletedAttachment) {
createOpenWithMenu(&menu, contentTypeStr, true);
}
createOpenWithMenu(&menu, contentTypeStr, true);
QMimeDatabase mimeDb;
auto mimetype = mimeDb.mimeTypeForName(contentTypeStr);
......
......@@ -286,10 +286,10 @@ QVector<Removal> CreatePhishingUrlDataBaseJobPrivate::parseRemovals(const QVaria
while (rawIndicesIt.hasNext()) {
rawIndicesIt.next();
if (rawIndicesIt.key() == QLatin1String("indices")) {
const QVariantList lst = rawIndicesIt.value().toList();
const QVariantList rawList = rawIndicesIt.value().toList();
QList<quint32> indexList;
indexList.reserve(lst.count());
for (const QVariant &var : lst) {
indexList.reserve(rawList.count());
for (const QVariant &var : rawList) {
indexList.append(var.toUInt());
}
tmp.indexes = indexList;
......
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