Package: kdepimlibs / 4:4.14.10-11

libical3.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
Description: Compile with libical3
From: Giovanni Mascellani <gio@debian.org>
Bug-Debian: https://bugs.debian.org/905697

Index: kdepimlibs-4.14.10/kcalcore/icalformat_p.cpp
===================================================================
--- kdepimlibs-4.14.10.orig/kcalcore/icalformat_p.cpp
+++ kdepimlibs-4.14.10/kcalcore/icalformat_p.cpp
@@ -2301,7 +2301,6 @@ icaltimetype ICalFormatImpl::writeICalDa
     t.second = 0;
 
     t.is_date = 1;
-    t.is_utc = 0;
     t.zone = 0;
 
     return t;
@@ -2323,7 +2322,9 @@ icaltimetype ICalFormatImpl::writeICalDa
         t.second = datetime.time().second();
     }
     t.zone = 0;   // zone is NOT set
-    t.is_utc = datetime.isUtc() ? 1 : 0;
+    if (datetime.isUtc()) {
+        t = icaltime_convert_to_zone(t, icaltimezone_get_utc_timezone());
+    }
 
     // _dumpIcaltime( t );
 
@@ -2398,7 +2399,7 @@ icalproperty *ICalFormatImpl::writeICalD
     }
 
     KTimeZone ktz;
