Commit c036b728 authored by Laurent Montel's avatar Laurent Montel 😁

Other minor optimizations

parent 5ae567f6
......@@ -194,7 +194,8 @@ bool Scheduler::acceptRequest(const IncidenceBase::Ptr &incidence,
// So check the attendee status of the attendee.
const Attendee::List attendees = existingIncidence->attendees();
Attendee::List::ConstIterator ait;
for (ait = attendees.begin(); ait != attendees.end(); ++ait) {
const Attendee::List::ConstIterator aitEnd(attendees.end());
for (ait = attendees.begin(); ait != aitEnd; ++ait) {
if ((*ait)->email() == email && (*ait)->status() == Attendee::NeedsAction) {
// This incidence wasn't created by me - it's probably in a shared folder
// and meant for someone else, ignore it.
......@@ -315,7 +316,8 @@ bool Scheduler::acceptCancel(const IncidenceBase::Ptr &incidence,
bool isMine = true;
const Attendee::List attendees = i->attendees();
Attendee::List::ConstIterator ait;
for (ait = attendees.begin(); ait != attendees.end(); ++ait) {
const Attendee::List::ConstIterator aitEnd(attendees.end());
for (ait = attendees.begin(); ait != aitEnd; ++ait) {
if ((*ait)->email() == attendee &&
(*ait)->status() == Attendee::NeedsAction) {
// This incidence wasn't created by me - it's probably in a shared
......
......@@ -85,10 +85,7 @@ QString Stringify::incidenceSecrecy(Incidence::Secrecy secrecy)
QStringList Stringify::incidenceSecrecyList()
{
QStringList list;
list << incidenceSecrecy(Incidence::SecrecyPublic);
list << incidenceSecrecy(Incidence::SecrecyPrivate);
list << incidenceSecrecy(Incidence::SecrecyConfidential);
const QStringList list {incidenceSecrecy(Incidence::SecrecyPublic), incidenceSecrecy(Incidence::SecrecyPrivate), incidenceSecrecy(Incidence::SecrecyConfidential)};
return list;
}
......
......@@ -63,7 +63,7 @@ bool VCalDrag::fromMimeData(const QMimeData *de,
}
bool success = false;
QByteArray payload = de->data(mimeType());
const QByteArray payload = de->data(mimeType());
if (!payload.isEmpty()) {
const QString txt = QString::fromUtf8(payload.data());
......
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