diff --git a/autotests/importexportvcardtest.cpp b/autotests/importexportvcardtest.cpp --- a/autotests/importexportvcardtest.cpp +++ b/autotests/importexportvcardtest.cpp @@ -41,8 +41,8 @@ const QList outputLines = outputData.split('\n'); const QList outputRefLines = expected.split('\n'); for (int i = 0; i < qMin(outputLines.count(), outputRefLines.count()); ++i) { - const QByteArray actual = outputLines.at(i); - const QByteArray expect = outputRefLines.at(i); + const QByteArray &actual = outputLines.at(i); + const QByteArray &expect = outputRefLines.at(i); if (actual != expect) { qCritical() << "Mismatch at output line" << (i + 1); QCOMPARE(actual, expect); diff --git a/autotests/phonenumbertest.cpp b/autotests/phonenumbertest.cpp --- a/autotests/phonenumbertest.cpp +++ b/autotests/phonenumbertest.cpp @@ -198,7 +198,7 @@ KContacts::VCardTool vcard; const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata); QCOMPARE(lst.count(), 1); - KContacts::Addressee addr = lst.at(0); + const KContacts::Addressee &addr = lst.at(0); QCOMPARE(addr.phoneNumbers().count(), 1); KContacts::PhoneNumber number1 = addr.phoneNumbers().at(0); QCOMPARE(number1.number(), QLatin1String("+1-919-676-9564")); @@ -304,7 +304,7 @@ KContacts::VCardTool vcard; const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata); QCOMPARE(lst.count(), 1); - KContacts::Addressee addr = lst.at(0); + const KContacts::Addressee &addr = lst.at(0); QCOMPARE(addr.phoneNumbers().count(), 3); } @@ -325,7 +325,7 @@ KContacts::VCardTool vcard; const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata); QCOMPARE(lst.count(), 1); - KContacts::Addressee addr = lst.at(0); + const KContacts::Addressee &addr = lst.at(0); QCOMPARE(addr.phoneNumbers().count(), 3); } diff --git a/autotests/testroundtrip.cpp b/autotests/testroundtrip.cpp --- a/autotests/testroundtrip.cpp +++ b/autotests/testroundtrip.cpp @@ -107,8 +107,8 @@ const QList outputLines = outputData.split('\n'); const QList outputRefLines = outputRefData.split('\n'); for (int i = 0; i < qMin(outputLines.count(), outputRefLines.count()); ++i) { - const QByteArray actual = outputLines.at(i); - const QByteArray expect = outputRefLines.at(i); + const QByteArray &actual = outputLines.at(i); + const QByteArray &expect = outputRefLines.at(i); if (actual != expect) { qCritical() << "Mismatch in" << version << "output line" << (i + 1); QCOMPARE(actual, expect); diff --git a/src/converter/ldifconverter.cpp b/src/converter/ldifconverter.cpp --- a/src/converter/ldifconverter.cpp +++ b/src/converter/ldifconverter.cpp @@ -100,7 +100,7 @@ t << "objectclass: groupOfNames\n"; for (int i = 0; i < contactGroup.dataCount(); ++i) { - ContactGroup::Data data = contactGroup.data(i); + const ContactGroup::Data &data = contactGroup.data(i); const QString value = QStringLiteral("cn=%1,mail=%2").arg(data.name(), data.email()); ldif_out(t, QStringLiteral("member"), value); } diff --git a/src/generator/main.cpp b/src/generator/main.cpp --- a/src/generator/main.cpp +++ b/src/generator/main.cpp @@ -139,8 +139,9 @@ // we must sort exactly as we do this for lookup std::sort(processedList.begin(), processedList.end(), [](const Elem &lhs, const Elem &rhs) { const auto c = strcmp(lhs.name.constData(), rhs.name.constData()); - if (c == 0) + if (c == 0) { return lhs.isoCode < rhs.isoCode; + } return c < 0; }); diff --git a/src/picture.cpp b/src/picture.cpp --- a/src/picture.cpp +++ b/src/picture.cpp @@ -136,8 +136,8 @@ bool Picture::isEmpty() const { return - (d->mIntern == false && d->mUrl.isEmpty()) - || (d->mIntern == true && d->mData.isNull() && d->mRawData.isEmpty()); + (!d->mIntern && d->mUrl.isEmpty()) || + (d->mIntern && d->mData.isNull() && d->mRawData.isEmpty()); } void Picture::setUrl(const QString &url) diff --git a/tests/testread.cpp b/tests/testread.cpp --- a/tests/testread.cpp +++ b/tests/testread.cpp @@ -19,7 +19,6 @@ */ #include -#include #include