summaryrefslogtreecommitdiffabout
path: root/libkcal/phoneformat.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/phoneformat.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/phoneformat.cpp44
1 files changed, 38 insertions, 6 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:
- QStringList categoryList;
- categoryList << getCategory( Note );
- event->setCategories( categoryList );
- // strange 0 semms to mean: alarm enabled
+ QStringList cat = event->categories();
+ QString nCat = getCategory( Note );
+
+ if ( !nCat.isEmpty() )
+ if ( !cat.contains( nCat )) {
+ cat << nCat;
+ event->setCategories( cat );
+ }
+
if ( alarm ) {
@@ -534,3 +539,3 @@ public:
case GSM_CAL_CALL : CATEGORY = QString("Call"); break;
- case GSM_CAL_MEETING : CATEGORY = QString("Meeting"); break;
+ //case GSM_CAL_MEETING : CATEGORY = QString("Meeting"); break;
case GSM_CAL_BIRTHDAY : CATEGORY = QString("Birthday"); break;
@@ -1072,2 +1077,5 @@ bool PhoneFormat::save( Calendar *calendar)
while (Backup.Calendar[max]!=NULL) max++;
+
+ GSM_DateTime* dtp;
+
for (i=0;i<max;i++) {
@@ -1076,5 +1084,29 @@ bool PhoneFormat::save( Calendar *calendar)
Note = *Backup.Calendar[i];
+
+#if 0
+ int j;
+ for (j=0;j<Note.EntriesNum;j++) {
+ //qDebug(" for ev");
+ switch (Note.Entries[j].EntryType) {
+ case CAL_START_DATETIME:
+ //Note->Entries[i].Date.Hour = 5;
+ dtp = &Note.Entries[j].Date;
+ qDebug("start event %d %d %d - %d %d %d", dtp->Year, dtp->Month, dtp->Day, dtp->Hour, dtp->Minute, dtp->Second );
+ break;
+ case CAL_END_DATETIME:
+ dtp = &Note.Entries[j].Date;
+ qDebug("end event %d %d %d - %d %d %d", dtp->Year, dtp->Month, dtp->Day, dtp->Hour, dtp->Minute, dtp->Second );
+ break;
+ }
+ }
+ int type = Note.Type;
+ 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 );
+#endif
+
+ Note.Type = GSM_CAL_MEETING;
+ // pending: fix in gammu GSM_ReadBackupFile the type settings
+ int loc = Note.Location;
Note.Location = 0;
error=Phone->AddCalendar(&s,&Note);
- qDebug("add event %d %d", error, Note.Location );
+ qDebug("add event %d %d %d", error, Note.Location, loc );
}