Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[nemo-qml-plugin-calendar] Fix bug when modifying timezone. Contribut…
…es to JB#52563
  • Loading branch information
chriadam committed Dec 23, 2020
1 parent a01dbb7 commit b7e412a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/calendareventmodification.cpp
Expand Up @@ -106,9 +106,10 @@ QDateTime CalendarEventModification::startTime() const

void CalendarEventModification::setStartTime(const QDateTime &startTime, Qt::TimeSpec spec, const QString &timezone)
{
if (m_event.startTime != startTime) {
m_event.startTime = startTime;
updateTime(&m_event.startTime, spec, timezone);
QDateTime newStartTimeInTz = startTime;
updateTime(&newStartTimeInTz, spec, timezone);
if (m_event.startTime != newStartTimeInTz) {
m_event.startTime = newStartTimeInTz;
emit startTimeChanged();
}
}
Expand All @@ -120,9 +121,10 @@ QDateTime CalendarEventModification::endTime() const

void CalendarEventModification::setEndTime(const QDateTime &endTime, Qt::TimeSpec spec, const QString &timezone)
{
if (m_event.endTime != endTime) {
m_event.endTime = endTime;
updateTime(&m_event.endTime, spec, timezone);
QDateTime newEndTimeInTz = endTime;
updateTime(&newEndTimeInTz, spec, timezone);
if (m_event.endTime != newEndTimeInTz) {
m_event.endTime = newEndTimeInTz;
emit endTimeChanged();
}
}
Expand Down

0 comments on commit b7e412a

Please sign in to comment.