Merge lp:~gary-wzl77/qtorganizer5-eds/fix_1445577 into lp:qtorganizer5-eds

Proposed by Gary.Wang
Status: Superseded
Proposed branch: lp:~gary-wzl77/qtorganizer5-eds/fix_1445577
Merge into: lp:qtorganizer5-eds
Prerequisite: lp:~renatofilho/qtorganizer5-eds/fix-1437305
Diff against target: 24 lines (+4/-3)
1 file modified
organizer/qorganizer-eds-engine.cpp (+4/-3)
To merge this branch: bzr merge lp:~gary-wzl77/qtorganizer5-eds/fix_1445577
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho Pending
Alan Pope 🍺🐧🐱 πŸ¦„ Pending
Review via email: mp+269390@code.launchpad.net

This proposal supersedes a proposal from 2015-07-12.

This proposal has been superseded by a proposal from 2015-10-02.

Commit message

remove invalid QTimeZone when converting icaltimetype to QDateTime

Description of the change

remove invalid QTimeZone when converting icaltimetype to QDateTime

To post a comment you must log in.
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote : Posted in a previous version of this proposal

Reading the bug report I would say that the event is losing the timezone when edited. Is the app setting the correct timezone? If the app does not set the timezone the event will be handled as a Floating event.

review: Needs Information
Revision history for this message
Gary.Wang (gary-wzl77) wrote : Posted in a previous version of this proposal

Actually, there is no such a timezone settings in app. App just follows system timezone.

My Time & Date in system settings
Time zone:
Asia/Shangehai UTC+8

----Create an event (display correctly in weeklyview)
qml: event.name: Ttttt
qml: event.startDateTime: Fri Jul 24 07:00:00 2015 GMT+0800
qml: event.endDateTime: Fri Jul 24 08:00:00 2015 GMT+0800

----Edit an event with only name changed (wrong display and event backs x hours)
qml: event.name: Ttttt-edit
qml: event.startDateTime: Fri Jul 24 07:00:00 2015 GMT+0800
qml: event.endDateTime: Fri Jul 24 08:00:00 2015 GMT+0800

Revision history for this message
Gary.Wang (gary-wzl77) wrote : Posted in a previous version of this proposal

I check this issue today and find sth as following:
when user modify a event with start or end date time changed, issue wont' occur.
when user modify a event without start datetime and end date time changed, issue occurs.
Reason for this is if start and end date time are not changed when modification, the timeSpec is for these two datetime is Qt::TimeZone instead of Qt::UTC when parsing them, then
tz.id().constData() == "able/localtime" which cause timezone == null and empty for tzId after icaltimezone_get_builtin_timezone was called.
so finally event backs x(timezone) hours after e_cal_client_modify_objects called.

As I mentioned above, we follow system timezone and have no way to set timezone in qml.
The easy fix is if start & end datetime are not floating time, then we need to convert Local timezone to UTC time zone.
Please review latest MP.
Thanks

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote : Posted in a previous version of this proposal

Could you resubmit this MR adding "https://code.launchpad.net/~renatofilho/qtorganizer5-eds/fix-1437305/+merge/261666" as Prerequisite Branch, it will make only your changes visible on the diff. And make it easy to review.

Revision history for this message
Gary.Wang (gary-wzl77) wrote : Posted in a previous version of this proposal

OK, I will delete this one later on and create another MP for review since I can't resubmit merge proposal in same branch.
Thanks.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Could you write a small qml code, that reproduce the error?

We can not save all events with 'UTC' timezone it will cause the alarms to fail, we need to have a way to save events without a specific TZ to floating times.

If js does not support datetime with 'Qt::TimeZone' format we should fix the QML bindings to return it in UTC format. (this need to be done in QtOrganizer)

As workaround we can update the start/stop field before save the event (in calendar app) even if the user does not change it.

But first I need to see the small qml app to make sure that we do not have any other solution.

Revision history for this message
Gary.Wang (gary-wzl77) wrote :

This issue can be reproduce easily. Just make sure you have non UTC+0 time
zone on your device. e.g. for me UTC+8
Please find simple qml app here
https://code.launchpad.net/~gary-wzl77/+junk/testtz

