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

Clean some clazy warning

parent 66e21b25
Pipeline #23074 passed with stage
in 53 minutes and 44 seconds
......@@ -22,8 +22,6 @@
#include <ImportWizard/AbstractSettings>
class QSettings;
class NylasMailSettings : public AbstractSettings
{
public:
......@@ -35,7 +33,6 @@ private:
void readIdentity();
void readGlobalSettings();
void readTransport();
QSettings *settings = nullptr;
};
#endif // ClawsMailSettings_H
......@@ -206,7 +206,7 @@ static const QStringList assignedCategoriesSorted(const KContacts::AddresseeList
void GMXImportExportPluginInterface::doExport(QFile *fp, const KContacts::AddresseeList &list) const
{
if (!fp || !list.count()) {
if (!fp || list.isEmpty()) {
return;
}
......
......@@ -302,7 +302,8 @@ KContacts::Addressee::List VCardImportExportPluginInterface::filterContacts(cons
if (exportFieldType & KAddressBookImportExport::KAddressBookExportSelectionWidget::Other) {
QStringList exportFields;
for (const QString &customStr : (*it).customs()) {
const QStringList customs = (*it).customs();
for (const QString &customStr : customs) {
if (!customStr.startsWith(QLatin1String("X-GCALENDAR-groupMembershipInfo"))) {
exportFields.append(customStr);
}
......
......@@ -65,6 +65,7 @@ MergeContactWidgetTest::MergeContactWidgetTest()
Akonadi::Item::List MergeContactWidgetTest::createItems()
{
Akonadi::Item::List lst;
lst.reserve(10);
for (int i = 0; i < 10; ++i) {
Akonadi::Item item(i);
KContacts::Addressee address;
......
......@@ -33,7 +33,7 @@ void MailSenderJobTest::shouldNotSendSignalWhenWeDontSelectItem()
{
Akonadi::Item::List lst;
KABMailSender::MailSenderJob mailsender(lst);
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
QSignalSpy spy(&mailsender, &KABMailSender::MailSenderJob::sendMails);
mailsender.start();
QCOMPARE(spy.count(), 0);
}
......@@ -44,7 +44,7 @@ void MailSenderJobTest::shouldNotSendSignalWhenNoValidAddressItem()
Akonadi::Item item;
lst << item;
KABMailSender::MailSenderJob mailsender(lst);
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
QSignalSpy spy(&mailsender, &KABMailSender::MailSenderJob::sendMails);
mailsender.start();
QCOMPARE(spy.count(), 0);
}
......@@ -58,7 +58,7 @@ void MailSenderJobTest::shouldNotSendSignalWhenNoEmails()
item.setPayload<KContacts::Addressee>(address);
lst << item;
KABMailSender::MailSenderJob mailsender(lst);
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
QSignalSpy spy(&mailsender, &KABMailSender::MailSenderJob::sendMails);
mailsender.start();
QCOMPARE(spy.count(), 0);
}
......@@ -73,7 +73,7 @@ void MailSenderJobTest::shouldSendSignalWhenOneEmail()
item.setPayload<KContacts::Addressee>(address);
lst << item;
KABMailSender::MailSenderJob mailsender(lst);
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
QSignalSpy spy(&mailsender, &KABMailSender::MailSenderJob::sendMails);
mailsender.start();
QCOMPARE(spy.count(), 1);
const QStringList resultLst = spy.at(0).at(0).toStringList();
......@@ -90,7 +90,7 @@ void MailSenderJobTest::shouldNotSendTwiceEmails()
item.setPayload<KContacts::Addressee>(address);
lst << item << item;
KABMailSender::MailSenderJob mailsender(lst);
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
QSignalSpy spy(&mailsender, &KABMailSender::MailSenderJob::sendMails);
mailsender.start();
const QStringList resultLst = spy.at(0).at(0).toStringList();
QCOMPARE(resultLst.count(), 1);
......@@ -107,7 +107,7 @@ void MailSenderJobTest::shouldNotAddInvalidEmail()
item.setPayload<KContacts::Addressee>(address);
lst << item;
KABMailSender::MailSenderJob mailsender(lst);
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
QSignalSpy spy(&mailsender, &KABMailSender::MailSenderJob::sendMails);
mailsender.start();
QCOMPARE(spy.count(), 0);
}
......@@ -145,7 +145,7 @@ void MailSenderJobTest::shouldEmitSignalIfThereIsAValidEmail()
lst << item4;
KABMailSender::MailSenderJob mailsender(lst);
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
QSignalSpy spy(&mailsender, &KABMailSender::MailSenderJob::sendMails);
mailsender.start();
QCOMPARE(spy.count(), 1);
const QStringList resultLst = spy.at(0).at(0).toStringList();
......
......@@ -35,6 +35,7 @@ QStringList GrammalecteGrammarError::parseSuggestion(const QJsonObject &obj)
QStringList lst;
const QJsonArray array = obj[QStringLiteral("aSuggestions")].toArray();
const QVariantList list = array.toVariantList();
lst.reserve(list.count());
for (const QVariant &v : list) {
//qDebug() << " v" << v.toString();
lst.append(v.toString());
......@@ -50,7 +51,7 @@ QColor GrammalecteGrammarError::parseColor(const QJsonObject &obj)
return col;
}
if (array.count() == 3) {
const QVariantList list = array.toVariantList();
//const QVariantList list = array.toVariantList();
// for (const QVariant &v : list) {
// qDebug() << " v" << v.toInt();
// }
......
......@@ -69,8 +69,8 @@ void LanguageToolGetListOfLanguageJob::slotCheckListOfLanguagesFinished()
if (reply) {
const QByteArray data = reply->readAll();
Q_EMIT finished(QString::fromUtf8(data));
reply->deleteLater();
}
reply->deleteLater();
deleteLater();
}
......
......@@ -100,8 +100,8 @@ void LanguageToolResultJob::slotCheckGrammarFinished()
if (reply) {
const QByteArray data = reply->readAll();
Q_EMIT finished(QString::fromUtf8(data));
reply->deleteLater();
}
reply->deleteLater();
deleteLater();
}
......
......@@ -23,7 +23,7 @@
#include <QDialog>
#include "adblocklib_export.h"
namespace AdBlock {
struct AdBlockResult;
class AdBlockResult;
class AdBlockBlockableItemsWidget;
class ADBLOCKLIB_EXPORT AdBlockBlockableItemsDialog : public QDialog
{
......
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