summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/service/gsmcal.c4
-rw-r--r--gammu/emb/gammu/gammu.c6
-rw-r--r--libkcal/phoneformat.cpp42
3 files changed, 36 insertions, 16 deletions
diff --git a/gammu/emb/common/service/gsmcal.c b/gammu/emb/common/service/gsmcal.c
index ddf9790..0ea8e06 100644
--- a/gammu/emb/common/service/gsmcal.c
+++ b/gammu/emb/common/service/gsmcal.c
@@ -476,3 +476,3 @@ GSM_Error GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer, int *Pos, GSM_Calenda
if (ToDoVer == SonyEricsson_VToDo) {
- ToDo->Priority = GSM_Priority_Low;
+ ToDo->Priority = GSM_Priority_Medium;
if (atoi(DecodeUnicodeString(Buff))>3) ToDo->Priority = GSM_Priority_Low;
@@ -481,3 +481,3 @@ GSM_Error GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer, int *Pos, GSM_Calenda
} else if (ToDoVer == Nokia_VToDo) {
- ToDo->Priority = GSM_Priority_Low;
+ ToDo->Priority = GSM_Priority_Medium;
if (atoi(DecodeUnicodeString(Buff))>3) ToDo->Priority = GSM_Priority_Low;
diff --git a/gammu/emb/gammu/gammu.c b/gammu/emb/gammu/gammu.c
index a3b93a8..997485a 100644
--- a/gammu/emb/gammu/gammu.c
+++ b/gammu/emb/gammu/gammu.c
@@ -4629,2 +4629,3 @@ static void Restore(int argc, char *argv[])
if (Backup.Calendar[0] != NULL) {
+ DoRestore = true;
/* N6110 doesn't support getting calendar status */
@@ -4680,2 +4681,4 @@ static void Restore(int argc, char *argv[])
if (error == ERR_NONE) {
+ error == ERR_NOTSUPPORTED;
+ DoRestore = true;
max = 0;
@@ -4688,4 +4691,6 @@ static void Restore(int argc, char *argv[])
if (DoRestore) {
+ if ( max > 0 ) {
ToDo = *Backup.ToDo[0];
error = Phone->SetToDo(&s,&ToDo);
+ }
}
@@ -8376,3 +8381,2 @@ int main(int argc, char *argv[])
#endif
- argc = argc-3;
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 6df639f..ef69bce 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -131,3 +131,6 @@ ulong PhoneFormat::getCsumTodo( Todo* todo )
attList << completedString;
- attList << QString::number( todo->priority() );
+ int prio = todo->priority();
+ if( prio == 2 ) prio = 1;
+ if (prio == 4 ) prio = 5 ;
+ attList << QString::number( prio );
QString alarmString = "na";
@@ -256,3 +259,3 @@ ulong PhoneFormat::getCsum( const QStringList & attList)
{
- int max = attList.count() -1;
+ int max = attList.count();
ulong cSum = 0;
@@ -260,3 +263,3 @@ ulong PhoneFormat::getCsum( const QStringList & attList)
int add;
- for ( i = 1; i < max ; ++i ) {
+ for ( i = 0; i < max ; ++i ) {
QString s = attList[i];
@@ -269,3 +272,4 @@ ulong PhoneFormat::getCsum( const QStringList & attList)
mul = mul * mul;
- add = add * mul *i*i*i;
+ int ii = i+1;
+ add = add * mul *ii*ii*ii;
cSum += add;
@@ -273,5 +277,8 @@ ulong PhoneFormat::getCsum( const QStringList & attList)
}
+ if ( i == 0 )
+ qDebug("csum: i == 0 %d ", cSum);
+
}
- //QString dump = attList.join(",");
- //qDebug("csum: %s", dump.latin1());
+ QString dump = attList.join(",");
+ qDebug("csum: %d %s", cSum,dump.latin1());
@@ -292,4 +299,3 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
#endif
- QString command ="./kammu --backup " + fileName + " -yes -C" +
- mConnection +" -D" + mDevice +" -M" + mModel;
+ QString command ="./kammu --backup " + fileName + " -yes" ;
int ret = system ( command.latin1() );
@@ -346,2 +352,4 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
if ( event ) {
+ qDebug("copy todo %s ", event->summary().latin1());
+
event = (Todo*)event->clone();
@@ -377,3 +385,4 @@ void PhoneFormat::copyEvent( Event* to, Event* from )
QPtrListIterator<Alarm> it( from->alarms() );
- to->clearAlarms();
+ if ( it.current() )
+ to->clearAlarms();
const Alarm *a;
@@ -416,3 +425,4 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from )
QPtrListIterator<Alarm> it( from->alarms() );
- to->clearAlarms();
+ if ( it.current() )
+ to->clearAlarms();
const Alarm *a;
@@ -445,3 +455,8 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from )
}
- to->setPriority(from->priority());
+ if( to->priority() == 2 && from->priority() == 1 )
+ ; //skip
+ else if (to->priority() == 4 && from->priority() == 5 )
+ ;
+ else
+ to->setPriority(from->priority());
@@ -454,2 +469,3 @@ void PhoneFormat::afterSave( Incidence* inc)
inc->removeID( mProfileName );
+#if 0
if ( inc->type() == "Event")
@@ -459,2 +475,3 @@ void PhoneFormat::afterSave( Incidence* inc)
inc->setCsum( mProfileName, QString::number( csum ));
+#endif
inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
@@ -508,4 +525,3 @@ bool PhoneFormat::save( Calendar *calendar)
// 4 call kammu
- QString command ="./kammu --restore " + fileName + " -C" +
- mConnection +" -D" + mDevice +" -M" + mModel;
+ QString command ="./kammu --restore " + fileName ;
int ret;