-rw-r--r-- | libopie2/opiepim/core/opimcontact.cpp | 20 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimcontactfields.cpp | 22 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimdateconversion.cpp | 12 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimevent.cpp | 24 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimnotifymanager.cpp | 7 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecord.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimtimezone.cpp | 5 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimtodo.cpp | 22 | ||||
-rw-r--r-- | libopie2/opiepim/core/otodoaccess.cpp | 2 |
9 files changed, 65 insertions, 51 deletions
diff --git a/libopie2/opiepim/core/opimcontact.cpp b/libopie2/opiepim/core/opimcontact.cpp index c1e06c8..48a74d0 100644 --- a/libopie2/opiepim/core/opimcontact.cpp +++ b/libopie2/opiepim/core/opimcontact.cpp | |||
@@ -31,12 +31,14 @@ | |||
31 | 31 | ||
32 | #include "opimcontact.h" | 32 | #include "opimcontact.h" |
33 | 33 | ||
34 | /* OPIE */ | 34 | /* OPIE */ |
35 | #include <opie2/opimresolver.h> | 35 | #include <opie2/opimresolver.h> |
36 | #include <opie2/opimdateconversion.h> | 36 | #include <opie2/opimdateconversion.h> |
37 | #include <opie2/odebug.h> | ||
38 | |||
37 | #include <qpe/stringutil.h> | 39 | #include <qpe/stringutil.h> |
38 | #include <qpe/timestring.h> | 40 | #include <qpe/timestring.h> |
39 | #include <qpe/config.h> | 41 | #include <qpe/config.h> |
40 | 42 | ||
41 | /* QT */ | 43 | /* QT */ |
42 | #include <qstylesheet.h> | 44 | #include <qstylesheet.h> |
@@ -76,20 +78,20 @@ OPimContact::OPimContact( const QMap<int, QString> &fromMap ):OPimRecord(), mMap | |||
76 | setCategories( idsFromString( cats ) ); | 78 | setCategories( idsFromString( cats ) ); |
77 | 79 | ||
78 | QString uidStr = find( Qtopia::AddressUid ); | 80 | QString uidStr = find( Qtopia::AddressUid ); |
79 | 81 | ||
80 | if ( uidStr.isEmpty() || ( uidStr.toInt() == 0 ) ) | 82 | if ( uidStr.isEmpty() || ( uidStr.toInt() == 0 ) ) |
81 | { | 83 | { |
82 | qWarning( "Invalid UID found. Generate new one.." ); | 84 | owarn << "Invalid UID found. Generate new one.." << oendl; |
83 | setUid( uidGen().generate() ); | 85 | setUid( uidGen().generate() ); |
84 | } | 86 | } |
85 | else | 87 | else |
86 | setUid( uidStr.toInt() ); | 88 | setUid( uidStr.toInt() ); |
87 | 89 | ||
88 | // if ( !uidStr.isEmpty() ) | 90 | // if ( !uidStr.isEmpty() ) |
89 | // setUid( uidStr.toInt() ); | 91 | // setUid( uidStr.toInt() ); |
90 | } | 92 | } |
91 | 93 | ||
92 | /*! | 94 | /*! |
93 | Destroys a contact. | 95 | Destroys a contact. |
94 | */ | 96 | */ |
95 | OPimContact::~OPimContact() | 97 | OPimContact::~OPimContact() |
@@ -928,13 +930,13 @@ QStringList OPimContact::emailList() const | |||
928 | { | 930 | { |
929 | QString emailStr = emails(); | 931 | QString emailStr = emails(); |
930 | 932 | ||
931 | QStringList r; | 933 | QStringList r; |
932 | if ( !emailStr.isEmpty() ) | 934 | if ( !emailStr.isEmpty() ) |
933 | { | 935 | { |
934 | qDebug( " emailstr " ); | 936 | odebug << " emailstr " << oendl; |
935 | QStringList l = QStringList::split( emailSeparator(), emailStr ); | 937 | QStringList l = QStringList::split( emailSeparator(), emailStr ); |
936 | for ( QStringList::ConstIterator it = l.begin();it != l.end();++it ) | 938 | for ( QStringList::ConstIterator it = l.begin();it != l.end();++it ) |
937 | r += ( *it ).simplifyWhiteSpace(); | 939 | r += ( *it ).simplifyWhiteSpace(); |
938 | } | 940 | } |
939 | 941 | ||
940 | return r; | 942 | return r; |
@@ -1133,13 +1135,13 @@ class QString OPimContact::recordField( int pos ) const | |||
1133 | the current stored date will be removed. | 1135 | the current stored date will be removed. |
1134 | */ | 1136 | */ |
1135 | void OPimContact::setBirthday( const QDate &v ) | 1137 | void OPimContact::setBirthday( const QDate &v ) |
1136 | { | 1138 | { |
1137 | if ( v.isNull() ) | 1139 | if ( v.isNull() ) |
1138 | { | 1140 | { |
1139 | qWarning( "Remove Birthday" ); | 1141 | owarn << "Remove Birthday" << oendl; |
1140 | replace( Qtopia::Birthday, QString::null ); | 1142 | replace( Qtopia::Birthday, QString::null ); |
1141 | return ; | 1143 | return ; |
1142 | } | 1144 | } |
1143 | 1145 | ||
1144 | if ( v.isValid() ) | 1146 | if ( v.isValid() ) |
1145 | replace( Qtopia::Birthday, OPimDateConversion::dateToString( v ) ); | 1147 | replace( Qtopia::Birthday, OPimDateConversion::dateToString( v ) ); |
@@ -1152,13 +1154,13 @@ void OPimContact::setBirthday( const QDate &v ) | |||
1152 | null, the current stored date will be removed. | 1154 | null, the current stored date will be removed. |
1153 | */ | 1155 | */ |
1154 | void OPimContact::setAnniversary( const QDate &v ) | 1156 | void OPimContact::setAnniversary( const QDate &v ) |
1155 | { | 1157 | { |
1156 | if ( v.isNull() ) | 1158 | if ( v.isNull() ) |
1157 | { | 1159 | { |
1158 | qWarning( "Remove Anniversary" ); | 1160 | owarn << "Remove Anniversary" << oendl; |
1159 | replace( Qtopia::Anniversary, QString::null ); | 1161 | replace( Qtopia::Anniversary, QString::null ); |
1160 | return ; | 1162 | return ; |
1161 | } | 1163 | } |
1162 | 1164 | ||
1163 | if ( v.isValid() ) | 1165 | if ( v.isValid() ) |
1164 | replace( Qtopia::Anniversary, OPimDateConversion::dateToString( v ) ); | 1166 | replace( Qtopia::Anniversary, OPimDateConversion::dateToString( v ) ); |
@@ -1193,13 +1195,13 @@ QDate OPimContact::anniversary() const | |||
1193 | return empty; | 1195 | return empty; |
1194 | } | 1196 | } |
1195 | 1197 | ||
1196 | 1198 | ||
1197 | void OPimContact::insertEmail( const QString &v ) | 1199 | void OPimContact::insertEmail( const QString &v ) |
1198 | { | 1200 | { |
1199 | //qDebug("insertEmail %s", v.latin1()); | 1201 | //odebug << "insertEmail " << v << "" << oendl; |
1200 | QString e = v.simplifyWhiteSpace(); | 1202 | QString e = v.simplifyWhiteSpace(); |
1201 | QString def = defaultEmail(); | 1203 | QString def = defaultEmail(); |
1202 | 1204 | ||
1203 | // if no default, set it as the default email and don't insert | 1205 | // if no default, set it as the default email and don't insert |
1204 | if ( def.isEmpty() ) | 1206 | if ( def.isEmpty() ) |
1205 | { | 1207 | { |
@@ -1227,22 +1229,22 @@ void OPimContact::insertEmail( const QString &v ) | |||
1227 | 1229 | ||
1228 | // otherwise, must first contain it | 1230 | // otherwise, must first contain it |
1229 | if ( !emailsStr.contains( e ) ) | 1231 | if ( !emailsStr.contains( e ) ) |
1230 | return ; | 1232 | return ; |
1231 | 1233 | ||
1232 | // remove it | 1234 | // remove it |
1233 | //qDebug(" removing email from list %s", e.latin1()); | 1235 | //odebug << " removing email from list " << e << "" << oendl; |
1234 | emails.remove( e ); | 1236 | emails.remove( e ); |
1235 | // reset the string | 1237 | // reset the string |
1236 | emailsStr = emails.join( emailSeparator() ); // Sharp's brain dead separator | 1238 | emailsStr = emails.join( emailSeparator() ); // Sharp's brain dead separator |
1237 | replace( Qtopia::Emails, emailsStr ); | 1239 | replace( Qtopia::Emails, emailsStr ); |
1238 | 1240 | ||
1239 | // if default, then replace the default email with the first one | 1241 | // if default, then replace the default email with the first one |
1240 | if ( def == e ) | 1242 | if ( def == e ) |
1241 | { | 1243 | { |
1242 | //qDebug("removeEmail is default; setting new default"); | 1244 | //odebug << "removeEmail is default; setting new default" << oendl; |
1243 | if ( !emails.count() ) | 1245 | if ( !emails.count() ) |
1244 | clearEmails(); | 1246 | clearEmails(); |
1245 | else // setDefaultEmail will remove e from the list | 1247 | else // setDefaultEmail will remove e from the list |
1246 | setDefaultEmail( emails.first() ); | 1248 | setDefaultEmail( emails.first() ); |
1247 | } | 1249 | } |
1248 | } | 1250 | } |
@@ -1256,13 +1258,13 @@ void OPimContact::clearEmails() | |||
1256 | 1258 | ||
1257 | 1259 | ||
1258 | void OPimContact::setDefaultEmail( const QString &v ) | 1260 | void OPimContact::setDefaultEmail( const QString &v ) |
1259 | { | 1261 | { |
1260 | QString e = v.simplifyWhiteSpace(); | 1262 | QString e = v.simplifyWhiteSpace(); |
1261 | 1263 | ||
1262 | //qDebug("OPimContact::setDefaultEmail %s", e.latin1()); | 1264 | //odebug << "OPimContact::setDefaultEmail " << e << "" << oendl; |
1263 | replace( Qtopia::DefaultEmail, e ); | 1265 | replace( Qtopia::DefaultEmail, e ); |
1264 | 1266 | ||
1265 | if ( !e.isEmpty() ) | 1267 | if ( !e.isEmpty() ) |
1266 | insertEmail( e ); | 1268 | insertEmail( e ); |
1267 | 1269 | ||
1268 | } | 1270 | } |
diff --git a/libopie2/opiepim/core/opimcontactfields.cpp b/libopie2/opiepim/core/opimcontactfields.cpp index 120beb6..5d45d1f 100644 --- a/libopie2/opiepim/core/opimcontactfields.cpp +++ b/libopie2/opiepim/core/opimcontactfields.cpp | |||
@@ -28,12 +28,14 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "opimcontactfields.h" | 30 | #include "opimcontactfields.h" |
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/opimcontact.h> | 33 | #include <opie2/opimcontact.h> |
34 | #include <opie2/odebug.h> | ||
35 | |||
34 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
35 | 37 | ||
36 | /* QT */ | 38 | /* QT */ |
37 | #include <qobject.h> | 39 | #include <qobject.h> |
38 | 40 | ||
39 | 41 | ||
@@ -439,61 +441,61 @@ OPimContactFields::~OPimContactFields() | |||
439 | 441 | ||
440 | 442 | ||
441 | 443 | ||
442 | void OPimContactFields::saveToRecord( OPimContact &cnt ) | 444 | void OPimContactFields::saveToRecord( OPimContact &cnt ) |
443 | { | 445 | { |
444 | 446 | ||
445 | qDebug( "ocontactfields saveToRecord: >%s<", fieldOrder.latin1() ); | 447 | odebug << "ocontactfields saveToRecord: >" << fieldOrder << "<" << oendl; |
446 | 448 | ||
447 | // Store fieldorder into this contact. | 449 | // Store fieldorder into this contact. |
448 | cnt.setCustomField( CONTACT_FIELD_ORDER_NAME, fieldOrder ); | 450 | cnt.setCustomField( CONTACT_FIELD_ORDER_NAME, fieldOrder ); |
449 | 451 | ||
450 | globalFieldOrder = fieldOrder; | 452 | globalFieldOrder = fieldOrder; |
451 | changedFieldOrder = true; | 453 | changedFieldOrder = true; |
452 | 454 | ||
453 | } | 455 | } |
454 | 456 | ||
455 | void OPimContactFields::loadFromRecord( const OPimContact &cnt ) | 457 | void OPimContactFields::loadFromRecord( const OPimContact &cnt ) |
456 | { | 458 | { |
457 | qDebug( "ocontactfields loadFromRecord" ); | 459 | odebug << "ocontactfields loadFromRecord" << oendl; |
458 | qDebug( "loading >%s<", cnt.fullName().latin1() ); | 460 | odebug << "loading >" << cnt.fullName() << "<" << oendl; |
459 | 461 | ||
460 | // Get fieldorder for this contact. If none is defined, | 462 | // Get fieldorder for this contact. If none is defined, |
461 | // we will use the global one from the config file.. | 463 | // we will use the global one from the config file.. |
462 | 464 | ||
463 | fieldOrder = cnt.customField( CONTACT_FIELD_ORDER_NAME ); | 465 | fieldOrder = cnt.customField( CONTACT_FIELD_ORDER_NAME ); |
464 | 466 | ||
465 | qDebug( "fieldOrder from contact>%s<", fieldOrder.latin1() ); | 467 | odebug << "fieldOrder from contact>" << fieldOrder << "<" << oendl; |
466 | 468 | ||
467 | if ( fieldOrder.isEmpty() ) | 469 | if ( fieldOrder.isEmpty() ) |
468 | { | 470 | { |
469 | fieldOrder = globalFieldOrder; | 471 | fieldOrder = globalFieldOrder; |
470 | } | 472 | } |
471 | 473 | ||
472 | 474 | ||
473 | qDebug( "effective fieldOrder in loadFromRecord >%s<", fieldOrder.latin1() ); | 475 | odebug << "effective fieldOrder in loadFromRecord >" << fieldOrder << "<" << oendl; |
474 | } | 476 | } |
475 | 477 | ||
476 | void OPimContactFields::setFieldOrder( int num, int index ) | 478 | void OPimContactFields::setFieldOrder( int num, int index ) |
477 | { | 479 | { |
478 | qDebug( "qcontactfields setfieldorder pos %i -> %i", num, index ); | 480 | odebug << "qcontactfields setfieldorder pos " << num << " -> " << index << "" << oendl; |
479 | 481 | ||
480 | fieldOrder[ num ] = QString::number( index, 16 ) [ 0 ]; | 482 | fieldOrder[ num ] = QString::number( index, 16 ) [ 0 ]; |
481 | 483 | ||
482 | // We will store this new fieldorder globally to | 484 | // We will store this new fieldorder globally to |
483 | // remember it for contacts which have none | 485 | // remember it for contacts which have none |
484 | globalFieldOrder = fieldOrder; | 486 | globalFieldOrder = fieldOrder; |
485 | changedFieldOrder = true; | 487 | changedFieldOrder = true; |
486 | 488 | ||
487 | qDebug( "fieldOrder >%s<", fieldOrder.latin1() ); | 489 | odebug << "fieldOrder >" << fieldOrder << "<" << oendl; |
488 | } | 490 | } |
489 | 491 | ||
490 | int OPimContactFields::getFieldOrder( int num, int defIndex ) | 492 | int OPimContactFields::getFieldOrder( int num, int defIndex ) |
491 | { | 493 | { |
492 | qDebug( "ocontactfields getFieldOrder" ); | 494 | odebug << "ocontactfields getFieldOrder" << oendl; |
493 | qDebug( "fieldOrder >%s<", fieldOrder.latin1() ); | 495 | odebug << "fieldOrder >" << fieldOrder << "<" << oendl; |
494 | 496 | ||
495 | // Get index of combo as char.. | 497 | // Get index of combo as char.. |
496 | QChar poschar = fieldOrder[ num ]; | 498 | QChar poschar = fieldOrder[ num ]; |
497 | 499 | ||
498 | bool ok; | 500 | bool ok; |
499 | int ret = 0; | 501 | int ret = 0; |
@@ -504,13 +506,13 @@ int OPimContactFields::getFieldOrder( int num, int defIndex ) | |||
504 | ok = false; | 506 | ok = false; |
505 | 507 | ||
506 | // Return default value if index for | 508 | // Return default value if index for |
507 | // num was not set or if anything else happened.. | 509 | // num was not set or if anything else happened.. |
508 | if ( !ok ) ret = defIndex; | 510 | if ( !ok ) ret = defIndex; |
509 | 511 | ||
510 | qDebug( "returning >%i<", ret ); | 512 | odebug << "returning >" << ret << "<" << oendl; |
511 | 513 | ||
512 | return ret; | 514 | return ret; |
513 | 515 | ||
514 | } | 516 | } |
515 | 517 | ||
516 | } | 518 | } |
diff --git a/libopie2/opiepim/core/opimdateconversion.cpp b/libopie2/opiepim/core/opimdateconversion.cpp index 8bf891b..c93e178 100644 --- a/libopie2/opiepim/core/opimdateconversion.cpp +++ b/libopie2/opiepim/core/opimdateconversion.cpp | |||
@@ -25,12 +25,14 @@ _;:, .> :=|. This program is free software; you can | |||
25 | Inc., 59 Temple Place - Suite 330, | 25 | Inc., 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | /* OPIE */ | 29 | /* OPIE */ |
30 | #include <opie2/opimdateconversion.h> | 30 | #include <opie2/opimdateconversion.h> |
31 | #include <opie2/odebug.h> | ||
32 | |||
31 | #include <qpe/timeconversion.h> | 33 | #include <qpe/timeconversion.h> |
32 | 34 | ||
33 | namespace Opie | 35 | namespace Opie |
34 | { | 36 | { |
35 | 37 | ||
36 | QString OPimDateConversion::dateToString( const QDate &d ) | 38 | QString OPimDateConversion::dateToString( const QDate &d ) |
@@ -43,13 +45,13 @@ QString OPimDateConversion::dateToString( const QDate &d ) | |||
43 | QString month = QString::number( d.month() ); | 45 | QString month = QString::number( d.month() ); |
44 | month = month.rightJustify( 2, '0' ); | 46 | month = month.rightJustify( 2, '0' ); |
45 | QString day = QString::number( d.day() ); | 47 | QString day = QString::number( d.day() ); |
46 | day = day.rightJustify( 2, '0' ); | 48 | day = day.rightJustify( 2, '0' ); |
47 | 49 | ||
48 | QString str = year + month + day; | 50 | QString str = year + month + day; |
49 | //qDebug( "\tPimContact dateToStr = %s", str.latin1() ); | 51 | //odebug << "\tPimContact dateToStr = " << str << "" << oendl; |
50 | 52 | ||
51 | return str; | 53 | return str; |
52 | } | 54 | } |
53 | 55 | ||
54 | 56 | ||
55 | QDate OPimDateConversion::dateFromString( const QString& s ) | 57 | QDate OPimDateConversion::dateFromString( const QString& s ) |
@@ -71,30 +73,30 @@ QDate OPimDateConversion::dateFromString( const QString& s ) | |||
71 | int day = s.mid( 6, 2 ).toInt(); | 73 | int day = s.mid( 6, 2 ).toInt(); |
72 | 74 | ||
73 | // do some quick sanity checking -eilers | 75 | // do some quick sanity checking -eilers |
74 | // but we isValid() again? -zecke | 76 | // but we isValid() again? -zecke |
75 | if ( year < 1900 || year > 3000 ) | 77 | if ( year < 1900 || year > 3000 ) |
76 | { | 78 | { |
77 | qWarning( "PimContact year is not in range" ); | 79 | owarn << "PimContact year is not in range" << oendl; |
78 | return date; | 80 | return date; |
79 | } | 81 | } |
80 | if ( month < 0 || month > 12 ) | 82 | if ( month < 0 || month > 12 ) |
81 | { | 83 | { |
82 | qWarning( "PimContact month is not in range" ); | 84 | owarn << "PimContact month is not in range" << oendl; |
83 | return date; | 85 | return date; |
84 | } | 86 | } |
85 | if ( day < 0 || day > 31 ) | 87 | if ( day < 0 || day > 31 ) |
86 | { | 88 | { |
87 | qWarning( "PimContact day is not in range" ); | 89 | owarn << "PimContact day is not in range" << oendl; |
88 | return date; | 90 | return date; |
89 | } | 91 | } |
90 | 92 | ||
91 | date.setYMD( year, month, day ); | 93 | date.setYMD( year, month, day ); |
92 | if ( !date.isValid() ) | 94 | if ( !date.isValid() ) |
93 | { | 95 | { |
94 | qWarning( "PimContact date is not valid" ); | 96 | owarn << "PimContact date is not valid" << oendl; |
95 | return date; | 97 | return date; |
96 | } | 98 | } |
97 | 99 | ||
98 | return date; | 100 | return date; |
99 | } | 101 | } |
100 | 102 | ||
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp index 9d46651..8752fce 100644 --- a/libopie2/opiepim/core/opimevent.cpp +++ b/libopie2/opiepim/core/opimevent.cpp | |||
@@ -30,12 +30,14 @@ | |||
30 | #include "opimevent.h" | 30 | #include "opimevent.h" |
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/opimrecurrence.h> | 33 | #include <opie2/opimrecurrence.h> |
34 | #include <opie2/opimresolver.h> | 34 | #include <opie2/opimresolver.h> |
35 | #include <opie2/opimnotifymanager.h> | 35 | #include <opie2/opimnotifymanager.h> |
36 | #include <opie2/odebug.h> | ||
37 | |||
36 | #include <qpe/categories.h> | 38 | #include <qpe/categories.h> |
37 | #include <qpe/stringutil.h> | 39 | #include <qpe/stringutil.h> |
38 | 40 | ||
39 | /* QT */ | 41 | /* QT */ |
40 | 42 | ||
41 | namespace Opie | 43 | namespace Opie |
@@ -552,17 +554,17 @@ QMap<int, QString> OPimEvent::toMap() const | |||
552 | 554 | ||
553 | retMap.insert( OPimEvent::FUid, QString::number( uid() ) ); | 555 | retMap.insert( OPimEvent::FUid, QString::number( uid() ) ); |
554 | retMap.insert( OPimEvent::FCategories, Qtopia::escapeString( Qtopia::Record::idsToString( categories() ) ) ); | 556 | retMap.insert( OPimEvent::FCategories, Qtopia::escapeString( Qtopia::Record::idsToString( categories() ) ) ); |
555 | retMap.insert( OPimEvent::FDescription, Qtopia::escapeString( description() ) ); | 557 | retMap.insert( OPimEvent::FDescription, Qtopia::escapeString( description() ) ); |
556 | retMap.insert( OPimEvent::FLocation, Qtopia::escapeString( location() ) ); | 558 | retMap.insert( OPimEvent::FLocation, Qtopia::escapeString( location() ) ); |
557 | retMap.insert( OPimEvent::FType, isAllDay() ? "AllDay" : "" ); | 559 | retMap.insert( OPimEvent::FType, isAllDay() ? "AllDay" : "" ); |
558 | if ( notifiers().alarms().count() ){ | 560 | if ( notifiers().alarms().count() ){ |
559 | // Currently we just support one alarm.. (eilers) | 561 | // Currently we just support one alarm.. (eilers) |
560 | OPimAlarm alarm = notifiers().alarms() [ 0 ]; | 562 | OPimAlarm alarm = notifiers().alarms() [ 0 ]; |
561 | retMap.insert( OPimEvent::FAlarm, QString::number( alarm.dateTime().secsTo( startDateTime() ) / 60 ) ); | 563 | retMap.insert( OPimEvent::FAlarm, QString::number( alarm.dateTime().secsTo( startDateTime() ) / 60 ) ); |
562 | retMap.insert( OPimEvent::FSound, ( alarm.sound() == OPimAlarm::Loud ) ? "loud" : "silent" ); | 564 | retMap.insert( OPimEvent::FSound, ( alarm.sound() == OPimAlarm::Loud ) ? "loud" : "silent" ); |
563 | } | 565 | } |
564 | 566 | ||
565 | OPimTimeZone zone( timeZone().isEmpty() ? OPimTimeZone::current() : timeZone() ); | 567 | OPimTimeZone zone( timeZone().isEmpty() ? OPimTimeZone::current() : timeZone() ); |
566 | retMap.insert( OPimEvent::FStart, QString::number( zone.fromUTCDateTime( zone.toDateTime( startDateTime(), OPimTimeZone::utc() ) ) ) ); | 568 | retMap.insert( OPimEvent::FStart, QString::number( zone.fromUTCDateTime( zone.toDateTime( startDateTime(), OPimTimeZone::utc() ) ) ) ); |
567 | retMap.insert( OPimEvent::FEnd, QString::number( zone.fromUTCDateTime( zone.toDateTime( endDateTime(), OPimTimeZone::utc() ) ) ) ); | 569 | retMap.insert( OPimEvent::FEnd, QString::number( zone.fromUTCDateTime( zone.toDateTime( endDateTime(), OPimTimeZone::utc() ) ) ) ); |
568 | retMap.insert( OPimEvent::FNote, Qtopia::escapeString( note() ) ); | 570 | retMap.insert( OPimEvent::FNote, Qtopia::escapeString( note() ) ); |
@@ -638,16 +640,16 @@ void OPimEvent::fromMap( const QMap<int, QString>& map ) | |||
638 | setEndDateTime ( utc.fromUTCDateTime( end ) ); | 640 | setEndDateTime ( utc.fromUTCDateTime( end ) ); |
639 | setTimeZone( "UTC" ); // make sure it is really utc | 641 | setTimeZone( "UTC" ); // make sure it is really utc |
640 | } | 642 | } |
641 | else | 643 | else |
642 | { | 644 | { |
643 | /* to current date time */ | 645 | /* to current date time */ |
644 | // qWarning(" Start is %d", start ); | 646 | // owarn << " Start is " << start << "" << oendl; |
645 | OPimTimeZone zone( timeZone().isEmpty() ? OPimTimeZone::current() : timeZone() ); | 647 | OPimTimeZone zone( timeZone().isEmpty() ? OPimTimeZone::current() : timeZone() ); |
646 | QDateTime date = zone.toDateTime( start ); | 648 | QDateTime date = zone.toDateTime( start ); |
647 | qWarning( " Start is %s", date.toString().latin1() ); | 649 | owarn << " Start is " << date.toString() << "" << oendl; |
648 | setStartDateTime( zone.toDateTime( date, OPimTimeZone::current() ) ); | 650 | setStartDateTime( zone.toDateTime( date, OPimTimeZone::current() ) ); |
649 | 651 | ||
650 | date = zone.toDateTime( end ); | 652 | date = zone.toDateTime( end ); |
651 | setEndDateTime ( zone.toDateTime( date, OPimTimeZone::current() ) ); | 653 | setEndDateTime ( zone.toDateTime( date, OPimTimeZone::current() ) ); |
652 | } | 654 | } |
653 | 655 | ||
@@ -655,20 +657,20 @@ void OPimEvent::fromMap( const QMap<int, QString>& map ) | |||
655 | if ( !map[ OPimEvent::FAlarm ].isEmpty() ) | 657 | if ( !map[ OPimEvent::FAlarm ].isEmpty() ) |
656 | alarmTime = map[ OPimEvent::FAlarm ].toInt(); | 658 | alarmTime = map[ OPimEvent::FAlarm ].toInt(); |
657 | 659 | ||
658 | int sound = ( ( map[ OPimEvent::FSound ] == "loud" ) ? OPimAlarm::Loud : OPimAlarm::Silent ); | 660 | int sound = ( ( map[ OPimEvent::FSound ] == "loud" ) ? OPimAlarm::Loud : OPimAlarm::Silent ); |
659 | if ( ( alarmTime != -1 ) ) | 661 | if ( ( alarmTime != -1 ) ) |
660 | { | 662 | { |
661 | QDateTime dt = startDateTime().addSecs( -1 * alarmTime * 60 ); | 663 | QDateTime dt = startDateTime().addSecs( -1 * alarmTime * 60 ); |
662 | OPimAlarm al( sound , dt ); | 664 | OPimAlarm al( sound , dt ); |
663 | notifiers().add( al ); | 665 | notifiers().add( al ); |
664 | } | 666 | } |
665 | 667 | ||
666 | 668 | ||
667 | if ( !map[ OPimEvent::FNote ].isEmpty() ) | 669 | if ( !map[ OPimEvent::FNote ].isEmpty() ) |
668 | setNote( map[ OPimEvent::FNote ] ); | 670 | setNote( map[ OPimEvent::FNote ] ); |
669 | 671 | ||
670 | if ( !map[ OPimEvent::FRecParent ].isEmpty() ) | 672 | if ( !map[ OPimEvent::FRecParent ].isEmpty() ) |
671 | setParent( map[ OPimEvent::FRecParent ].toInt() ); | 673 | setParent( map[ OPimEvent::FRecParent ].toInt() ); |
672 | 674 | ||
673 | if ( !map[ OPimEvent::FRecChildren ].isEmpty() ) | 675 | if ( !map[ OPimEvent::FRecChildren ].isEmpty() ) |
674 | { | 676 | { |
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp index 573340a..0f863aa 100644 --- a/libopie2/opiepim/core/opimnotifymanager.cpp +++ b/libopie2/opiepim/core/opimnotifymanager.cpp | |||
@@ -28,12 +28,13 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "opimnotifymanager.h" | 30 | #include "opimnotifymanager.h" |
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/opimdateconversion.h> | 33 | #include <opie2/opimdateconversion.h> |
34 | #include <opie2/odebug.h> | ||
34 | 35 | ||
35 | /* QT */ | 36 | /* QT */ |
36 | #include <qstringlist.h> | 37 | #include <qstringlist.h> |
37 | 38 | ||
38 | namespace Opie | 39 | namespace Opie |
39 | { | 40 | { |
@@ -160,13 +161,13 @@ void OPimNotifyManager::deregister( const OPimNotify& ) | |||
160 | { | 161 | { |
161 | } | 162 | } |
162 | 163 | ||
163 | 164 | ||
164 | bool OPimNotifyManager::isEmpty() const | 165 | bool OPimNotifyManager::isEmpty() const |
165 | { | 166 | { |
166 | qWarning( "is Empty called on OPimNotifyManager %d %d", m_rem.count(), m_al.count() ); | 167 | owarn << "is Empty called on OPimNotifyManager " << m_rem.count() << " " << m_al.count() << "" << oendl; |
167 | if ( m_rem.isEmpty() && m_al.isEmpty() ) return true; | 168 | if ( m_rem.isEmpty() && m_al.isEmpty() ) return true; |
168 | else return false; | 169 | else return false; |
169 | } | 170 | } |
170 | 171 | ||
171 | 172 | ||
172 | // Taken from otodoaccessxml.. code duplication bad. any alternative? | 173 | // Taken from otodoaccessxml.. code duplication bad. any alternative? |
@@ -188,13 +189,13 @@ QString OPimNotifyManager::alarmsToString() const | |||
188 | + ":" + QString::number( ( *it ).duration() ) | 189 | + ":" + QString::number( ( *it ).duration() ) |
189 | + ":" + QString::number( ( *it ).sound() ) | 190 | + ":" + QString::number( ( *it ).sound() ) |
190 | + ":"; | 191 | + ":"; |
191 | } | 192 | } |
192 | } | 193 | } |
193 | // now write the list | 194 | // now write the list |
194 | qWarning( "als: %s", als.join( "____________" ).latin1() ); | 195 | owarn << "als: " << als.join( "____________" ) << "" << oendl; |
195 | str = als.join( ";" ); | 196 | str = als.join( ";" ); |
196 | } | 197 | } |
197 | 198 | ||
198 | return str; | 199 | return str; |
199 | } | 200 | } |
200 | 201 | ||
@@ -222,13 +223,13 @@ QString OPimNotifyManager::remindersToString() const | |||
222 | void OPimNotifyManager::alarmsFromString( const QString& str ) | 223 | void OPimNotifyManager::alarmsFromString( const QString& str ) |
223 | { | 224 | { |
224 | QStringList als = QStringList::split( ";", str ); | 225 | QStringList als = QStringList::split( ";", str ); |
225 | for ( QStringList::Iterator it = als.begin(); it != als.end(); ++it ) | 226 | for ( QStringList::Iterator it = als.begin(); it != als.end(); ++it ) |
226 | { | 227 | { |
227 | QStringList alarm = QStringList::split( ":", ( *it ), TRUE ); // allow empty | 228 | QStringList alarm = QStringList::split( ":", ( *it ), TRUE ); // allow empty |
228 | qWarning( "alarm: %s", alarm.join( "___" ).latin1() ); | 229 | owarn << "alarm: " << alarm.join( "___" ) << "" << oendl; |
229 | qWarning( "alarm[0]: %s %s", alarm[ 0 ].latin1(), | 230 | qWarning( "alarm[0]: %s %s", alarm[ 0 ].latin1(), |
230 | OPimDateConversion::dateTimeFromString( alarm[ 0 ] ).toString().latin1() ); | 231 | OPimDateConversion::dateTimeFromString( alarm[ 0 ] ).toString().latin1() ); |
231 | OPimAlarm al( alarm[ 2 ].toInt(), OPimDateConversion::dateTimeFromString( alarm[ 0 ] ), | 232 | OPimAlarm al( alarm[ 2 ].toInt(), OPimDateConversion::dateTimeFromString( alarm[ 0 ] ), |
232 | alarm[ 1 ].toInt() ); | 233 | alarm[ 1 ].toInt() ); |
233 | add( al ); | 234 | add( al ); |
234 | } | 235 | } |
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp index c783092..6546d99 100644 --- a/libopie2/opiepim/core/opimrecord.cpp +++ b/libopie2/opiepim/core/opimrecord.cpp | |||
@@ -118,13 +118,13 @@ bool OPimRecord::isEmpty() const | |||
118 | QArray<int> id = it.data(); | 118 | QArray<int> id = it.data(); |
119 | for ( uint i = 0; i < id.size(); ++i ) { | 119 | for ( uint i = 0; i < id.size(); ++i ) { |
120 | str += it.key() + "," + QString::number( i ) + ";"; | 120 | str += it.key() + "," + QString::number( i ) + ";"; |
121 | } | 121 | } |
122 | } | 122 | } |
123 | str = str.remove( str.length()-1, 1); // strip the ; | 123 | str = str.remove( str.length()-1, 1); // strip the ; |
124 | //qWarning("IDS " + str ); | 124 | //owarn << "IDS " + str << oendl; |
125 | 125 | ||
126 | return str; | 126 | return str; |
127 | }*/ | 127 | }*/ |
128 | /* if uid = 1 assign a new one */ | 128 | /* if uid = 1 assign a new one */ |
129 | void OPimRecord::setUid( int uid ) | 129 | void OPimRecord::setUid( int uid ) |
130 | { | 130 | { |
diff --git a/libopie2/opiepim/core/opimtimezone.cpp b/libopie2/opiepim/core/opimtimezone.cpp index be21b1b..fefceb5 100644 --- a/libopie2/opiepim/core/opimtimezone.cpp +++ b/libopie2/opiepim/core/opimtimezone.cpp | |||
@@ -26,12 +26,15 @@ | |||
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "opimtimezone.h" | 30 | #include "opimtimezone.h" |
31 | 31 | ||
32 | /* OPIE */ | ||
33 | #include <opie2/odebug.h> | ||
34 | |||
32 | /* STD */ | 35 | /* STD */ |
33 | #include <stdio.h> | 36 | #include <stdio.h> |
34 | #include <stdlib.h> | 37 | #include <stdlib.h> |
35 | #include <sys/types.h> | 38 | #include <sys/types.h> |
36 | 39 | ||
37 | namespace Opie | 40 | namespace Opie |
@@ -146,13 +149,13 @@ QDateTime OPimTimeZone::toDateTime( time_t t ) | |||
146 | * convert dt to utc using zone.m_name | 149 | * convert dt to utc using zone.m_name |
147 | * convert utc -> timeZoneDT using this->m_name | 150 | * convert utc -> timeZoneDT using this->m_name |
148 | */ | 151 | */ |
149 | QDateTime OPimTimeZone::toDateTime( const QDateTime& dt, const OPimTimeZone& zone ) | 152 | QDateTime OPimTimeZone::toDateTime( const QDateTime& dt, const OPimTimeZone& zone ) |
150 | { | 153 | { |
151 | time_t utc = to_Time_t( dt, zone.m_name ); | 154 | time_t utc = to_Time_t( dt, zone.m_name ); |
152 | qWarning( "%d %s", utc, zone.m_name.latin1() ); | 155 | owarn << "" << utc << " " << zone.m_name << "" << oendl; |
153 | return utcTime( utc, m_name ); | 156 | return utcTime( utc, m_name ); |
154 | } | 157 | } |
155 | 158 | ||
156 | 159 | ||
157 | time_t OPimTimeZone::fromDateTime( const QDateTime& time ) | 160 | time_t OPimTimeZone::fromDateTime( const QDateTime& time ) |
158 | { | 161 | { |
diff --git a/libopie2/opiepim/core/opimtodo.cpp b/libopie2/opiepim/core/opimtodo.cpp index 47433e0..27b36a6 100644 --- a/libopie2/opiepim/core/opimtodo.cpp +++ b/libopie2/opiepim/core/opimtodo.cpp | |||
@@ -32,12 +32,14 @@ | |||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/opimstate.h> | 33 | #include <opie2/opimstate.h> |
34 | #include <opie2/opimrecurrence.h> | 34 | #include <opie2/opimrecurrence.h> |
35 | #include <opie2/opimmaintainer.h> | 35 | #include <opie2/opimmaintainer.h> |
36 | #include <opie2/opimnotifymanager.h> | 36 | #include <opie2/opimnotifymanager.h> |
37 | #include <opie2/opimresolver.h> | 37 | #include <opie2/opimresolver.h> |
38 | #include <opie2/odebug.h> | ||
39 | |||
38 | #include <qpe/palmtopuidgen.h> | 40 | #include <qpe/palmtopuidgen.h> |
39 | #include <qpe/palmtoprecord.h> | 41 | #include <qpe/palmtoprecord.h> |
40 | #include <qpe/categories.h> | 42 | #include <qpe/categories.h> |
41 | #include <qpe/categoryselect.h> | 43 | #include <qpe/categoryselect.h> |
42 | #include <qpe/stringutil.h> | 44 | #include <qpe/stringutil.h> |
43 | 45 | ||
@@ -82,23 +84,23 @@ struct OPimTodo::OPimTodoData : public QShared | |||
82 | 84 | ||
83 | 85 | ||
84 | OPimTodo::OPimTodo( const OPimTodo &event ) | 86 | OPimTodo::OPimTodo( const OPimTodo &event ) |
85 | : OPimRecord( event ), data( event.data ) | 87 | : OPimRecord( event ), data( event.data ) |
86 | { | 88 | { |
87 | data->ref(); | 89 | data->ref(); |
88 | // qWarning("ref up"); | 90 | // owarn << "ref up" << oendl; |
89 | } | 91 | } |
90 | 92 | ||
91 | 93 | ||
92 | OPimTodo::~OPimTodo() | 94 | OPimTodo::~OPimTodo() |
93 | { | 95 | { |
94 | 96 | ||
95 | // qWarning("~OPimTodo " ); | 97 | // owarn << "~OPimTodo " << oendl; |
96 | if ( data->deref() ) | 98 | if ( data->deref() ) |
97 | { | 99 | { |
98 | // qWarning("OPimTodo::dereffing"); | 100 | // owarn << "OPimTodo::dereffing" << oendl; |
99 | delete data; | 101 | delete data; |
100 | data = 0l; | 102 | data = 0l; |
101 | } | 103 | } |
102 | } | 104 | } |
103 | 105 | ||
104 | 106 | ||
@@ -107,13 +109,13 @@ OPimTodo::OPimTodo( bool completed, int priority, | |||
107 | const QString& summary, | 109 | const QString& summary, |
108 | const QString &description, | 110 | const QString &description, |
109 | ushort progress, | 111 | ushort progress, |
110 | bool hasDate, QDate date, int uid ) | 112 | bool hasDate, QDate date, int uid ) |
111 | : OPimRecord( uid ) | 113 | : OPimRecord( uid ) |
112 | { | 114 | { |
113 | // qWarning("OPimTodoData " + summary); | 115 | // owarn << "OPimTodoData " + summary << oendl; |
114 | setCategories( category ); | 116 | setCategories( category ); |
115 | 117 | ||
116 | data = new OPimTodoData; | 118 | data = new OPimTodoData; |
117 | 119 | ||
118 | data->date = date; | 120 | data->date = date; |
119 | data->isCompleted = completed; | 121 | data->isCompleted = completed; |
@@ -130,13 +132,13 @@ OPimTodo::OPimTodo( bool completed, int priority, | |||
130 | const QString& summary, | 132 | const QString& summary, |
131 | const QString &description, | 133 | const QString &description, |
132 | ushort progress, | 134 | ushort progress, |
133 | bool hasDate, QDate date, int uid ) | 135 | bool hasDate, QDate date, int uid ) |
134 | : OPimRecord( uid ) | 136 | : OPimRecord( uid ) |
135 | { | 137 | { |
136 | // qWarning("OPimTodoData" + summary); | 138 | // owarn << "OPimTodoData" + summary << oendl; |
137 | setCategories( idsFromString( category.join( ";" ) ) ); | 139 | setCategories( idsFromString( category.join( ";" ) ) ); |
138 | 140 | ||
139 | data = new OPimTodoData; | 141 | data = new OPimTodoData; |
140 | 142 | ||
141 | data->date = date; | 143 | data->date = date; |
142 | data->isCompleted = completed; | 144 | data->isCompleted = completed; |
@@ -303,13 +305,13 @@ void OPimTodo::setHasDueDate( bool hasDate ) | |||
303 | data->hasDate = hasDate; | 305 | data->hasDate = hasDate; |
304 | } | 306 | } |
305 | 307 | ||
306 | 308 | ||
307 | void OPimTodo::setDescription( const QString &desc ) | 309 | void OPimTodo::setDescription( const QString &desc ) |
308 | { | 310 | { |
309 | // qWarning( "desc " + desc ); | 311 | // owarn << "desc " + desc << oendl; |
310 | changeOrModify(); | 312 | changeOrModify(); |
311 | data->desc = Qtopia::simplifyMultiLineSpace( desc ); | 313 | data->desc = Qtopia::simplifyMultiLineSpace( desc ); |
312 | } | 314 | } |
313 | 315 | ||
314 | 316 | ||
315 | void OPimTodo::setSummary( const QString& sum ) | 317 | void OPimTodo::setSummary( const QString& sum ) |
@@ -588,28 +590,28 @@ bool OPimTodo::operator==( const OPimTodo &toDoEvent ) const | |||
588 | } | 590 | } |
589 | 591 | ||
590 | 592 | ||
591 | void OPimTodo::deref() | 593 | void OPimTodo::deref() |
592 | { | 594 | { |
593 | 595 | ||
594 | // qWarning("deref in ToDoEvent"); | 596 | // owarn << "deref in ToDoEvent" << oendl; |
595 | if ( data->deref() ) | 597 | if ( data->deref() ) |
596 | { | 598 | { |
597 | // qWarning("deleting"); | 599 | // owarn << "deleting" << oendl; |
598 | delete data; | 600 | delete data; |
599 | data = 0; | 601 | data = 0; |
600 | } | 602 | } |
601 | } | 603 | } |
602 | 604 | ||
603 | 605 | ||
604 | OPimTodo &OPimTodo::operator=( const OPimTodo &item ) | 606 | OPimTodo &OPimTodo::operator=( const OPimTodo &item ) |
605 | { | 607 | { |
606 | if ( this == &item ) return * this; | 608 | if ( this == &item ) return * this; |
607 | 609 | ||
608 | OPimRecord::operator=( item ); | 610 | OPimRecord::operator=( item ); |
609 | //qWarning("operator= ref "); | 611 | //owarn << "operator= ref " << oendl; |
610 | item.data->ref(); | 612 | item.data->ref(); |
611 | deref(); | 613 | deref(); |
612 | data = item.data; | 614 | data = item.data; |
613 | 615 | ||
614 | return *this; | 616 | return *this; |
615 | } | 617 | } |
@@ -646,13 +648,13 @@ QMap<int, QString> OPimTodo::toMap() const | |||
646 | * right in place | 648 | * right in place |
647 | */ | 649 | */ |
648 | void OPimTodo::changeOrModify() | 650 | void OPimTodo::changeOrModify() |
649 | { | 651 | { |
650 | if ( data->count != 1 ) | 652 | if ( data->count != 1 ) |
651 | { | 653 | { |
652 | qWarning( "changeOrModify" ); | 654 | owarn << "changeOrModify" << oendl; |
653 | data->deref(); | 655 | data->deref(); |
654 | OPimTodoData* d2 = new OPimTodoData(); | 656 | OPimTodoData* d2 = new OPimTodoData(); |
655 | copy( data, d2 ); | 657 | copy( data, d2 ); |
656 | data = d2; | 658 | data = d2; |
657 | } | 659 | } |
658 | } | 660 | } |
diff --git a/libopie2/opiepim/core/otodoaccess.cpp b/libopie2/opiepim/core/otodoaccess.cpp index c4adbbd..26a68a0 100644 --- a/libopie2/opiepim/core/otodoaccess.cpp +++ b/libopie2/opiepim/core/otodoaccess.cpp | |||
@@ -47,13 +47,13 @@ OPimTodoAccess::OPimTodoAccess( OPimTodoAccessBackend* end, enum Access ) | |||
47 | if (end == 0l ) | 47 | if (end == 0l ) |
48 | m_todoBackEnd = OBackendFactory<OPimTodoAccessBackend>::defaultBackend (OPimGlobal::TODOLIST, QString::null); | 48 | m_todoBackEnd = OBackendFactory<OPimTodoAccessBackend>::defaultBackend (OPimGlobal::TODOLIST, QString::null); |
49 | 49 | ||
50 | setBackEnd( m_todoBackEnd ); | 50 | setBackEnd( m_todoBackEnd ); |
51 | } | 51 | } |
52 | OPimTodoAccess::~OPimTodoAccess() { | 52 | OPimTodoAccess::~OPimTodoAccess() { |
53 | // qWarning("~OPimTodoAccess"); | 53 | // owarn << "~OPimTodoAccess" << oendl; |
54 | } | 54 | } |
55 | void OPimTodoAccess::mergeWith( const QValueList<OPimTodo>& list ) { | 55 | void OPimTodoAccess::mergeWith( const QValueList<OPimTodo>& list ) { |
56 | QValueList<OPimTodo>::ConstIterator it; | 56 | QValueList<OPimTodo>::ConstIterator it; |
57 | for ( it = list.begin(); it != list.end(); ++it ) { | 57 | for ( it = list.begin(); it != list.end(); ++it ) { |
58 | replace( (*it) ); | 58 | replace( (*it) ); |
59 | } | 59 | } |