diff --git a/.gitmodules b/.gitmodules index d47c9bc..e6235d5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "upstream"] path = upstream - url = git://invent.kde.org/frameworks/kcalendarcore + url = https://git.sailfishos.org/mirror/kcalendarcore.git diff --git a/rpm/0004-Avoid-forIncidences-template-in-deleteIncidenceInsta.patch b/rpm/0004-Avoid-forIncidences-template-in-deleteIncidenceInsta.patch new file mode 100644 index 0000000..508da3c --- /dev/null +++ b/rpm/0004-Avoid-forIncidences-template-in-deleteIncidenceInsta.patch @@ -0,0 +1,44 @@ +From cdc65b0c4fd5e76e97a5e732b4bd2e7f953c39a2 Mon Sep 17 00:00:00 2001 +From: Bea Lam +Date: Thu, 17 Dec 2020 16:16:15 +1000 +Subject: [PATCH] Avoid forIncidences() template in deleteIncidenceInstances() + +This causes the incidences list to be modified by deleteIncidence() +during the loop, which can cause a crash. +--- + src/memorycalendar.cpp | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/src/memorycalendar.cpp b/src/memorycalendar.cpp +index 78e3665a9..ef1546c4f 100644 +--- a/src/memorycalendar.cpp ++++ b/src/memorycalendar.cpp +@@ -240,16 +240,19 @@ bool MemoryCalendar::deleteIncidence(const Incidence::Ptr &incidence) + + bool MemoryCalendar::deleteIncidenceInstances(const Incidence::Ptr &incidence) + { +- d->forIncidences(d->mIncidences[incidence->type()], incidence->uid(), [this](const Incidence::Ptr &incidence) { +- if (incidence->hasRecurrenceId()) { ++ auto instances = d->mIncidences[incidence->type()]; ++ auto end = instances.cend(); ++ for (auto it = instances.constFind(incidence->uid()); it != end && it.key() == incidence->uid(); ++it) { ++ if (it.value()->hasRecurrenceId()) { + qCDebug(KCALCORE_LOG) << "deleting child" +- << ", type=" << int(incidence->type()) +- << ", uid=" << incidence->uid() ++ << ", type=" << int(it.value()->type()) ++ << ", uid=" << it.value()->uid() + // << ", start=" << i->dtStart() + << " from calendar"; +- deleteIncidence(incidence); ++ ++ deleteIncidence(it.value()); + } +- }); ++ } + + return true; + } +-- +2.24.3 (Apple Git-128) + diff --git a/rpm/kf5-calendarcore.spec b/rpm/kf5-calendarcore.spec index ab82ac6..0da12d3 100644 --- a/rpm/kf5-calendarcore.spec +++ b/rpm/kf5-calendarcore.spec @@ -17,6 +17,7 @@ BuildRequires: extra-cmake-modules >= 5.75.0 Patch1: 0001-Use-UTC-times-when-calculating-the-transition-dates-.patch Patch2: 0002-Adjust-for-lower-Qt-versions.patch Patch3: 0003-Add-pkgconfig-packaging.patch +Patch4: 0004-Avoid-forIncidences-template-in-deleteIncidenceInsta.patch %description KDE Framework calendar core library diff --git a/upstream b/upstream index 4f00cd7..1ee30f1 160000 --- a/upstream +++ b/upstream @@ -1 +1 @@ -Subproject commit 4f00cd753948f9d5a89f44b8639b9d1c0a0a230e +Subproject commit 1ee30f17a5eb884c03e46507be92fb471096a2ea