Regarding workaround, I've tried add one milliseconds for start/end
datetime before when editing an event, it *works*. But strictly speaking, I
think it's just a workaround not a proper fix.

I have no idea beside eds, if there's another plugins for QtOrganizer(what
kind of plugin use by Jolla)? if it works fine with another plugin, I am
afraid issue lies in eds.
Also applying 'UTC' timezone for all events cause alarm(floating time) to
fail, no idea if there is a way to check if edit item type or sth.

Please try the qml code at first to have a check if it can be reproduced on
your device, Thanks.

It seems we can't check current event type is alarms or

On Tue, Sep 8, 2015 at 9:39 PM, Renato Araujo Oliveira Filho <
<email address hidden>> wrote:

> Could you write a small qml code, that reproduce the error?
>
>
> We can not save all events with 'UTC' timezone it will cause the alarms to
> fail, we need to have a way to save events without a specific TZ to
> floating times.
>
> If js does not support datetime with 'Qt::TimeZone' format we should fix
> the QML bindings to return it in UTC format. (this need to be done in
> QtOrganizer)
>
> As workaround we can update the start/stop field before save the event (in
> calendar app) even if the user does not change it.
>
> But first I need to see the small qml app to make sure that we do not have
> any other solution.
>
> --
>
> https://code.launchpad.net/~gary-wzl77/qtorganizer5-eds/fix_1445577/+merge/269390
> You are the owner of lp:~gary-wzl77/qtorganizer5-eds/fix_1445577.
>

--
Br
Gary.Wzl

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

I am trying to reproduce the bug with the example create by Gary. But the log is showing the correct results.

qml: -------------Create event
qml: Birthdays_145 ---- false
qml: Personal ---- false
qml: renatoteste2gmailcom_145 ---- false
qml: HolidaysinBrazil_145 ---- false
qml: Personal ---- false
qml: Personal ---- true
qml: Birthdays & Anniversaries ---- true
qml: event Name:Test_1443797923448
qml: startDate: sex out 2 11:58:43 2015 GMT-0300
qml: endDate: sex out 2 12:58:43 2015 GMT-0300
qml: -------------Create event done
qml: --------onModelChanged
qml: editEvent: QDeclarativeOrganizerEvent(0x2e8d020)
qml: event Name:Test_1443797923448
qml: startDate: sex out 2 11:58:43 2015 GMT-0300
qml: endDate: sex out 2 12:58:43 2015 GMT-0300
qml: --------onModelChanged
qml:
-------------Edit event
qml: event Name:edit___Test_1443797923448
qml: startDate: sex out 2 11:58:43 2015 GMT-0300
qml: endDate: sex out 2 12:58:43 2015 GMT-0300
qml: -------------Edit event done
qml: --------onModelChanged
qml: editEvent: QDeclarativeOrganizerEvent(0x2e8d020)
qml: event Name:edit___Test_1443797923448
qml: startDate: sex out 2 11:58:43 2015 GMT-0300
qml: endDate: sex out 2 12:58:43 2015 GMT-0300
qml: --------onModelChanged

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'organizer/qorganizer-eds-engine.cpp'
2--- organizer/qorganizer-eds-engine.cpp 2015-08-27 15:18:27 +0000
3+++ organizer/qorganizer-eds-engine.cpp 2015-08-27 15:18:27 +0000
4@@ -1227,9 +1227,7 @@
5 tmTime = icaltime_as_timet(value);
6 QDateTime t = QDateTime::fromTime_t(tmTime).toUTC();
7 // floating time contains invalid timezone
8- return QDateTime(t.date(),
9- (icaltime_is_date(value) ? QTime() : t.time()),
10- QTimeZone());
11+ return QDateTime(t.date(), t.time(), QTimeZone());
12 }
13 }
14
15@@ -1253,6 +1251,9 @@
16 if (!tz.isValid()) {
17 // floating time
18 finalDate = QDateTime(finalDate.date(), finalDate.time(), Qt::UTC);
19+ } else {
20+ tz = QTimeZone("UTC");
21+ finalDate = finalDate.toTimeZone(tz);
22 }
23 break;
24 case Qt::LocalTime:

Subscribers

People subscribed via source and target branches

to all changes: