Commit 84bfa5c4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: we depend against c++17

parent f896763f
Pipeline #68617 skipped
......@@ -128,7 +128,7 @@ void CalendarBaseTest::cleanupTestCase()
void CalendarBaseTest::testItem()
{
for (const QString &uid : qAsConst(mUids)) {
for (const QString &uid : std::as_const(mUids)) {
const Item item1 = mCalendar->item(uid);
const Item item2 = mCalendar->item(item1.id());
QVERIFY(item1.isValid());
......
......@@ -166,7 +166,7 @@ void HistoryTest::testDeletion()
waitForSignals();
// Check that it doesn't exist anymore
for (const Akonadi::Item &item : qAsConst(items)) {
for (const Akonadi::Item &item : std::as_const(items)) {
QVERIFY(Helper::confirmDoesntExist(item));
}
......@@ -514,7 +514,7 @@ void HistoryTest::deleteFinished(int changeId,
qDebug() << "Error string is " << errorMessage;
} else {
QVERIFY(!deletedIds.isEmpty());
for (Akonadi::Item::Id id : qAsConst(deletedIds)) {
for (Akonadi::Item::Id id : std::as_const(deletedIds)) {
QVERIFY(id != -1);
}
}
......
......@@ -262,7 +262,7 @@ private Q_SLOTS:
if (expectedResultCode == IncidenceChanger::ResultCodeSuccess) {
// Check that the incidence was really deleted
for (const Akonadi::Item &item : qAsConst(items)) {
for (const Akonadi::Item &item : std::as_const(items)) {
auto fetchJob = new ItemFetchJob(item, this);
fetchJob->fetchScope().fetchFullPayload();
QVERIFY(!fetchJob->exec());
......@@ -1153,7 +1153,7 @@ public Q_SLOTS:
qDebug() << "Error string is " << errorMessage;
} else {
QVERIFY(!deletedIds.isEmpty());
for (Akonadi::Item::Id id : qAsConst(deletedIds)) {
for (Akonadi::Item::Id id : std::as_const(deletedIds)) {
QVERIFY(id != -1);
}
}
......
......@@ -102,7 +102,7 @@ void UnitTestBase::compareCalendars(const KCalendarCore::Calendar::Ptr &expected
const Incidence::List expectedIncidences = expectedCalendar->incidences();
// First, replace the randomly generated UIDs with the UID that came in the invitation e-mail...
for (const KCalendarCore::Incidence::Ptr &incidence : qAsConst(incidences)) {
for (const KCalendarCore::Incidence::Ptr &incidence : std::as_const(incidences)) {
incidence->setUid(incidence->schedulingID());
qDebug() << "We have incidece with uid=" << incidence->uid() << "; instanceidentifier=" << incidence->instanceIdentifier();
auto attendees = incidence->attendees();
......
......@@ -202,7 +202,7 @@ void CalendarClipboard::cutIncidence(const KCalendarCore::Incidence::Ptr &incide
d->getIncidenceHierarchy(incidence, uids);
Q_ASSERT(!uids.isEmpty());
KCalendarCore::Incidence::List incidencesToCut;
for (const QString &uid : qAsConst(uids)) {
for (const QString &uid : std::as_const(uids)) {
KCalendarCore::Incidence::Ptr child = d->m_calendar->incidence(uid);
if (child) {
incidencesToCut << child;
......@@ -239,7 +239,7 @@ bool CalendarClipboard::copyIncidence(const KCalendarCore::Incidence::Ptr &incid
QStringList uids;
d->getIncidenceHierarchy(incidence, uids);
Q_ASSERT(!uids.isEmpty());
for (const QString &uid : qAsConst(uids)) {
for (const QString &uid : std::as_const(uids)) {
KCalendarCore::Incidence::Ptr child = d->m_calendar->incidence(uid);
if (child) {
incidencesToCopy << child;
......
......@@ -606,7 +606,7 @@ bool ETMCalendar::isLoaded() const
return false;
}
for (const Akonadi::Collection &collection : qAsConst(d->mCollectionMap)) {
for (const Akonadi::Collection &collection : std::as_const(d->mCollectionMap)) {
if (!entityTreeModel()->isCollectionPopulated(collection.id())) {
return false;
}
......
......@@ -154,11 +154,11 @@ void History::Private::updateIds(Item::Id oldId, Item::Id newId)
{
mEntryInProgress->updateIds(oldId, newId);
for (const Entry::Ptr &entry : qAsConst(mUndoStack)) {
for (const Entry::Ptr &entry : std::as_const(mUndoStack)) {
entry->updateIds(oldId, newId);
}
for (const Entry::Ptr &entry : qAsConst(mRedoStack)) {
for (const Entry::Ptr &entry : std::as_const(mRedoStack)) {
entry->updateIds(oldId, newId);
}
}
......@@ -196,7 +196,7 @@ void History::Private::handleFinished(IncidenceChanger::ResultCode changerResult
// was in progress
if (!mQueuedEntries.isEmpty()) {
mRedoStack.clear();
for (const Entry::Ptr &entry : qAsConst(mQueuedEntries)) {
for (const Entry::Ptr &entry : std::as_const(mQueuedEntries)) {
mUndoStack.push(entry);
}
mQueuedEntries.clear();
......
......@@ -159,7 +159,7 @@ bool DeletionEntry::undo()
mErrorString.clear();
const bool useAtomicOperation = mItems.count() > 1;
bool success = true;
for (const Akonadi::Item &item : qAsConst(mItems)) {
for (const Akonadi::Item &item : std::as_const(mItems)) {
if (useAtomicOperation) {
mChanger->startAtomicOperation();
}
......@@ -318,7 +318,7 @@ bool MultiEntry::redo()
mOperationInProgress = TypeRedo;
Q_ASSERT(!mEntries.isEmpty());
mFinishedEntries = 0;
for (const Entry::Ptr &entry : qAsConst(mEntries)) {
for (const Entry::Ptr &entry : std::as_const(mEntries)) {
entry->doIt(TypeRedo);
}
mChanger->endAtomicOperation();
......
......@@ -211,7 +211,7 @@ bool ICalImporter::importIntoExistingResource(const QUrl &url, Akonadi::Collecti
const IncidenceChanger::DestinationPolicy policySaved = d->m_changer->destinationPolicy();
d->m_changer->startAtomicOperation(i18n("Merge ical file into existing calendar."));
d->m_changer->setDestinationPolicy(IncidenceChanger::DestinationPolicyNeverAsk);
for (const Incidence::Ptr &incidence : qAsConst(incidences)) {
for (const Incidence::Ptr &incidence : std::as_const(incidences)) {
Q_ASSERT(incidence);
if (!incidence) {
continue;
......
......@@ -469,7 +469,7 @@ void IncidenceChanger::Private::handleInvitationsBeforeChange(const Change::Ptr
connect(handler, &ITIPHandlerHelper::finished, change.data(), &Change::emitUserDialogClosedBeforeChange);
for (const Akonadi::Item &item : qAsConst(change->originalItems)) {
for (const Akonadi::Item &item : std::as_const(change->originalItems)) {
Q_ASSERT(item.hasPayload<KCalendarCore::Incidence::Ptr>());
Incidence::Ptr incidence = CalendarUtils::incidence(item);
if (!incidence->supportsGroupwareCommunication()) {
......@@ -579,7 +579,7 @@ void IncidenceChanger::Private::handleInvitationsAfterChange(const Change::Ptr &
handler->deleteLater();
handler = nullptr;
Q_ASSERT(!change->originalItems.isEmpty());
for (const Akonadi::Item &item : qAsConst(change->originalItems)) {
for (const Akonadi::Item &item : std::as_const(change->originalItems)) {
Q_ASSERT(item.hasPayload());
Incidence::Ptr incidence = CalendarUtils::incidence(item);
Q_ASSERT(incidence);
......@@ -831,7 +831,7 @@ void IncidenceChanger::Private::deleteIncidences2(int changeId, ITIPHandlerHelpe
}
mDeletedItemIds.reserve(mDeletedItemIds.count() + change->originalItems.count());
for (const Item &item : qAsConst(change->originalItems)) {
for (const Item &item : std::as_const(change->originalItems)) {
mDeletedItemIds << item.id();
}
......@@ -1273,7 +1273,7 @@ bool IncidenceChanger::Private::allowAtomicOperation(int atomicOperationId, cons
allow = !operation->m_itemIdsInOperation.contains(change->newItem.id());
} else if (change->type == ChangeTypeDelete) {
DeletionChange::Ptr deletion = change.staticCast<DeletionChange>();
for (Akonadi::Item::Id id : qAsConst(deletion->mItemIds)) {
for (Akonadi::Item::Id id : std::as_const(deletion->mItemIds)) {
if (operation->m_itemIdsInOperation.contains(id)) {
allow = false;
break;
......
......@@ -220,7 +220,7 @@ public:
{
if (change->type == IncidenceChanger::ChangeTypeDelete) {
DeletionChange::Ptr deletion = change.staticCast<DeletionChange>();
for (Akonadi::Item::Id id : qAsConst(deletion->mItemIds)) {
for (Akonadi::Item::Id id : std::as_const(deletion->mItemIds)) {
Q_ASSERT(!m_itemIdsInOperation.contains(id));
m_itemIdsInOperation.insert(id);
}
......
......@@ -472,7 +472,7 @@ void Scheduler::acceptReply(const IncidenceBase::Ptr &incidenceBase,
incidence->setAttendees(attendeesEv);
bool attendeeAdded = false;
for (const auto &attNew : qAsConst(attendeesNew)) {
for (const auto &attNew : std::as_const(attendeesNew)) {
QString msg = i18nc("@info", "%1 wants to attend %2 but was not invited.", attNew.fullName(), incidence->summary());
if (!attNew.delegator().isEmpty()) {
msg = i18nc("@info", "%1 wants to attend %2 on behalf of %3.", attNew.fullName(), incidence->summary(), attNew.delegator());
......
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