Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 3b814d18 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 279e408d
......@@ -46,14 +46,14 @@ void EwsAutodiscoveryJob::start()
void EwsAutodiscoveryJob::parseEmail()
{
int atIndex = mEmail.indexOf(QLatin1Char('@'));
const int atIndex = mEmail.indexOf(QLatin1Char('@'));
if (atIndex < 0) {
setErrorMsg(i18n("Incorrect email address"));
emitResult();
return;
}
QString domain = mEmail.mid(atIndex + 1);
const QString domain = mEmail.mid(atIndex + 1);
if (domain.isEmpty()) {
setErrorMsg(i18n("Incorrect email address"));
emitResult();
......
......@@ -57,11 +57,11 @@ EwsConfigDialog::EwsConfigDialog(EwsResource *parentResource, EwsClient &client,
KWindowSystem::setMainWindow(this, wId);
}
mButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout();
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
mButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = mButtonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
......@@ -345,7 +345,7 @@ void EwsResource::retrieveItems(const Collection &collection)
job->setQueuedUpdates(mQueuedUpdates.value(collection.remoteId()));
mQueuedUpdates.remove(collection.remoteId());
connect(job, &EwsFetchItemsJob::result, this, &EwsResource::itemFetchJobFinished);
connect(job, &EwsFetchItemsJob::status, this, [this](int s, const QString & message) {
connect(job, &EwsFetchItemsJob::status, this, [this](int s, const QString &message) {
Q_EMIT status(s, message);
});
connect(job, &EwsFetchItemsJob::percent, this, [this](int p) {
......
......@@ -92,7 +92,7 @@ void EwsFetchMailDetailJob::processItems(const QList<EwsGetItemRequest::Response
v = ewsItem[EwsItemFieldToRecipients];
if (Q_LIKELY(v.isValid())) {
const EwsMailbox::List mboxList = v.value<EwsMailbox::List>();
Q_FOREACH (const EwsMailbox &mbox, mboxList) {
for (const EwsMailbox &mbox : mboxList) {
msg->to()->addAddress(mbox);
}
}
......
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