Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Akonadi Calendar
Commits
84bfa5c4
Commit
84bfa5c4
authored
Jul 05, 2021
by
Laurent Montel
Browse files
GIT_SILENT: we depend against c++17
parent
f896763f
Pipeline
#68617
skipped
Changes
12
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/calendarbasetest.cpp
View file @
84bfa5c4
...
...
@@ -128,7 +128,7 @@ void CalendarBaseTest::cleanupTestCase()
void
CalendarBaseTest
::
testItem
()
{
for
(
const
QString
&
uid
:
qAsC
onst
(
mUids
))
{
for
(
const
QString
&
uid
:
std
::
as_c
onst
(
mUids
))
{
const
Item
item1
=
mCalendar
->
item
(
uid
);
const
Item
item2
=
mCalendar
->
item
(
item1
.
id
());
QVERIFY
(
item1
.
isValid
());
...
...
autotests/historytest.cpp
View file @
84bfa5c4
...
...
@@ -166,7 +166,7 @@ void HistoryTest::testDeletion()
waitForSignals
();
// Check that it doesn't exist anymore
for
(
const
Akonadi
::
Item
&
item
:
qAsC
onst
(
items
))
{
for
(
const
Akonadi
::
Item
&
item
:
std
::
as_c
onst
(
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
:
qAsC
onst
(
deletedIds
))
{
for
(
Akonadi
::
Item
::
Id
id
:
std
::
as_c
onst
(
deletedIds
))
{
QVERIFY
(
id
!=
-
1
);
}
}
...
...
autotests/incidencechangertest.cpp
View file @
84bfa5c4
...
...
@@ -262,7 +262,7 @@ private Q_SLOTS:
if
(
expectedResultCode
==
IncidenceChanger
::
ResultCodeSuccess
)
{
// Check that the incidence was really deleted
for
(
const
Akonadi
::
Item
&
item
:
qAsC
onst
(
items
))
{
for
(
const
Akonadi
::
Item
&
item
:
std
::
as_c
onst
(
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
:
qAsC
onst
(
deletedIds
))
{
for
(
Akonadi
::
Item
::
Id
id
:
std
::
as_c
onst
(
deletedIds
))
{
QVERIFY
(
id
!=
-
1
);
}
}
...
...
autotests/unittestbase.cpp
View file @
84bfa5c4
...
...
@@ -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
:
qAsC
onst
(
incidences
))
{
for
(
const
KCalendarCore
::
Incidence
::
Ptr
&
incidence
:
std
::
as_c
onst
(
incidences
))
{
incidence
->
setUid
(
incidence
->
schedulingID
());
qDebug
()
<<
"We have incidece with uid="
<<
incidence
->
uid
()
<<
"; instanceidentifier="
<<
incidence
->
instanceIdentifier
();
auto
attendees
=
incidence
->
attendees
();
...
...
src/calendarclipboard.cpp
View file @
84bfa5c4
...
...
@@ -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
:
qAsC
onst
(
uids
))
{
for
(
const
QString
&
uid
:
std
::
as_c
onst
(
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
:
qAsC
onst
(
uids
))
{
for
(
const
QString
&
uid
:
std
::
as_c
onst
(
uids
))
{
KCalendarCore
::
Incidence
::
Ptr
child
=
d
->
m_calendar
->
incidence
(
uid
);
if
(
child
)
{
incidencesToCopy
<<
child
;
...
...
src/etmcalendar.cpp
View file @
84bfa5c4
...
...
@@ -606,7 +606,7 @@ bool ETMCalendar::isLoaded() const
return
false
;
}
for
(
const
Akonadi
::
Collection
&
collection
:
qAsC
onst
(
d
->
mCollectionMap
))
{
for
(
const
Akonadi
::
Collection
&
collection
:
std
::
as_c
onst
(
d
->
mCollectionMap
))
{
if
(
!
entityTreeModel
()
->
isCollectionPopulated
(
collection
.
id
()))
{
return
false
;
}
...
...
src/history.cpp
View file @
84bfa5c4
...
...
@@ -154,11 +154,11 @@ void History::Private::updateIds(Item::Id oldId, Item::Id newId)
{
mEntryInProgress
->
updateIds
(
oldId
,
newId
);
for
(
const
Entry
::
Ptr
&
entry
:
qAsC
onst
(
mUndoStack
))
{
for
(
const
Entry
::
Ptr
&
entry
:
std
::
as_c
onst
(
mUndoStack
))
{
entry
->
updateIds
(
oldId
,
newId
);
}
for
(
const
Entry
::
Ptr
&
entry
:
qAsC
onst
(
mRedoStack
))
{
for
(
const
Entry
::
Ptr
&
entry
:
std
::
as_c
onst
(
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
:
qAsC
onst
(
mQueuedEntries
))
{
for
(
const
Entry
::
Ptr
&
entry
:
std
::
as_c
onst
(
mQueuedEntries
))
{
mUndoStack
.
push
(
entry
);
}
mQueuedEntries
.
clear
();
...
...
src/history_p.cpp
View file @
84bfa5c4
...
...
@@ -159,7 +159,7 @@ bool DeletionEntry::undo()
mErrorString
.
clear
();
const
bool
useAtomicOperation
=
mItems
.
count
()
>
1
;
bool
success
=
true
;
for
(
const
Akonadi
::
Item
&
item
:
qAsC
onst
(
mItems
))
{
for
(
const
Akonadi
::
Item
&
item
:
std
::
as_c
onst
(
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
:
qAsC
onst
(
mEntries
))
{
for
(
const
Entry
::
Ptr
&
entry
:
std
::
as_c
onst
(
mEntries
))
{
entry
->
doIt
(
TypeRedo
);
}
mChanger
->
endAtomicOperation
();
...
...
src/icalimporter.cpp
View file @
84bfa5c4
...
...
@@ -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
:
qAsC
onst
(
incidences
))
{
for
(
const
Incidence
::
Ptr
&
incidence
:
std
::
as_c
onst
(
incidences
))
{
Q_ASSERT
(
incidence
);
if
(
!
incidence
)
{
continue
;
...
...
src/incidencechanger.cpp
View file @
84bfa5c4
...
...
@@ -469,7 +469,7 @@ void IncidenceChanger::Private::handleInvitationsBeforeChange(const Change::Ptr
connect
(
handler
,
&
ITIPHandlerHelper
::
finished
,
change
.
data
(),
&
Change
::
emitUserDialogClosedBeforeChange
);
for
(
const
Akonadi
::
Item
&
item
:
qAsC
onst
(
change
->
originalItems
))
{
for
(
const
Akonadi
::
Item
&
item
:
std
::
as_c
onst
(
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
:
qAsC
onst
(
change
->
originalItems
))
{
for
(
const
Akonadi
::
Item
&
item
:
std
::
as_c
onst
(
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
:
qAsC
onst
(
change
->
originalItems
))
{
for
(
const
Item
&
item
:
std
::
as_c
onst
(
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
:
qAsC
onst
(
deletion
->
mItemIds
))
{
for
(
Akonadi
::
Item
::
Id
id
:
std
::
as_c
onst
(
deletion
->
mItemIds
))
{
if
(
operation
->
m_itemIdsInOperation
.
contains
(
id
))
{
allow
=
false
;
break
;
...
...
src/incidencechanger_p.h
View file @
84bfa5c4
...
...
@@ -220,7 +220,7 @@ public:
{
if
(
change
->
type
==
IncidenceChanger
::
ChangeTypeDelete
)
{
DeletionChange
::
Ptr
deletion
=
change
.
staticCast
<
DeletionChange
>
();
for
(
Akonadi
::
Item
::
Id
id
:
qAsC
onst
(
deletion
->
mItemIds
))
{
for
(
Akonadi
::
Item
::
Id
id
:
std
::
as_c
onst
(
deletion
->
mItemIds
))
{
Q_ASSERT
(
!
m_itemIdsInOperation
.
contains
(
id
));
m_itemIdsInOperation
.
insert
(
id
);
}
...
...
src/scheduler_p.cpp
View file @
84bfa5c4
...
...
@@ -472,7 +472,7 @@ void Scheduler::acceptReply(const IncidenceBase::Ptr &incidenceBase,
incidence
->
setAttendees
(
attendeesEv
);
bool
attendeeAdded
=
false
;
for
(
const
auto
&
attNew
:
qAsC
onst
(
attendeesNew
))
{
for
(
const
auto
&
attNew
:
std
::
as_c
onst
(
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
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment