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

Fix clazy warning

parent 44c30f10
Pipeline #22974 failed with stage
in 66 minutes and 31 seconds
......@@ -241,7 +241,7 @@ void GoogleResourceMigrator::migrateNextAccount()
mMigrations.erase(mMigrations.begin());
if (instances.alreadyExists) {
message(Info, i18n("Google Groupware Resource for account %1 already exists, skipping.", account));
Q_EMIT message(Info, i18n("Google Groupware Resource for account %1 already exists, skipping.", account));
// Just to be sure, check that there are no left-over legacy instances
removeLegacyInstances(account, instances);
......@@ -251,15 +251,15 @@ void GoogleResourceMigrator::migrateNextAccount()
}
qCInfo(MIGRATION_LOG) << "GoogleResourceMigrator: starting migration of account" << account;
message(Info, i18n("Starting migration of account %1", account));
Q_EMIT message(Info, i18n("Starting migration of account %1", account));
qCInfo(MIGRATION_LOG) << "GoogleResourceMigrator: creating new" << akonadiGoogleGroupwareResource;
message(Info, i18n("Creating new instance of Google Gropware Resource"));
Q_EMIT message(Info, i18n("Creating new instance of Google Gropware Resource"));
auto job = new Akonadi::AgentInstanceCreateJob(akonadiGoogleGroupwareResource.toString(), this);
connect(job, &Akonadi::AgentInstanceCreateJob::finished,
this, [this, job, account, instances](KJob *) {
if (job->error()) {
qCWarning(MIGRATION_LOG) << "GoogleResourceMigrator: Failed to create new Google Groupware Resource:" << job->errorString();
message(Error, i18n("Failed to create a new Google Groupware Resource: %1", job->errorString()));
Q_EMIT message(Error, i18n("Failed to create a new Google Groupware Resource: %1", job->errorString()));
setMigrationState(MigratorBase::Failed);
return;
}
......@@ -267,7 +267,7 @@ void GoogleResourceMigrator::migrateNextAccount()
const auto newInstance = job->instance();
if (!migrateAccount(account, instances, newInstance)) {
qCWarning(MIGRATION_LOG) << "GoogleResourceMigrator: failed to migrate account" << account;
message(Error, i18n("Failed to migrate account %1", account));
Q_EMIT message(Error, i18n("Failed to migrate account %1", account));
setMigrationState(MigratorBase::Failed);
return;
}
......@@ -290,7 +290,7 @@ void GoogleResourceMigrator::migrateNextAccount()
<< instances.contactResource.identifier() << "to"
<< newInstance.identifier();
}
message(Success, i18n("Migrated account %1 to new Google Groupware Resource", account));
Q_EMIT message(Success, i18n("Migrated account %1 to new Google Groupware Resource", account));
++mMigrationsDone;
migrateNextAccount();
......
......@@ -262,7 +262,7 @@ EwsOAuthPrivate::EwsOAuthPrivate(EwsOAuth *parent, const QString &email, const Q
bool EwsOAuthPrivate::authenticate(bool interactive)
{
Q_Q(EwsOAuth);
//Q_Q(EwsOAuth);
qCInfoNC(EWSCLI_LOG) << QStringLiteral("Starting OAuth2 authentication");
......
......@@ -84,7 +84,7 @@ EwsMtaConfigDialog::~EwsMtaConfigDialog()
void EwsMtaConfigDialog::save()
{
if (!mUi->resourceWidget->selectedAgentInstances().isEmpty()) {
EwsMtaSettings::setEwsResource(mUi->resourceWidget->selectedAgentInstances().first().identifier());
EwsMtaSettings::setEwsResource(mUi->resourceWidget->selectedAgentInstances().constFirst().identifier());
mParentResource->setName(mUi->accountName->text());
EwsMtaSettings::self()->save();
} else {
......
......@@ -429,7 +429,7 @@ void ContactHandler::itemsUnlinked(const Item::List &items, const Collection &co
ContactsList contacts;
contacts.reserve(items.count());
std::transform(items.cbegin(), items.cend(), std::back_inserter(contacts),
[this, &collection](const Item &item){
[&collection](const Item &item){
ContactPtr contact(new Contact(item.payload<KContacts::Addressee>()));
contact->removeGroup(collection.remoteId());
return contact;
......
......@@ -175,5 +175,5 @@ bool GoogleResourceState::handleError(KGAPI2::Job *job, bool _cancelTask)
void GoogleResourceState::scheduleCustomTask(QObject *receiver, const char *method, const QVariant &argument)
{
return m_resource->scheduleCustomTask(receiver, method, argument);
m_resource->scheduleCustomTask(receiver, method, argument);
}
......@@ -97,7 +97,7 @@ void CompactPage::onCollectionFetchCompact(KJob *job)
return;
}
CollectionFetchJob *fetchJob = dynamic_cast<CollectionFetchJob *>(job);
CollectionFetchJob *fetchJob = qobject_cast<CollectionFetchJob *>(job);
Q_ASSERT(fetchJob);
Q_ASSERT(fetchJob->collections().size() == 1);
......
......@@ -879,7 +879,9 @@ void Pop3Test::testMixedLeaveRules()
// Generate 10 mails
//
QList<QByteArray> mails;
mails.reserve(10);
QStringList uids;
uids.reserve(10);
QString allowedRetrs;
for (int i = 0; i < 10; i++) {
QByteArray newMail = simpleMail1;
......
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