Commit 75d48462 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some cppcheck warnings

parent 367eed99
Pipeline #105968 passed with stage
in 7 minutes and 53 seconds
......@@ -19,10 +19,10 @@ using namespace MailTransport;
StoreResultJob::StoreResultJob(const Item &item, bool success, const QString &message, QObject *parent)
: TransactionSequence(parent)
, mItem(item)
, mSuccess(success)
, mMessage(message)
{
mItem = item;
mSuccess = success;
mMessage = message;
}
StoreResultJob::~StoreResultJob() = default;
......
......@@ -62,7 +62,7 @@ int main(int argc, char **argv)
}
auto migrator = new GidMigrator(mimeType);
if (infoDialog && migrator) {
if (infoDialog) {
infoDialog->migratorAdded();
QObject::connect(migrator, &MigratorBase::message, infoDialog, qOverload<MigratorBase::MessageType, const QString &>(&InfoDialog::message));
QObject::connect(migrator, &QObject::destroyed, infoDialog, &InfoDialog::migratorDone);
......
......@@ -168,8 +168,8 @@ void ConfigDialog::onSearchButtonClicked()
if (result == QDialog::Accepted && !dlg.isNull()) {
const QStringList results = dlg->selection();
for (const QString &result : results) {
const QStringList split = result.split(QLatin1Char('|'));
for (const QString &resultStr : results) {
const QStringList split = resultStr.split(QLatin1Char('|'));
KDAV::Protocol protocol = KDAV::ProtocolInfo::protocolByName(split.at(0));
if (!Settings::self()->urlConfiguration(protocol, split.at(1))) {
auto urlConfig = new Settings::UrlConfiguration();
......
......@@ -153,8 +153,8 @@ bool EwsFindFolderResponse::parseRootFolder(QXmlStreamReader &reader)
EwsFolder *folder = readFolder(reader);
reader.readNextStartElement();
if (folder) {
bool ok;
int childCount = (*folder)[EwsFolderFieldChildFolderCount].toUInt(&ok);
bool okInt;
int childCount = (*folder)[EwsFolderFieldChildFolderCount].toUInt(&okInt);
if (childCount > 0) {
unsigned readCount = readChildFolders(*folder, childCount, reader);
if (readCount == 0) {
......
......@@ -28,7 +28,7 @@ public:
}
protected:
Response(QXmlStreamReader &reader);
explicit Response(QXmlStreamReader &reader);
EwsId mId;
......
......@@ -370,7 +370,7 @@ private Q_SLOTS:
}
if (!expectedRoots.isEmpty()) {
int i = expectedRoots.indexOf("INBOX");
int index = expectedRoots.indexOf("INBOX");
QVERIFY(collection.hasAttribute<Akonadi::ImapQuotaAttribute>());
QCOMPARE(collection.attribute<Akonadi::ImapQuotaAttribute>()->roots(), expectedRoots);
......@@ -378,9 +378,9 @@ private Q_SLOTS:
QCOMPARE(collection.attribute<Akonadi::ImapQuotaAttribute>()->usages(), expectedUsages);
QVERIFY(collection.hasAttribute<Akonadi::CollectionQuotaAttribute>());
if (i != -1) {
QCOMPARE(collection.attribute<Akonadi::CollectionQuotaAttribute>()->currentValue(), expectedUsages.at(i)["STORAGE"] * 1024);
QCOMPARE(collection.attribute<Akonadi::CollectionQuotaAttribute>()->maximumValue(), expectedLimits.at(i)["STORAGE"] * 1024);
if (index != -1) {
QCOMPARE(collection.attribute<Akonadi::CollectionQuotaAttribute>()->currentValue(), expectedUsages.at(index)["STORAGE"] * 1024);
QCOMPARE(collection.attribute<Akonadi::CollectionQuotaAttribute>()->maximumValue(), expectedLimits.at(index)["STORAGE"] * 1024);
} else {
QCOMPARE(collection.attribute<Akonadi::CollectionQuotaAttribute>()->currentValue(), expectedUsages.first()["STORAGE"] * 1024);
QCOMPARE(collection.attribute<Akonadi::CollectionQuotaAttribute>()->maximumValue(), expectedLimits.first()["STORAGE"] * 1024);
......
......@@ -99,7 +99,6 @@ KContacts::Addressee addresseeFromKolab(const QByteArray &xmlData, const KMime::
const QString &soundAttachmentName = contact.soundAttachmentName();
if (!soundAttachmentName.isEmpty()) {
QByteArray type;
KMime::Content *content = Mime::findContentByName(data, soundAttachmentName /*"sound"*/, type);
if (content) {
const QByteArray &sData = content->decodedContent();
......
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