Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 5ce42277 authored by Volker Krause's avatar Volker Krause

Don't return an invalid QTimeZone()

QDateTime::timeZone() asserts when its time zone is invalid. Fixes creating
all-day events in KOrganizer.
parent ad2c7a7e
......@@ -106,7 +106,7 @@ QTimeZone KTimeZoneComboBox::selectedTimeZone() const
if (currentIndex() == 0) { // Local
zone = QTimeZone::systemTimeZone();
} else if (currentIndex() == 1) { // Floating event
zone = QTimeZone();
zone = QTimeZone::systemTimeZone();
} else if (currentIndex() == 2) { // UTC
zone = QTimeZone::utc();
} else {
......@@ -125,7 +125,7 @@ void KTimeZoneComboBox::selectLocalTimeZone()
void KTimeZoneComboBox::setFloating(bool floating, const QTimeZone &zone)
{
if (floating) {
selectTimeZone(QTimeZone());
setCurrentIndex(1);
} else {
if (zone.isValid()) {
selectTimeZone(zone);
......
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