author | zautrix <zautrix> | 2004-08-20 23:53:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-20 23:53:07 (UTC) |
commit | ab07441b413dff6d478e2c3a39b823b4269931c5 (patch) (unidiff) | |
tree | 5de6576a6c0e20e4af2db7baa5019aa983e2195a /libkcal | |
parent | bc33238f8038a03e04f25ea608c53e784616fee6 (diff) | |
download | kdepimpi-ab07441b413dff6d478e2c3a39b823b4269931c5.zip kdepimpi-ab07441b413dff6d478e2c3a39b823b4269931c5.tar.gz kdepimpi-ab07441b413dff6d478e2c3a39b823b4269931c5.tar.bz2 |
Sync fixes and fix of config loading bug
-rw-r--r-- | libkcal/phoneformat.cpp | 44 | ||||
-rw-r--r-- | libkcal/vcalformat.cpp | 19 | ||||
-rw-r--r-- | libkcal/vcalformat.h | 5 |
3 files changed, 55 insertions, 13 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 6276498..1769b37 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp | |||
@@ -448,6 +448,11 @@ public: | |||
448 | 448 | ||
449 | QStringList categoryList; | 449 | QStringList cat = event->categories(); |
450 | categoryList << getCategory( Note ); | 450 | QString nCat = getCategory( Note ); |
451 | event->setCategories( categoryList ); | 451 | |
452 | // strange 0 semms to mean: alarm enabled | 452 | if ( !nCat.isEmpty() ) |
453 | if ( !cat.contains( nCat )) { | ||
454 | cat << nCat; | ||
455 | event->setCategories( cat ); | ||
456 | } | ||
457 | |||
453 | if ( alarm ) { | 458 | if ( alarm ) { |
@@ -534,3 +539,3 @@ public: | |||
534 | case GSM_CAL_CALL : CATEGORY = QString("Call"); break; | 539 | case GSM_CAL_CALL : CATEGORY = QString("Call"); break; |
535 | case GSM_CAL_MEETING : CATEGORY = QString("Meeting"); break; | 540 | //case GSM_CAL_MEETING : CATEGORY = QString("Meeting"); break; |
536 | case GSM_CAL_BIRTHDAY : CATEGORY = QString("Birthday"); break; | 541 | case GSM_CAL_BIRTHDAY : CATEGORY = QString("Birthday"); break; |
@@ -1072,2 +1077,5 @@ bool PhoneFormat::save( Calendar *calendar) | |||
1072 | while (Backup.Calendar[max]!=NULL) max++; | 1077 | while (Backup.Calendar[max]!=NULL) max++; |
1078 | |||
1079 | GSM_DateTime*dtp; | ||
1080 | |||
1073 | for (i=0;i<max;i++) { | 1081 | for (i=0;i<max;i++) { |
@@ -1076,5 +1084,29 @@ bool PhoneFormat::save( Calendar *calendar) | |||
1076 | Note = *Backup.Calendar[i]; | 1084 | Note = *Backup.Calendar[i]; |
1085 | |||
1086 | #if 0 | ||
1087 | int j; | ||
1088 | for (j=0;j<Note.EntriesNum;j++) { | ||
1089 | //qDebug(" for ev"); | ||
1090 | switch (Note.Entries[j].EntryType) { | ||
1091 | case CAL_START_DATETIME: | ||
1092 | //Note->Entries[i].Date.Hour = 5; | ||
1093 | dtp = &Note.Entries[j].Date; | ||
1094 | qDebug("start event %d %d %d - %d %d %d", dtp->Year, dtp->Month, dtp->Day, dtp->Hour, dtp->Minute, dtp->Second ); | ||
1095 | break; | ||
1096 | case CAL_END_DATETIME: | ||
1097 | dtp = &Note.Entries[j].Date; | ||
1098 | qDebug("end event %d %d %d - %d %d %d", dtp->Year, dtp->Month, dtp->Day, dtp->Hour, dtp->Minute, dtp->Second ); | ||
1099 | break; | ||
1100 | } | ||
1101 | } | ||
1102 | int type = Note.Type; | ||
1103 | qDebug(" event type %d - %d %d - %d %d %d",type, GSM_CAL_CALL , GSM_CAL_MEETING ,GSM_CAL_BIRTHDAY, GSM_CAL_MEMO ,GSM_CAL_ALARM ); | ||
1104 | #endif | ||
1105 | |||
1106 | Note.Type = GSM_CAL_MEETING; | ||
1107 | // pending: fix in gammu GSM_ReadBackupFile the type settings | ||
1108 | int loc = Note.Location; | ||
1077 | Note.Location = 0; | 1109 | Note.Location = 0; |
1078 | error=Phone->AddCalendar(&s,&Note); | 1110 | error=Phone->AddCalendar(&s,&Note); |
1079 | qDebug("add event %d %d", error, Note.Location ); | 1111 | qDebug("add event %d %d %d", error, Note.Location, loc ); |
1080 | } | 1112 | } |
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index 9307f12..0ebd7d1 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp | |||
@@ -31,2 +31,3 @@ | |||
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <kglobal.h> | ||
32 | #include <kmessagebox.h> | 33 | #include <kmessagebox.h> |
@@ -48,2 +49,3 @@ VCalFormat::VCalFormat() | |||
48 | mCalendar = 0; | 49 | mCalendar = 0; |
50 | useLocalTime = false; | ||
49 | } | 51 | } |
@@ -168,5 +170,8 @@ bool VCalFormat::fromString( Calendar *calendar, const QString &text ) | |||
168 | 170 | ||
169 | QString VCalFormat::eventToString( Event * event, Calendar *calendar) | 171 | QString VCalFormat::eventToString( Event * event, Calendar *calendar, bool useLocal) |
170 | { | 172 | { |
173 | |||
171 | if ( !event ) return QString::null; | 174 | if ( !event ) return QString::null; |
175 | bool useL = useLocalTime; | ||
176 | useLocalTime = useLocal; | ||
172 | mCalendar = calendar; | 177 | mCalendar = calendar; |
@@ -176,7 +181,11 @@ QString VCalFormat::eventToString( Event * event, Calendar *calendar) | |||
176 | cleanVObject( vevent ); | 181 | cleanVObject( vevent ); |
182 | useLocalTime = useL; | ||
177 | return result; | 183 | return result; |
178 | } | 184 | } |
179 | QString VCalFormat::todoToString( Todo * todo, Calendar *calendar ) | 185 | QString VCalFormat::todoToString( Todo * todo, Calendar *calendar, bool useLocal ) |
180 | { | 186 | { |
187 | |||
181 | if ( !todo ) return QString::null; | 188 | if ( !todo ) return QString::null; |
189 | bool useL = useLocalTime; | ||
190 | useLocalTime = useLocal; | ||
182 | mCalendar = calendar; | 191 | mCalendar = calendar; |
@@ -186,2 +195,3 @@ QString VCalFormat::todoToString( Todo * todo, Calendar *calendar ) | |||
186 | cleanVObject( vevent ); | 195 | cleanVObject( vevent ); |
196 | useLocalTime = useL; | ||
187 | return result; | 197 | return result; |
@@ -1436,5 +1446,4 @@ QString VCalFormat::qDateTimeToISO(const QDateTime &qdt, bool zulu) | |||
1436 | ASSERT(qdt.time().isValid()); | 1446 | ASSERT(qdt.time().isValid()); |
1437 | if (zulu) { | 1447 | if (zulu && !useLocalTime ) { |
1438 | QDateTime tmpDT(qdt); | 1448 | QDateTime tmpDT = qdt.addSecs ( -KGlobal::locale()->localTimeOffset( qdt )*60); |
1439 | tmpDT = tmpDT.addSecs(60*(-mCalendar->getTimeZone())); // correct to GMT. | ||
1440 | tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2dZ", | 1449 | tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2dZ", |
diff --git a/libkcal/vcalformat.h b/libkcal/vcalformat.h index 7b9ca26..848be78 100644 --- a/libkcal/vcalformat.h +++ b/libkcal/vcalformat.h | |||
@@ -64,4 +64,4 @@ class VCalFormat : public CalFormat { | |||
64 | QString toString( Calendar * ); | 64 | QString toString( Calendar * ); |
65 | QString eventToString( Event *, Calendar *calendar ); | 65 | QString eventToString( Event *, Calendar *calendar, bool useLocalTime = true ); |
66 | QString todoToString( Todo * ,Calendar *calendar ); | 66 | QString todoToString( Todo * ,Calendar *calendar, bool useLocalTime = true ); |
67 | 67 | ||
@@ -102,2 +102,3 @@ class VCalFormat : public CalFormat { | |||
102 | Calendar *mCalendar; | 102 | Calendar *mCalendar; |
103 | bool useLocalTime; | ||
103 | 104 | ||