forked from pool/kcalendarcore
KDE Frameworks 5.112.0. Public release next weekend
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kcalendarcore?expand=0&rev=96
This commit is contained in:
parent
a5e066579e
commit
a42691f3ce
@ -1,92 +0,0 @@
|
||||
From e73b2e4863c589a8b152327ff7c45831d1d1b052 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org>
|
||||
Date: Fri, 13 Oct 2023 17:50:08 +0200
|
||||
Subject: [PATCH] ICalFormat: don't shift all-day invite dates to UTC
|
||||
|
||||
When generating scheduling message for an event, the ICalFormat
|
||||
checks whether the event is recurrent and if not it shifts the
|
||||
start and end datetimes to UTC timezone (since recurring events
|
||||
need TZ information for proper calculations across DSTs and TZs).
|
||||
|
||||
However if the event is an all-day event with start and end datetimes
|
||||
in local time (e.g. Europe/Prague), this shift effectively moves
|
||||
the start and end datetimes from midnight to -2 hours previous day.
|
||||
Later on when writing the DTSTART and DTEND properties, the code
|
||||
omits the time (since it's an all-day event) and only writes out
|
||||
DATEs, but now the scheduling message is actually shifted one day
|
||||
back!
|
||||
|
||||
This change extends the check in ICalFormat to also avoid shifting
|
||||
dates to UTC when the event is an all-day event, since in this case
|
||||
the timezone information is dropped anyway.
|
||||
|
||||
BUG: 421400
|
||||
FIXED-IN: 5.112.0
|
||||
(cherry picked from commit 921e04f64921e86288e57144c82dab2a1a0679b5)
|
||||
---
|
||||
autotests/testicalformat.cpp | 24 ++++++++++++++++++++++++
|
||||
autotests/testicalformat.h | 1 +
|
||||
src/icalformat.cpp | 2 +-
|
||||
3 files changed, 26 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/autotests/testicalformat.cpp b/autotests/testicalformat.cpp
|
||||
index c8f3fddb3..54ba2c3cd 100644
|
||||
--- a/autotests/testicalformat.cpp
|
||||
+++ b/autotests/testicalformat.cpp
|
||||
@@ -542,4 +542,28 @@ void ICalFormatTest::testNonTextCustomProperties()
|
||||
QCOMPARE(event->nonKDECustomProperty("X-APPLE-STRUCTURED-LOCATION"), QLatin1String("geo:52.063921,5.128511"));
|
||||
}
|
||||
|
||||
+void ICalFormatTest::testAllDaySchedulingMessage()
|
||||
+{
|
||||
+ auto event = KCalendarCore::Event::Ptr::create();
|
||||
+ event->setSummary(QStringLiteral("All Day Event"));
|
||||
+ event->setDtStart(QDateTime(QDate(2023, 10, 13), QTime(0, 0, 0), QTimeZone("Europe/Prague")));
|
||||
+ event->setDtEnd(QDateTime(QDate(2023, 10, 15), QTime(0, 0, 0), QTimeZone("Europe/Prague")));
|
||||
+ event->setOrganizer(Person(QStringLiteral("Dan"), QStringLiteral("dvratil@example.com")));
|
||||
+ event->addAttendee(Attendee(QStringLiteral("Konqi"), QStringLiteral("konqi@example.com")));
|
||||
+ event->setAllDay(true);
|
||||
+
|
||||
+ ICalFormat format;
|
||||
+ auto calendar = MemoryCalendar::Ptr::create(QTimeZone::utc());
|
||||
+ const auto itipString = format.createScheduleMessage(event, KCalendarCore::iTIPRequest);
|
||||
+ QVERIFY(!itipString.isEmpty());
|
||||
+
|
||||
+ auto scheduleMsg = format.parseScheduleMessage(calendar, itipString);
|
||||
+ QVERIFY(scheduleMsg->error().isEmpty());
|
||||
+
|
||||
+ auto parsedEvent = scheduleMsg->event().staticCast<KCalendarCore::Event>();
|
||||
+ QVERIFY(parsedEvent);
|
||||
+ QCOMPARE(parsedEvent->dtStart().date(), event->dtStart().date());
|
||||
+ QCOMPARE(parsedEvent->dtEnd().date(), event->dtEnd().date());
|
||||
+}
|
||||
+
|
||||
#include "moc_testicalformat.cpp"
|
||||
diff --git a/autotests/testicalformat.h b/autotests/testicalformat.h
|
||||
index 14d86a56c..7c0423459 100644
|
||||
--- a/autotests/testicalformat.h
|
||||
+++ b/autotests/testicalformat.h
|
||||
@@ -32,6 +32,7 @@ private Q_SLOTS:
|
||||
void testUidGenerationUniqueness();
|
||||
void testIcalFormat();
|
||||
void testNonTextCustomProperties();
|
||||
+ void testAllDaySchedulingMessage();
|
||||
};
|
||||
|
||||
#endif
|
||||
diff --git a/src/icalformat.cpp b/src/icalformat.cpp
|
||||
index 71fd91a19..72a35a0ad 100644
|
||||
--- a/src/icalformat.cpp
|
||||
+++ b/src/icalformat.cpp
|
||||
@@ -436,7 +436,7 @@ QString ICalFormat::createScheduleMessage(const IncidenceBase::Ptr &incidence, i
|
||||
|
||||
// Recurring events need timezone information to allow proper calculations
|
||||
// across timezones with different DST.
|
||||
- const bool useUtcTimes = !i->recurs();
|
||||
+ const bool useUtcTimes = !i->recurs() && !i->allDay();
|
||||
|
||||
const bool hasSchedulingId = (i->schedulingID() != i->uid());
|
||||
|
||||
--
|
||||
2.42.0
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:466cc27087421fcb171f599ecd291e6fca41f7aaa2b4d593d0bde3dc8b30aaa1
|
||||
size 269388
|
@ -1,11 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAABCgAdFiEEU+a0e0XOo+DVt0V3WNDuZIpIs7sFAmUhNyoACgkQWNDuZIpI
|
||||
s7vSuAf/Uuy9W1VbAU2QcccaqUEwLJCg4PppRGA5pc4dlTJeSZtwMdFQqJmdEfav
|
||||
x0UDGrlS0GIGUX+tww7tvNy4zAoj3yuUOUpcQlbGXtMZo+afhxmVNMH6XFsSFvmW
|
||||
rfz9hThABYf8qE63Cki5eTbds4tw8zmKM1CFyuzz+DstkNNsW9bM3XqUf958j8/B
|
||||
Ad8ePqmGiKU1fR+5QYE2WFEyN4pfvpj6edoIfKDurNnoSrbizny6mnOKaaQR+7Ox
|
||||
Jg4RAtUCjGL22QOnq0VC5y+OcNVOw9jcNpwnj79UYCtkf2v5zWakSS+yDirivWkt
|
||||
99WW9uNP8ifYrf1y7GDpCQGrnZOTmw==
|
||||
=EdEo
|
||||
-----END PGP SIGNATURE-----
|
3
kcalendarcore-5.112.0.tar.xz
Normal file
3
kcalendarcore-5.112.0.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:191875bd1d29a33adf79cca3a7991d4fc47cf6d877564a4c2d8b7a4a467a5259
|
||||
size 267900
|
11
kcalendarcore-5.112.0.tar.xz.sig
Normal file
11
kcalendarcore-5.112.0.tar.xz.sig
Normal file
@ -0,0 +1,11 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAABCgAdFiEEU+a0e0XOo+DVt0V3WNDuZIpIs7sFAmVGGukACgkQWNDuZIpI
|
||||
s7t0fggAsoPBLNonRJ6OVj8aRtrTMo88zmNFX9BblX/l/ufHzO+isvA0qWNDi23i
|
||||
7iKdDUhhrTsF3br2TfhCjwX2MKPX7d6WGLLgtLzaDscZvy2nixIYa6X4tjTK4EEC
|
||||
+wXuDw39yJvGZpOG7p7cAwdqdvimc+zaiStPVVgN8H4MPgGK8hXT2ihQ3Di9jOFi
|
||||
378emONfEEwV9gB03IndOb27yEOXxP75q4NGPeerPaVdeN7W5IFClrS62OpgFiB+
|
||||
10hRefk1yixIayjb05ZlXwMDDCtTJZLtsEGvrfFXHIMn9EDM48tGulO16OJ/FYUb
|
||||
GrhaFIH2Fp50SddOZqdaHvPVpDjicw==
|
||||
=V7Af
|
||||
-----END PGP SIGNATURE-----
|
@ -1,3 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 6 09:13:44 UTC 2023 - Christophe Marin <christophe@krop.fr>
|
||||
|
||||
- Update to 5.112.0
|
||||
* New feature release
|
||||
* For more details please see:
|
||||
* https://kde.org/announcements/frameworks/5/5.112.0
|
||||
- Changes since 5.111.0:
|
||||
* ICalFormat: don't shift all-day invite dates to UTC (kde#421400)
|
||||
- Drop patch, merged upstream:
|
||||
* 0001-ICalFormat-don-t-shift-all-day-invite-dates-to-UTC.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 20 13:19:47 UTC 2023 - Christophe Marin <christophe@krop.fr>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
%{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')}
|
||||
%bcond_without released
|
||||
Name: kcalendarcore
|
||||
Version: 5.111.0
|
||||
Version: 5.112.0
|
||||
Release: 0
|
||||
Summary: Library to access and handle calendar data
|
||||
License: LGPL-2.0-or-later
|
||||
@ -33,8 +33,6 @@ Source: %{name}-%{version}.tar.xz
|
||||
Source1: %{name}-%{version}.tar.xz.sig
|
||||
Source2: frameworks.keyring
|
||||
%endif
|
||||
# PATCH-FIX-UPSTREAM
|
||||
Patch0: 0001-ICalFormat-don-t-shift-all-day-invite-dates-to-UTC.patch
|
||||
BuildRequires: extra-cmake-modules >= %{_kf5_version}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: cmake(LibIcal) >= 3.0
|
||||
|
Loading…
Reference in New Issue
Block a user