-    if (!t.is_utc) {
+    if (!icaltime_is_utc(t)) {
         ktz = dt.timeZone();
     }
 
@@ -2431,7 +2432,7 @@ KDateTime ICalFormatImpl::readICalDateTi
 //  _dumpIcaltime( t );
 
     KDateTime::Spec timeSpec;
-    if (t.is_utc  ||  t.zone == icaltimezone_get_utc_timezone()) {
+    if (icaltime_is_utc(t)  ||  t.zone == icaltimezone_get_utc_timezone()) {
         timeSpec = KDateTime::UTC;   // the time zone is UTC
         utc = false;    // no need to convert to UTC
     } else {
Index: kdepimlibs-4.14.10/kcalcore/icaltimezones.cpp
===================================================================
--- kdepimlibs-4.14.10.orig/kcalcore/icaltimezones.cpp
+++ kdepimlibs-4.14.10/kcalcore/icaltimezones.cpp
@@ -54,7 +54,7 @@ static QDateTime toQDateTime(const icalt
 {
     return QDateTime(QDate(t.year, t.month, t.day),
                      QTime(t.hour, t.minute, t.second),
-                     (t.is_utc ? Qt::UTC : Qt::LocalTime));
+                     (icaltime_is_utc(t) ? Qt::UTC : Qt::LocalTime));
 }
 
 // Maximum date for time zone data.
@@ -81,7 +81,6 @@ static icaltimetype writeLocalICalDateTi
     t.second = local.time().second();
     t.is_date = 0;
     t.zone = 0;
-    t.is_utc = 0;
     return t;
 }
 
@@ -886,7 +885,7 @@ ICalTimeZone ICalTimeZoneSource::parse(i
         case ICAL_LASTMODIFIED_PROPERTY:
         {
             const icaltimetype t = icalproperty_get_lastmodified(p);
-            if (t.is_utc) {
+            if (icaltime_is_utc(t)) {
                 data->d->lastModified = toQDateTime(t);
             } else {
                 kDebug() << "LAST-MODIFIED not UTC";
@@ -1259,7 +1258,7 @@ QList<QDateTime> ICalTimeZoneSourcePriva
     // Convert DTSTART to QDateTime, and from local time to UTC
     const QDateTime localStart = toQDateTime(dtstart);     // local time
     dtstart.second -= prevOffset;
-    dtstart.is_utc = 1;
+    dtstart = icaltime_convert_to_zone(dtstart, icaltimezone_get_utc_timezone());
     const QDateTime utcStart = toQDateTime(icaltime_normalize(dtstart));       // UTC
 
     transitions += utcStart;
@@ -1286,13 +1285,12 @@ QList<QDateTime> ICalTimeZoneSourcePriva
                     t.minute = dtstart.minute;
                     t.second = dtstart.second;
                     t.is_date = 0;
-                    t.is_utc = 0;    // dtstart is in local time
                 }
                 // RFC2445 states that RDATE must be in local time,
                 // but we support UTC as well to be safe.
-                if (!t.is_utc) {
+                if (!icaltime_is_utc(t)) {
                     t.second -= prevOffset;    // convert to UTC
-                    t.is_utc = 1;
+                    t = icaltime_convert_to_zone(t, icaltimezone_get_utc_timezone());
                     t = icaltime_normalize(t);
                 }
                 transitions += toQDateTime(t);
Index: kdepimlibs-4.14.10/kcal/icalformat_p.cpp
===================================================================
--- kdepimlibs-4.14.10.orig/kcal/icalformat_p.cpp
+++ kdepimlibs-4.14.10/kcal/icalformat_p.cpp
@@ -2087,7 +2087,6 @@ icaltimetype ICalFormatImpl::writeICalDa
   t.second = 0;
 
   t.is_date = 1;
-  t.is_utc = 0;
   t.zone = 0;
 
   return t;
@@ -2107,7 +2106,9 @@ icaltimetype ICalFormatImpl::writeICalDa
 
   t.is_date = 0;
   t.zone = 0;   // zone is NOT set
-  t.is_utc = datetime.isUtc() ? 1 : 0;
+    if (datetime.isUtc()) {
+        t = icaltime_convert_to_zone(t, icaltimezone_get_utc_timezone());
+    }
 
   // _dumpIcaltime( t );
 
@@ -2174,7 +2175,7 @@ icalproperty *ICalFormatImpl::writeICalD
   }
 
   KTimeZone ktz;
-  if ( !t.is_utc ) {
+  if ( !icaltime_is_utc(t) ) {
     ktz = dt.timeZone();
   }
 
@@ -2207,7 +2208,7 @@ KDateTime ICalFormatImpl::readICalDateTi
 //  _dumpIcaltime( t );
 
   KDateTime::Spec timeSpec;
-  if ( t.is_utc  ||  t.zone == icaltimezone_get_utc_timezone() ) {
+  if ( icaltime_is_utc(t)  ||  t.zone == icaltimezone_get_utc_timezone() ) {
     timeSpec = KDateTime::UTC;   // the time zone is UTC
     utc = false;    // no need to convert to UTC
   } else {
Index: kdepimlibs-4.14.10/kcal/icaltimezones.cpp
===================================================================
--- kdepimlibs-4.14.10.orig/kcal/icaltimezones.cpp
+++ kdepimlibs-4.14.10/kcal/icaltimezones.cpp
@@ -50,7 +50,7 @@ static QDateTime toQDateTime( const ical
 {
   return QDateTime( QDate( t.year, t.month, t.day ),
                     QTime( t.hour, t.minute, t.second ),
-                    ( t.is_utc ? Qt::UTC : Qt::LocalTime ) );
+                    ( icaltime_is_utc(t) ? Qt::UTC : Qt::LocalTime ) );
 }
 
 // Maximum date for time zone data.
@@ -77,7 +77,6 @@ static icaltimetype writeLocalICalDateTi
   t.second = local.time().second();
   t.is_date = 0;
   t.zone = 0;
-  t.is_utc = 0;
   return t;
 }
 
@@ -787,7 +786,7 @@ ICalTimeZone ICalTimeZoneSource::parse(
     case ICAL_LASTMODIFIED_PROPERTY:
     {
       icaltimetype t = icalproperty_get_lastmodified(p);
-      if ( t.is_utc ) {
+      if ( icaltime_is_utc(t) ) {
         data->d->lastModified = toQDateTime( t );
       } else {
         kDebug() << "LAST-MODIFIED not UTC";
@@ -972,7 +971,7 @@ QList<QDateTime> ICalTimeZoneSourcePriva
   // Convert DTSTART to QDateTime, and from local time to UTC
   QDateTime localStart = toQDateTime( dtstart );   // local time
   dtstart.second -= prevOffset;
-  dtstart.is_utc = 1;
+  dtstart = icaltime_convert_to_zone(dtstart, icaltimezone_get_utc_timezone());
   QDateTime utcStart = toQDateTime( icaltime_normalize( dtstart ) );   // UTC
 
   transitions += utcStart;
@@ -999,13 +998,12 @@ QList<QDateTime> ICalTimeZoneSourcePriva
           t.minute = dtstart.minute;
           t.second = dtstart.second;
           t.is_date = 0;
-          t.is_utc = 0;    // dtstart is in local time
         }
         // RFC2445 states that RDATE must be in local time,
         // but we support UTC as well to be safe.
-        if ( !t.is_utc ) {
+        if ( !icaltime_is_utc(t) ) {
           t.second -= prevOffset;    // convert to UTC
-          t.is_utc = 1;
+          t = icaltime_convert_to_zone(t, icaltimezone_get_utc_timezone());
           t = icaltime_normalize( t );
         }
         transitions += toQDateTime( t );