23 files changed, 272 insertions, 208 deletions
diff --git a/libopie2/opiedb/osqlbackendmanager.cpp b/libopie2/opiedb/osqlbackendmanager.cpp index fc18e07..bbfbf3d 100644 --- a/libopie2/opiedb/osqlbackendmanager.cpp +++ b/libopie2/opiedb/osqlbackendmanager.cpp | |||
@@ -1,7 +1,13 @@ | |||
1 | |||
2 | #include "osqlbackendmanager.h" | ||
3 | |||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
6 | |||
7 | /* QT */ | ||
1 | #include <qdir.h> | 8 | #include <qdir.h> |
2 | #include <qmap.h> | 9 | #include <qmap.h> |
3 | 10 | ||
4 | #include "osqlbackendmanager.h" | ||
5 | 11 | ||
6 | /** | 12 | /** |
7 | * \todo FIXME CONFIG!!! | 13 | * \todo FIXME CONFIG!!! |
@@ -38,7 +44,7 @@ namespace { | |||
38 | QString line; | 44 | QString line; |
39 | for (it = list.begin(); it != list.end(); ++it ) { | 45 | for (it = list.begin(); it != list.end(); ++it ) { |
40 | line = (*it).stripWhiteSpace(); | 46 | line = (*it).stripWhiteSpace(); |
41 | qWarning("Anonymous::Config:" + line ); | 47 | owarn << "Anonymous::Config:" + line << oendl; |
42 | QStringList test = QStringList::split(' ', line ); | 48 | QStringList test = QStringList::split(' ', line ); |
43 | m_list.insert( test[0], test[2] ); | 49 | m_list.insert( test[0], test[2] ); |
44 | } | 50 | } |
@@ -92,7 +98,7 @@ OSQLBackEnd::ValueList OSQLBackEndManager::scanDir( const QString& dirName ) { | |||
92 | */ | 98 | */ |
93 | OSQLBackEnd OSQLBackEndManager::file2backend( const QString& file ) { | 99 | OSQLBackEnd OSQLBackEndManager::file2backend( const QString& file ) { |
94 | OSQLBackEnd end; | 100 | OSQLBackEnd end; |
95 | qWarning("fileName: " + file ); | 101 | owarn << "fileName: " + file << oendl; |
96 | Config cfg( file ); | 102 | Config cfg( file ); |
97 | if (cfg.load() ) { | 103 | if (cfg.load() ) { |
98 | end.setName( cfg.value( "Name") ); | 104 | end.setName( cfg.value( "Name") ); |
diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp index 588fc8f..69eddfe 100644 --- a/libopie2/opiedb/osqlitedriver.cpp +++ b/libopie2/opiedb/osqlitedriver.cpp | |||
@@ -124,7 +124,7 @@ void rlikeFunc(sqlite_func *context, int arg, const char **argv){ | |||
124 | bool OSQLiteDriver::open() { | 124 | bool OSQLiteDriver::open() { |
125 | char *error; | 125 | char *error; |
126 | 126 | ||
127 | qDebug("OSQLiteDriver::open: about to open"); | 127 | odebug << "OSQLiteDriver::open: about to open" << oendl; |
128 | m_sqlite = sqlite_open(m_url.local8Bit(), | 128 | m_sqlite = sqlite_open(m_url.local8Bit(), |
129 | 0, | 129 | 0, |
130 | &error ); | 130 | &error ); |
@@ -132,7 +132,7 @@ bool OSQLiteDriver::open() { | |||
132 | /* failed to open */ | 132 | /* failed to open */ |
133 | if (m_sqlite == 0l ) { | 133 | if (m_sqlite == 0l ) { |
134 | // FIXME set the last error | 134 | // FIXME set the last error |
135 | qWarning("OSQLiteDriver::open: %s", error ); | 135 | owarn << "OSQLiteDriver::open: " << error << "" << oendl; |
136 | free( error ); | 136 | free( error ); |
137 | return false; | 137 | return false; |
138 | } | 138 | } |
@@ -174,7 +174,7 @@ OSQLResult OSQLiteDriver::query( OSQLQuery* qu) { | |||
174 | char *err; | 174 | char *err; |
175 | /* SQLITE_OK 0 if return code > 0 == failure */ | 175 | /* SQLITE_OK 0 if return code > 0 == failure */ |
176 | if ( sqlite_exec(m_sqlite, qu->query(),&call_back, &query, &err) > 0 ) { | 176 | if ( sqlite_exec(m_sqlite, qu->query(),&call_back, &query, &err) > 0 ) { |
177 | qWarning("OSQLiteDriver::query: Error while executing %s",err); | 177 | owarn << "OSQLiteDriver::query: Error while executing " << err << "" << oendl; |
178 | free(err ); | 178 | free(err ); |
179 | // FixMe Errors | 179 | // FixMe Errors |
180 | } | 180 | } |
diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp index c00585d..2b17230 100644 --- a/libopie2/opiemm/osoundsystem.cpp +++ b/libopie2/opiemm/osoundsystem.cpp | |||
@@ -82,7 +82,7 @@ void OSoundSystem::synchronize() | |||
82 | { | 82 | { |
83 | s >> str; | 83 | s >> str; |
84 | str.truncate( str.find( ':' ) ); | 84 | str.truncate( str.find( ':' ) ); |
85 | qDebug( "OSoundSystem: found interface '%s'", (const char*) str ); | 85 | odebug << "OSoundSystem: found interface '" << str << "'" << oendl; |
86 | OAudioInterface* iface; | 86 | OAudioInterface* iface; |
87 | iface = new OAudioInterface( this, (const char*) str ); | 87 | iface = new OAudioInterface( this, (const char*) str ); |
88 | 88 | ||
@@ -237,8 +237,8 @@ void OMixerInterface::init() | |||
237 | /* ChannelIterator it; | 237 | /* ChannelIterator it; |
238 | for ( it = _channels.begin(); it != _channels.end(); ++it ) | 238 | for ( it = _channels.begin(); it != _channels.end(); ++it ) |
239 | { | 239 | { |
240 | qDebug( "Channel %s available (bit %d)", (const char*) it.key(), it.data() ); | 240 | odebug << "Channel " << it.key() << " available (bit " << it.data() << ")" << oendl; |
241 | qDebug( " +--- Volume: %02d | %02d", volume( it.key() ) & 0xff, volume( it.key() ) >> 8 ); | 241 | odebug << " +--- Volume: " << volume( it.key() ) & 0xff << " | " << volume( it.key() ) >> 8 << "" << oendl; |
242 | } | 242 | } |
243 | */ | 243 | */ |
244 | } | 244 | } |
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index e141097..67718ba 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp | |||
@@ -605,10 +605,13 @@ void OWirelessNetworkInterface::dumpInformation() const | |||
605 | { | 605 | { |
606 | odebug << "OWirelessNetworkInterface::() -------------- dumping information block ----------------" << oendl; | 606 | odebug << "OWirelessNetworkInterface::() -------------- dumping information block ----------------" << oendl; |
607 | 607 | ||
608 | qDebug( " - driver's idea of maximum throughput is %d bps = %d byte/s = %d Kb/s = %f.2 Mb/s", | 608 | odebug << " - driver's idea of maximum throughput is " << _range.throughput |
609 | _range.throughput, _range.throughput / 8, _range.throughput / 8 / 1024, float( _range.throughput ) / 8.0 / 1024.0 / 1024.0 ); | 609 | << " bps = " << ( _range.throughput / 8 ) << " byte/s = " << ( _range.throughput / 8 / 1024 ) |
610 | qDebug( " - driver for '%s' (V%d) has been compiled against WE V%d", | 610 | << " Kb/s = " << QString().sprintf("%f.2", float( _range.throughput ) / 8.0 / 1024.0 / 1024.0 ) |
611 | name(), _range.we_version_source, _range.we_version_compiled ); | 611 | << " Mb/s" << oendl; |
612 | |||
613 | odebug << " - driver for '" << name() << "' (V" << _range.we_version_source | ||
614 | << ") has been compiled against WE V" << _range.we_version_compiled << oendl; | ||
612 | 615 | ||
613 | if ( _range.we_version_compiled != WIRELESS_EXT ) | 616 | if ( _range.we_version_compiled != WIRELESS_EXT ) |
614 | { | 617 | { |
diff --git a/libopie2/opienet/ostation.cpp b/libopie2/opienet/ostation.cpp index ce0995b..b5ac325 100644 --- a/libopie2/opienet/ostation.cpp +++ b/libopie2/opienet/ostation.cpp | |||
@@ -62,10 +62,10 @@ OStation::~OStation() | |||
62 | void OStation::dump() | 62 | void OStation::dump() |
63 | { | 63 | { |
64 | odebug << "------- OStation::dump() ------------" << oendl; | 64 | odebug << "------- OStation::dump() ------------" << oendl; |
65 | qDebug( "type: %s", (const char*) type ); | 65 | odebug << "type: " << type << "" << oendl; |
66 | qDebug( "mac: %s", (const char*) macAddress.toString() ); | 66 | odebug << "mac: " << macAddress.toString() << "" << oendl; |
67 | qDebug( "ap: %s", (const char*) apAddress.toString() ); | 67 | odebug << "ap: " << apAddress.toString() << "" << oendl; |
68 | qDebug( "ip: %s", (const char*) ipAddress.toString() ); | 68 | odebug << "ip: " << ipAddress.toString() << "" << oendl; |
69 | } | 69 | } |
70 | 70 | ||
71 | } | 71 | } |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index 14207be..dda23cc 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |||
@@ -32,13 +32,7 @@ | |||
32 | 32 | ||
33 | #include "ocontactaccessbackend_sql.h" | 33 | #include "ocontactaccessbackend_sql.h" |
34 | 34 | ||
35 | #include <qarray.h> | 35 | /* OPIE */ |
36 | #include <qdatetime.h> | ||
37 | #include <qstringlist.h> | ||
38 | |||
39 | #include <qpe/global.h> | ||
40 | #include <qpe/recordfields.h> | ||
41 | |||
42 | #include <opie2/opimcontact.h> | 36 | #include <opie2/opimcontact.h> |
43 | #include <opie2/opimcontactfields.h> | 37 | #include <opie2/opimcontactfields.h> |
44 | #include <opie2/opimdateconversion.h> | 38 | #include <opie2/opimdateconversion.h> |
@@ -46,6 +40,16 @@ | |||
46 | #include <opie2/osqlresult.h> | 40 | #include <opie2/osqlresult.h> |
47 | #include <opie2/osqlmanager.h> | 41 | #include <opie2/osqlmanager.h> |
48 | #include <opie2/osqlquery.h> | 42 | #include <opie2/osqlquery.h> |
43 | #include <opie2/odebug.h> | ||
44 | |||
45 | #include <qpe/global.h> | ||
46 | #include <qpe/recordfields.h> | ||
47 | |||
48 | /* QT */ | ||
49 | #include <qarray.h> | ||
50 | #include <qdatetime.h> | ||
51 | #include <qstringlist.h> | ||
52 | |||
49 | 53 | ||
50 | using namespace Opie; | 54 | using namespace Opie; |
51 | using namespace Opie::DB; | 55 | using namespace Opie::DB; |
@@ -268,7 +272,7 @@ namespace { | |||
268 | + "');"; | 272 | + "');"; |
269 | } | 273 | } |
270 | // qu += "commit;"; | 274 | // qu += "commit;"; |
271 | qDebug("add %s", qu.latin1() ); | 275 | odebug << "add " << qu << "" << oendl; |
272 | return qu; | 276 | return qu; |
273 | } | 277 | } |
274 | 278 | ||
@@ -316,7 +320,7 @@ namespace { | |||
316 | QString qu = "select *"; | 320 | QString qu = "select *"; |
317 | qu += " from addressbook where uid = " + QString::number(m_uid); | 321 | qu += " from addressbook where uid = " + QString::number(m_uid); |
318 | 322 | ||
319 | // qWarning("find query: %s", qu.latin1() ); | 323 | // owarn << "find query: " << qu << "" << oendl; |
320 | return qu; | 324 | return qu; |
321 | } | 325 | } |
322 | 326 | ||
@@ -350,7 +354,7 @@ OPimContactAccessBackend_SQL::OPimContactAccessBackend_SQL ( const QString& /* a | |||
350 | const QString& filename ): | 354 | const QString& filename ): |
351 | OPimContactAccessBackend(), m_changed(false), m_driver( NULL ) | 355 | OPimContactAccessBackend(), m_changed(false), m_driver( NULL ) |
352 | { | 356 | { |
353 | qDebug("C'tor OPimContactAccessBackend_SQL starts"); | 357 | odebug << "C'tor OPimContactAccessBackend_SQL starts" << oendl; |
354 | QTime t; | 358 | QTime t; |
355 | t.start(); | 359 | t.start(); |
356 | 360 | ||
@@ -367,7 +371,7 @@ OPimContactAccessBackend_SQL::OPimContactAccessBackend_SQL ( const QString& /* a | |||
367 | 371 | ||
368 | load(); | 372 | load(); |
369 | 373 | ||
370 | qDebug("C'tor OPimContactAccessBackend_SQL ends: %d ms", t.elapsed() ); | 374 | odebug << "C'tor OPimContactAccessBackend_SQL ends: " << t.elapsed() << " ms" << oendl; |
371 | } | 375 | } |
372 | 376 | ||
373 | OPimContactAccessBackend_SQL::~OPimContactAccessBackend_SQL () | 377 | OPimContactAccessBackend_SQL::~OPimContactAccessBackend_SQL () |
@@ -430,7 +434,7 @@ QArray<int> OPimContactAccessBackend_SQL::allRecords() const | |||
430 | 434 | ||
431 | bool OPimContactAccessBackend_SQL::add ( const OPimContact &newcontact ) | 435 | bool OPimContactAccessBackend_SQL::add ( const OPimContact &newcontact ) |
432 | { | 436 | { |
433 | qDebug("add in contact SQL-Backend"); | 437 | odebug << "add in contact SQL-Backend" << oendl; |
434 | InsertQuery ins( newcontact ); | 438 | InsertQuery ins( newcontact ); |
435 | OSQLResult res = m_driver->query( &ins ); | 439 | OSQLResult res = m_driver->query( &ins ); |
436 | 440 | ||
@@ -469,14 +473,14 @@ bool OPimContactAccessBackend_SQL::replace ( const OPimContact &contact ) | |||
469 | 473 | ||
470 | OPimContact OPimContactAccessBackend_SQL::find ( int uid ) const | 474 | OPimContact OPimContactAccessBackend_SQL::find ( int uid ) const |
471 | { | 475 | { |
472 | qDebug("OPimContactAccessBackend_SQL::find()"); | 476 | odebug << "OPimContactAccessBackend_SQL::find()" << oendl; |
473 | QTime t; | 477 | QTime t; |
474 | t.start(); | 478 | t.start(); |
475 | 479 | ||
476 | OPimContact retContact( requestNonCustom( uid ) ); | 480 | OPimContact retContact( requestNonCustom( uid ) ); |
477 | retContact.setExtraMap( requestCustom( uid ) ); | 481 | retContact.setExtraMap( requestCustom( uid ) ); |
478 | 482 | ||
479 | qDebug("OPimContactAccessBackend_SQL::find() needed: %d ms", t.elapsed() ); | 483 | odebug << "OPimContactAccessBackend_SQL::find() needed: " << t.elapsed() << " ms" << oendl; |
480 | return retContact; | 484 | return retContact; |
481 | } | 485 | } |
482 | 486 | ||
@@ -585,7 +589,7 @@ QArray<int> OPimContactAccessBackend_SQL::queryByExample ( const OPimContact &qu | |||
585 | 589 | ||
586 | qu += searchQuery; | 590 | qu += searchQuery; |
587 | 591 | ||
588 | qDebug( "queryByExample query: %s", qu.latin1() ); | 592 | odebug << "queryByExample query: " << qu << "" << oendl; |
589 | 593 | ||
590 | // Execute query and return the received uid's | 594 | // Execute query and return the received uid's |
591 | OSQLRawQuery raw( qu ); | 595 | OSQLRawQuery raw( qu ); |
@@ -620,7 +624,7 @@ QArray<int> OPimContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const | |||
620 | 624 | ||
621 | qu = qu + searchlist + ")"; | 625 | qu = qu + searchlist + ")"; |
622 | 626 | ||
623 | qDebug( "query: %s", qu.latin1() ); | 627 | odebug << "query: " << qu << "" << oendl; |
624 | 628 | ||
625 | OSQLRawQuery raw( qu ); | 629 | OSQLRawQuery raw( qu ); |
626 | OSQLResult res = m_driver->query( &raw ); | 630 | OSQLResult res = m_driver->query( &raw ); |
@@ -701,7 +705,7 @@ QArray<int> OPimContactAccessBackend_SQL::sorted( bool asc, int , int , int ) | |||
701 | if ( !asc ) | 705 | if ( !asc ) |
702 | query += "DESC"; | 706 | query += "DESC"; |
703 | 707 | ||
704 | // qDebug("sorted query is: %s", query.latin1() ); | 708 | // odebug << "sorted query is: " << query << "" << oendl; |
705 | 709 | ||
706 | OSQLRawQuery raw( query ); | 710 | OSQLRawQuery raw( query ); |
707 | OSQLResult res = m_driver->query( &raw ); | 711 | OSQLResult res = m_driver->query( &raw ); |
@@ -712,14 +716,14 @@ QArray<int> OPimContactAccessBackend_SQL::sorted( bool asc, int , int , int ) | |||
712 | 716 | ||
713 | QArray<int> list = extractUids( res ); | 717 | QArray<int> list = extractUids( res ); |
714 | 718 | ||
715 | qDebug("sorted needed %d ms!", t.elapsed() ); | 719 | odebug << "sorted needed " << t.elapsed() << " ms!" << oendl; |
716 | return list; | 720 | return list; |
717 | } | 721 | } |
718 | 722 | ||
719 | 723 | ||
720 | void OPimContactAccessBackend_SQL::update() | 724 | void OPimContactAccessBackend_SQL::update() |
721 | { | 725 | { |
722 | qDebug("Update starts"); | 726 | odebug << "Update starts" << oendl; |
723 | QTime t; | 727 | QTime t; |
724 | t.start(); | 728 | t.start(); |
725 | 729 | ||
@@ -735,25 +739,25 @@ void OPimContactAccessBackend_SQL::update() | |||
735 | 739 | ||
736 | m_changed = false; | 740 | m_changed = false; |
737 | 741 | ||
738 | qDebug("Update ends %d ms", t.elapsed() ); | 742 | odebug << "Update ends " << t.elapsed() << " ms" << oendl; |
739 | } | 743 | } |
740 | 744 | ||
741 | QArray<int> OPimContactAccessBackend_SQL::extractUids( OSQLResult& res ) const | 745 | QArray<int> OPimContactAccessBackend_SQL::extractUids( OSQLResult& res ) const |
742 | { | 746 | { |
743 | qDebug("extractUids"); | 747 | odebug << "extractUids" << oendl; |
744 | QTime t; | 748 | QTime t; |
745 | t.start(); | 749 | t.start(); |
746 | OSQLResultItem::ValueList list = res.results(); | 750 | OSQLResultItem::ValueList list = res.results(); |
747 | OSQLResultItem::ValueList::Iterator it; | 751 | OSQLResultItem::ValueList::Iterator it; |
748 | QArray<int> ints(list.count() ); | 752 | QArray<int> ints(list.count() ); |
749 | qDebug(" count = %d", list.count() ); | 753 | odebug << " count = " << list.count() << "" << oendl; |
750 | 754 | ||
751 | int i = 0; | 755 | int i = 0; |
752 | for (it = list.begin(); it != list.end(); ++it ) { | 756 | for (it = list.begin(); it != list.end(); ++it ) { |
753 | ints[i] = (*it).data("uid").toInt(); | 757 | ints[i] = (*it).data("uid").toInt(); |
754 | i++; | 758 | i++; |
755 | } | 759 | } |
756 | qDebug("extractUids ready: count2 = %d needs %d ms", i, t.elapsed() ); | 760 | odebug << "extractUids ready: count2 = " << i << " needs " << t.elapsed() << " ms" << oendl; |
757 | 761 | ||
758 | return ints; | 762 | return ints; |
759 | 763 | ||
@@ -788,7 +792,7 @@ QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) co | |||
788 | int id = translate[*it]; | 792 | int id = translate[*it]; |
789 | QString value = resItem.data( (*it) ); | 793 | QString value = resItem.data( (*it) ); |
790 | 794 | ||
791 | // qDebug("Reading %s... found: %s", (*it).latin1(), value.latin1() ); | 795 | // odebug << "Reading " << (*it) << "... found: " << value << "" << oendl; |
792 | 796 | ||
793 | switch( id ){ | 797 | switch( id ){ |
794 | case Qtopia::Birthday: | 798 | case Qtopia::Birthday: |
@@ -806,7 +810,7 @@ QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) co | |||
806 | } | 810 | } |
807 | break; | 811 | break; |
808 | case Qtopia::AddressCategory: | 812 | case Qtopia::AddressCategory: |
809 | qDebug("Category is: %s", value.latin1() ); | 813 | odebug << "Category is: " << value << "" << oendl; |
810 | default: | 814 | default: |
811 | nonCustomMap.insert( id, value ); | 815 | nonCustomMap.insert( id, value ); |
812 | } | 816 | } |
@@ -816,9 +820,9 @@ QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) co | |||
816 | nonCustomMap.insert( Qtopia::AddressUid, resItem.data( "uid" ) ); | 820 | nonCustomMap.insert( Qtopia::AddressUid, resItem.data( "uid" ) ); |
817 | t3needed = t3.elapsed(); | 821 | t3needed = t3.elapsed(); |
818 | 822 | ||
819 | // qDebug("Adding UID: %s", resItem.data( "uid" ).latin1() ); | 823 | // odebug << "Adding UID: " << resItem.data( "uid" ) << "" << oendl; |
820 | qDebug("RequestNonCustom needed: insg.:%d ms, query: %d ms, mapping: %d ms", | 824 | odebug << "RequestNonCustom needed: insg.:" << t.elapsed() << " ms, query: " << t2needed |
821 | t.elapsed(), t2needed, t3needed ); | 825 | << " ms, mapping: " << t3needed << " ms" << oendl; |
822 | 826 | ||
823 | return nonCustomMap; | 827 | return nonCustomMap; |
824 | } | 828 | } |
@@ -834,7 +838,7 @@ QMap<QString, QString> OPimContactAccessBackend_SQL::requestCustom( int uid ) c | |||
834 | OSQLResult res_custom = m_driver->query( &query ); | 838 | OSQLResult res_custom = m_driver->query( &query ); |
835 | 839 | ||
836 | if ( res_custom.state() == OSQLResult::Failure ) { | 840 | if ( res_custom.state() == OSQLResult::Failure ) { |
837 | qWarning("OSQLResult::Failure in find query !!"); | 841 | owarn << "OSQLResult::Failure in find query !!" << oendl; |
838 | QMap<QString, QString> empty; | 842 | QMap<QString, QString> empty; |
839 | return empty; | 843 | return empty; |
840 | } | 844 | } |
@@ -845,7 +849,7 @@ QMap<QString, QString> OPimContactAccessBackend_SQL::requestCustom( int uid ) c | |||
845 | customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); | 849 | customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); |
846 | } | 850 | } |
847 | 851 | ||
848 | qDebug("RequestCustom needed: %d ms", t.elapsed() ); | 852 | odebug << "RequestCustom needed: " << t.elapsed() << " ms" << oendl; |
849 | return customMap; | 853 | return customMap; |
850 | } | 854 | } |
851 | 855 | ||
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp index ffa6a7d..b6ea461 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | |||
@@ -35,6 +35,8 @@ | |||
35 | 35 | ||
36 | /* OPIE */ | 36 | /* OPIE */ |
37 | #include <opie2/ocontactaccessbackend_vcard.h> | 37 | #include <opie2/ocontactaccessbackend_vcard.h> |
38 | #include <opie2/odebug.h> | ||
39 | |||
38 | #include <qpe/timeconversion.h> | 40 | #include <qpe/timeconversion.h> |
39 | 41 | ||
40 | //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! | 42 | //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! |
@@ -64,7 +66,7 @@ bool OPimContactAccessBackend_VCard::load () | |||
64 | if ( !obj ) | 66 | if ( !obj ) |
65 | return false; | 67 | return false; |
66 | }else{ | 68 | }else{ |
67 | qWarning("File \"%s\" not found !", m_file.latin1() ); | 69 | owarn << "File \"" << m_file << "\" not found !" << oendl; |
68 | return false; | 70 | return false; |
69 | } | 71 | } |
70 | 72 | ||
@@ -77,7 +79,7 @@ bool OPimContactAccessBackend_VCard::load () | |||
77 | */ | 79 | */ |
78 | if ( con.uid() == 0 ){ | 80 | if ( con.uid() == 0 ){ |
79 | con.setUid( 1 ); | 81 | con.setUid( 1 ); |
80 | qWarning("assigned new uid %d",con.uid() ); | 82 | owarn << "assigned new uid " << con.uid() << "" << oendl; |
81 | } | 83 | } |
82 | 84 | ||
83 | m_map.insert( con.uid(), con ); | 85 | m_map.insert( con.uid(), con ); |
@@ -316,7 +318,7 @@ OPimContact OPimContactAccessBackend_VCard::parseVObject( VObject *obj ) | |||
316 | if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default | 318 | if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default |
317 | type |= VOICE; | 319 | type |= VOICE; |
318 | 320 | ||
319 | qWarning("value %s %d", value.data(), type ); | 321 | owarn << "value " << value.data() << " " << type << "" << oendl; |
320 | if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) ) | 322 | if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) ) |
321 | c.setHomePhone( value ); | 323 | c.setHomePhone( value ); |
322 | if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) | 324 | if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) |
@@ -510,7 +512,7 @@ VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c ) | |||
510 | 512 | ||
511 | // Exporting Birthday regarding RFC 2425 (5.8.4) | 513 | // Exporting Birthday regarding RFC 2425 (5.8.4) |
512 | if ( c.birthday().isValid() ){ | 514 | if ( c.birthday().isValid() ){ |
513 | qWarning("Exporting birthday as: %s", convDateToVCardDate( c.birthday() ).latin1() ); | 515 | owarn << "Exporting birthday as: " << convDateToVCardDate( c.birthday() ) << "" << oendl; |
514 | safeAddPropValue( vcard, VCBirthDateProp, convDateToVCardDate( c.birthday() ) ); | 516 | safeAddPropValue( vcard, VCBirthDateProp, convDateToVCardDate( c.birthday() ) ); |
515 | } | 517 | } |
516 | 518 | ||
@@ -529,7 +531,7 @@ VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c ) | |||
529 | safeAddPropValue( vcard, "X-Qtopia-Spouse", c.spouse() ); | 531 | safeAddPropValue( vcard, "X-Qtopia-Spouse", c.spouse() ); |
530 | safeAddPropValue( vcard, "X-Qtopia-Gender", c.gender() ); | 532 | safeAddPropValue( vcard, "X-Qtopia-Gender", c.gender() ); |
531 | if ( c.anniversary().isValid() ){ | 533 | if ( c.anniversary().isValid() ){ |
532 | qWarning("Exporting anniversary as: %s", convDateToVCardDate( c.anniversary() ).latin1() ); | 534 | owarn << "Exporting anniversary as: " << convDateToVCardDate( c.anniversary() ) << "" << oendl; |
533 | safeAddPropValue( vcard, "X-Qtopia-Anniversary", convDateToVCardDate( c.anniversary() ) ); | 535 | safeAddPropValue( vcard, "X-Qtopia-Anniversary", convDateToVCardDate( c.anniversary() ) ); |
534 | } | 536 | } |
535 | safeAddPropValue( vcard, "X-Qtopia-Nickname", c.nickname() ); | 537 | safeAddPropValue( vcard, "X-Qtopia-Nickname", c.nickname() ); |
@@ -558,13 +560,13 @@ QDate OPimContactAccessBackend_VCard::convVCardDateToDate( const QString& datest | |||
558 | int dayPos = datestr.find('-', monthPos+1 ); | 560 | int dayPos = datestr.find('-', monthPos+1 ); |
559 | int sep_ignore = 1; | 561 | int sep_ignore = 1; |
560 | if ( monthPos == -1 || dayPos == -1 ) { | 562 | if ( monthPos == -1 || dayPos == -1 ) { |
561 | qDebug("fromString didn't find - in str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, dayPos ); | 563 | odebug << "fromString didn't find - in str = " << datestr << "; mpos = " << monthPos << " ypos = " << dayPos << "" << oendl; |
562 | // Ok.. No "-" found, therefore we will try to read other format ( YYYYMMDD ) | 564 | // Ok.. No "-" found, therefore we will try to read other format ( YYYYMMDD ) |
563 | if ( datestr.length() == 8 ){ | 565 | if ( datestr.length() == 8 ){ |
564 | monthPos = 4; | 566 | monthPos = 4; |
565 | dayPos = 6; | 567 | dayPos = 6; |
566 | sep_ignore = 0; | 568 | sep_ignore = 0; |
567 | qDebug("Try with follwing positions str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, dayPos ); | 569 | odebug << "Try with follwing positions str = " << datestr << "; mpos = " << monthPos << " ypos = " << dayPos << "" << oendl; |
568 | } else { | 570 | } else { |
569 | return QDate(); | 571 | return QDate(); |
570 | } | 572 | } |
@@ -572,7 +574,7 @@ QDate OPimContactAccessBackend_VCard::convVCardDateToDate( const QString& datest | |||
572 | int y = datestr.left( monthPos ).toInt(); | 574 | int y = datestr.left( monthPos ).toInt(); |
573 | int m = datestr.mid( monthPos + sep_ignore, dayPos - monthPos - sep_ignore ).toInt(); | 575 | int m = datestr.mid( monthPos + sep_ignore, dayPos - monthPos - sep_ignore ).toInt(); |
574 | int d = datestr.mid( dayPos + sep_ignore ).toInt(); | 576 | int d = datestr.mid( dayPos + sep_ignore ).toInt(); |
575 | qDebug("TimeConversion::fromString ymd = %s => %d %d %d; mpos = %d ypos = %d", datestr.latin1(), y, m, d, monthPos, dayPos); | 577 | odebug << "TimeConversion::fromString ymd = " << datestr << " => " << y << " " << m << " " << d << "; mpos = " << monthPos << " ypos = " << dayPos << "" << oendl; |
576 | QDate date ( y,m,d ); | 578 | QDate date ( y,m,d ); |
577 | return date; | 579 | return date; |
578 | } | 580 | } |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp index 7b4d81f..5ffcb11 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | |||
@@ -30,8 +30,17 @@ | |||
30 | * XML Backend for the OPIE-Contact Database. | 30 | * XML Backend for the OPIE-Contact Database. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | |||
34 | /* OPIE */ | ||
33 | #include <opie2/ocontactaccessbackend_xml.h> | 35 | #include <opie2/ocontactaccessbackend_xml.h> |
36 | #include <opie2/xmltree.h> | ||
37 | #include <opie2/ocontactaccessbackend.h> | ||
38 | #include <opie2/ocontactaccess.h> | ||
39 | #include <opie2/odebug.h> | ||
40 | |||
41 | #include <qpe/global.h> | ||
34 | 42 | ||
43 | /* QT */ | ||
35 | #include <qasciidict.h> | 44 | #include <qasciidict.h> |
36 | #include <qfile.h> | 45 | #include <qfile.h> |
37 | #include <qfileinfo.h> | 46 | #include <qfileinfo.h> |
@@ -39,12 +48,7 @@ | |||
39 | #include <qarray.h> | 48 | #include <qarray.h> |
40 | #include <qmap.h> | 49 | #include <qmap.h> |
41 | 50 | ||
42 | #include <qpe/global.h> | 51 | /* STD */ |
43 | |||
44 | #include <opie2/xmltree.h> | ||
45 | #include <opie2/ocontactaccessbackend.h> | ||
46 | #include <opie2/ocontactaccess.h> | ||
47 | |||
48 | #include <stdlib.h> | 52 | #include <stdlib.h> |
49 | #include <errno.h> | 53 | #include <errno.h> |
50 | 54 | ||
@@ -104,7 +108,7 @@ bool OPimContactAccessBackend_XML::save() | |||
104 | // Write all contacts | 108 | // Write all contacts |
105 | QListIterator<OPimContact> it( m_contactList ); | 109 | QListIterator<OPimContact> it( m_contactList ); |
106 | for ( ; it.current(); ++it ) { | 110 | for ( ; it.current(); ++it ) { |
107 | // qWarning(" Uid %d at Offset: %x", (*it)->uid(), idx_offset ); | 111 | // owarn << " Uid " << (*it)->uid() << " at Offset: " << idx_offset << "" << oendl; |
108 | out += "<Contact "; | 112 | out += "<Contact "; |
109 | (*it)->save( out ); | 113 | (*it)->save( out ); |
110 | out += "/>\n"; | 114 | out += "/>\n"; |
@@ -459,7 +463,7 @@ QArray<int> OPimContactAccessBackend_XML::sorted( bool asc, int , int , int ) | |||
459 | 463 | ||
460 | bool OPimContactAccessBackend_XML::add ( const OPimContact &newcontact ) | 464 | bool OPimContactAccessBackend_XML::add ( const OPimContact &newcontact ) |
461 | { | 465 | { |
462 | //qWarning("odefaultbackend: ACTION::ADD"); | 466 | //owarn << "odefaultbackend: ACTION::ADD" << oendl; |
463 | updateJournal (newcontact, ACTION_ADD); | 467 | updateJournal (newcontact, ACTION_ADD); |
464 | addContact_p( newcontact ); | 468 | addContact_p( newcontact ); |
465 | 469 | ||
@@ -483,7 +487,7 @@ bool OPimContactAccessBackend_XML::replace ( const OPimContact &contact ) | |||
483 | m_uidToContact.remove( QString().setNum( contact.uid() ) ); | 487 | m_uidToContact.remove( QString().setNum( contact.uid() ) ); |
484 | m_uidToContact.insert( QString().setNum( newCont->uid() ), newCont ); | 488 | m_uidToContact.insert( QString().setNum( newCont->uid() ), newCont ); |
485 | 489 | ||
486 | qWarning("Nur zur Sicherheit: %d == %d ?",contact.uid(), newCont->uid()); | 490 | owarn << "Nur zur Sicherheit: " << contact.uid() << " == " << newCont->uid() << " ?" << oendl; |
487 | 491 | ||
488 | return true; | 492 | return true; |
489 | } else | 493 | } else |
@@ -589,7 +593,7 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal | |||
589 | dict.insert( "action", new int(JOURNALACTION) ); | 593 | dict.insert( "action", new int(JOURNALACTION) ); |
590 | dict.insert( "actionrow", new int(JOURNALROW) ); | 594 | dict.insert( "actionrow", new int(JOURNALROW) ); |
591 | 595 | ||
592 | //qWarning( "OPimContactDefaultBackEnd::loading %s", filename.latin1() ); | 596 | //owarn << "OPimContactDefaultBackEnd::loading " << filename << "" << oendl; |
593 | 597 | ||
594 | XMLElement *root = XMLElement::load( filename ); | 598 | XMLElement *root = XMLElement::load( filename ); |
595 | if(root != 0l ){ // start parsing | 599 | if(root != 0l ){ // start parsing |
@@ -597,7 +601,7 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal | |||
597 | * Contact-Class | 601 | * Contact-Class |
598 | */ | 602 | */ |
599 | XMLElement *element = root->firstChild(); | 603 | XMLElement *element = root->firstChild(); |
600 | //qWarning("OPimContactAccess::load tagName(): %s", root->tagName().latin1() ); | 604 | //owarn << "OPimContactAccess::load tagName(): " << root->tagName() << "" << oendl; |
601 | element = element->firstChild(); | 605 | element = element->firstChild(); |
602 | 606 | ||
603 | /* Search Tag "Contacts" which is the parent of all Contacts */ | 607 | /* Search Tag "Contacts" which is the parent of all Contacts */ |
@@ -637,7 +641,7 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal | |||
637 | int *find = dict[ it.key() ]; | 641 | int *find = dict[ it.key() ]; |
638 | /* Unknown attributes will be stored as "Custom" elements */ | 642 | /* Unknown attributes will be stored as "Custom" elements */ |
639 | if ( !find ) { | 643 | if ( !find ) { |
640 | // qWarning("Attribute %s not known.", it.key().latin1()); | 644 | // owarn << "Attribute " << it.key() << " not known." << oendl; |
641 | //contact.setCustomField(it.key(), it.data()); | 645 | //contact.setCustomField(it.key(), it.data()); |
642 | customMap.insert( it.key(), it.data() ); | 646 | customMap.insert( it.key(), it.data() ); |
643 | continue; | 647 | continue; |
@@ -704,10 +708,10 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal | |||
704 | element = element->nextChild(); | 708 | element = element->nextChild(); |
705 | } | 709 | } |
706 | }else { | 710 | }else { |
707 | qWarning("ODefBack::could not load"); | 711 | owarn << "ODefBack::could not load" << oendl; |
708 | } | 712 | } |
709 | delete root; | 713 | delete root; |
710 | qWarning("returning from loading" ); | 714 | owarn << "returning from loading" << oendl; |
711 | return true; | 715 | return true; |
712 | } | 716 | } |
713 | 717 | ||
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index f4f3c94..105c106 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp | |||
@@ -31,20 +31,25 @@ | |||
31 | * | 31 | * |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <stdio.h> | 34 | /* OPIE */ |
35 | #include <stdlib.h> | ||
36 | |||
37 | #include <qarray.h> | ||
38 | #include <qstringlist.h> | ||
39 | |||
40 | #include <qpe/global.h> | ||
41 | |||
42 | #include <opie2/osqldriver.h> | 35 | #include <opie2/osqldriver.h> |
43 | #include <opie2/osqlmanager.h> | 36 | #include <opie2/osqlmanager.h> |
44 | #include <opie2/osqlquery.h> | 37 | #include <opie2/osqlquery.h> |
45 | 38 | ||
46 | #include <opie2/opimrecurrence.h> | 39 | #include <opie2/opimrecurrence.h> |
47 | #include <opie2/odatebookaccessbackend_sql.h> | 40 | #include <opie2/odatebookaccessbackend_sql.h> |
41 | #include <opie2/odebug.h> | ||
42 | |||
43 | #include <qpe/global.h> | ||
44 | |||
45 | /* QT */ | ||
46 | #include <qarray.h> | ||
47 | #include <qstringlist.h> | ||
48 | |||
49 | /* STD */ | ||
50 | #include <stdio.h> | ||
51 | #include <stdlib.h> | ||
52 | |||
48 | 53 | ||
49 | using namespace Opie::DB; | 54 | using namespace Opie::DB; |
50 | 55 | ||
@@ -162,7 +167,7 @@ bool ODateBookAccessBackend_SQL::load() | |||
162 | 167 | ||
163 | qu += "create table custom_data( uid INTEGER, id INTEGER, type VARCHAR(10), priority INTEGER, value VARCHAR(10), PRIMARY KEY /* identifier */ (uid, id) );"; | 168 | qu += "create table custom_data( uid INTEGER, id INTEGER, type VARCHAR(10), priority INTEGER, value VARCHAR(10), PRIMARY KEY /* identifier */ (uid, id) );"; |
164 | 169 | ||
165 | qWarning( "command: %s", qu.latin1() ); | 170 | owarn << "command: " << qu << "" << oendl; |
166 | 171 | ||
167 | OSQLRawQuery raw( qu ); | 172 | OSQLRawQuery raw( qu ); |
168 | OSQLResult res = m_driver->query( &raw ); | 173 | OSQLResult res = m_driver->query( &raw ); |
@@ -221,12 +226,12 @@ void ODateBookAccessBackend_SQL::clear() | |||
221 | 226 | ||
222 | 227 | ||
223 | OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{ | 228 | OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{ |
224 | qDebug( "ODateBookAccessBackend_SQL::find( %d )", uid ); | 229 | odebug << "ODateBookAccessBackend_SQL::find( " << uid << " )" << oendl; |
225 | 230 | ||
226 | QString qu = "select *"; | 231 | QString qu = "select *"; |
227 | qu += "from datebook where uid = " + QString::number(uid); | 232 | qu += "from datebook where uid = " + QString::number(uid); |
228 | 233 | ||
229 | qDebug( "Query: %s", qu.latin1() ); | 234 | odebug << "Query: " << qu << "" << oendl; |
230 | 235 | ||
231 | OSQLRawQuery raw( qu ); | 236 | OSQLRawQuery raw( qu ); |
232 | OSQLResult res = m_driver->query( &raw ); | 237 | OSQLResult res = m_driver->query( &raw ); |
@@ -247,7 +252,7 @@ OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{ | |||
247 | OPimEvent retDate( dateEventMap ); | 252 | OPimEvent retDate( dateEventMap ); |
248 | retDate.setExtraMap( requestCustom( uid ) ); | 253 | retDate.setExtraMap( requestCustom( uid ) ); |
249 | 254 | ||
250 | qDebug( "ODateBookAccessBackend_SQL::find( %d ) end", uid ); | 255 | odebug << "ODateBookAccessBackend_SQL::find( " << uid << " ) end" << oendl; |
251 | return retDate; | 256 | return retDate; |
252 | } | 257 | } |
253 | 258 | ||
@@ -283,7 +288,7 @@ bool ODateBookAccessBackend_SQL::add( const OPimEvent& ev ) | |||
283 | + it.data() //.latin1() | 288 | + it.data() //.latin1() |
284 | + "');"; | 289 | + "');"; |
285 | } | 290 | } |
286 | qWarning("add %s", qu.latin1() ); | 291 | owarn << "add " << qu << "" << oendl; |
287 | 292 | ||
288 | OSQLRawQuery raw( qu ); | 293 | OSQLRawQuery raw( qu ); |
289 | OSQLResult res = m_driver->query( &raw ); | 294 | OSQLResult res = m_driver->query( &raw ); |
@@ -390,7 +395,7 @@ QArray<int> ODateBookAccessBackend_SQL::matchRegexp( const QRegExp &r ) const | |||
390 | 395 | ||
391 | qu += " )"; | 396 | qu += " )"; |
392 | 397 | ||
393 | qDebug( "query: %s", qu.latin1() ); | 398 | odebug << "query: " << qu << "" << oendl; |
394 | 399 | ||
395 | OSQLRawQuery raw( qu ); | 400 | OSQLRawQuery raw( qu ); |
396 | OSQLResult res = m_driver->query( &raw ); | 401 | OSQLResult res = m_driver->query( &raw ); |
@@ -405,20 +410,20 @@ QArray<int> ODateBookAccessBackend_SQL::matchRegexp( const QRegExp &r ) const | |||
405 | 410 | ||
406 | QArray<int> ODateBookAccessBackend_SQL::extractUids( OSQLResult& res ) const | 411 | QArray<int> ODateBookAccessBackend_SQL::extractUids( OSQLResult& res ) const |
407 | { | 412 | { |
408 | qWarning("extractUids"); | 413 | owarn << "extractUids" << oendl; |
409 | QTime t; | 414 | QTime t; |
410 | t.start(); | 415 | t.start(); |
411 | OSQLResultItem::ValueList list = res.results(); | 416 | OSQLResultItem::ValueList list = res.results(); |
412 | OSQLResultItem::ValueList::Iterator it; | 417 | OSQLResultItem::ValueList::Iterator it; |
413 | QArray<int> ints(list.count() ); | 418 | QArray<int> ints(list.count() ); |
414 | qWarning(" count = %d", list.count() ); | 419 | owarn << " count = " << list.count() << "" << oendl; |
415 | 420 | ||
416 | int i = 0; | 421 | int i = 0; |
417 | for (it = list.begin(); it != list.end(); ++it ) { | 422 | for (it = list.begin(); it != list.end(); ++it ) { |
418 | ints[i] = (*it).data("uid").toInt(); | 423 | ints[i] = (*it).data("uid").toInt(); |
419 | i++; | 424 | i++; |
420 | } | 425 | } |
421 | qWarning("extractUids ready: count2 = %d needs %d ms", i, t.elapsed() ); | 426 | owarn << "extractUids ready: count2 = " << i << " needs " << t.elapsed() << " ms" << oendl; |
422 | 427 | ||
423 | return ints; | 428 | return ints; |
424 | 429 | ||
@@ -435,7 +440,7 @@ QMap<QString, QString> ODateBookAccessBackend_SQL::requestCustom( int uid ) cons | |||
435 | OSQLResult res_custom = m_driver->query( &query ); | 440 | OSQLResult res_custom = m_driver->query( &query ); |
436 | 441 | ||
437 | if ( res_custom.state() == OSQLResult::Failure ) { | 442 | if ( res_custom.state() == OSQLResult::Failure ) { |
438 | qWarning("OSQLResult::Failure in find query !!"); | 443 | owarn << "OSQLResult::Failure in find query !!" << oendl; |
439 | QMap<QString, QString> empty; | 444 | QMap<QString, QString> empty; |
440 | return empty; | 445 | return empty; |
441 | } | 446 | } |
@@ -446,7 +451,7 @@ QMap<QString, QString> ODateBookAccessBackend_SQL::requestCustom( int uid ) cons | |||
446 | customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); | 451 | customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); |
447 | } | 452 | } |
448 | 453 | ||
449 | qDebug("RequestCustom needed: %d ms", t.elapsed() ); | 454 | odebug << "RequestCustom needed: " << t.elapsed() << " ms" << oendl; |
450 | return customMap; | 455 | return customMap; |
451 | } | 456 | } |
452 | 457 | ||
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp index 77c0253..2ff36e3 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp | |||
@@ -26,6 +26,23 @@ | |||
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 | |||
30 | /* OPIE */ | ||
31 | #include <opie2/opimnotifymanager.h> | ||
32 | #include <opie2/opimrecurrence.h> | ||
33 | #include <opie2/opimtimezone.h> | ||
34 | #include <opie2/odatebookaccessbackend_xml.h> | ||
35 | #include <opie2/odebug.h> | ||
36 | |||
37 | #include <qtopia/global.h> | ||
38 | #include <qtopia/stringutil.h> | ||
39 | #include <qtopia/timeconversion.h> | ||
40 | |||
41 | /* QT */ | ||
42 | #include <qasciidict.h> | ||
43 | #include <qfile.h> | ||
44 | |||
45 | /* STD */ | ||
29 | #include <errno.h> | 46 | #include <errno.h> |
30 | #include <fcntl.h> | 47 | #include <fcntl.h> |
31 | 48 | ||
@@ -38,17 +55,6 @@ | |||
38 | 55 | ||
39 | #include <unistd.h> | 56 | #include <unistd.h> |
40 | 57 | ||
41 | #include <qasciidict.h> | ||
42 | #include <qfile.h> | ||
43 | |||
44 | #include <qtopia/global.h> | ||
45 | #include <qtopia/stringutil.h> | ||
46 | #include <qtopia/timeconversion.h> | ||
47 | |||
48 | #include <opie2/opimnotifymanager.h> | ||
49 | #include <opie2/opimrecurrence.h> | ||
50 | #include <opie2/opimtimezone.h> | ||
51 | #include <opie2/odatebookaccessbackend_xml.h> | ||
52 | 58 | ||
53 | using namespace Opie; | 59 | using namespace Opie; |
54 | 60 | ||
@@ -116,7 +122,7 @@ namespace { | |||
116 | 122 | ||
117 | // FIXME: Use OPimEvent::toMap() here !! (eilers) | 123 | // FIXME: Use OPimEvent::toMap() here !! (eilers) |
118 | inline void save( const OPimEvent& ev, QString& buf ) { | 124 | inline void save( const OPimEvent& ev, QString& buf ) { |
119 | qWarning("Saving %d %s", ev.uid(), ev.description().latin1() ); | 125 | owarn << "Saving " << ev.uid() << " " << ev.description() << "" << oendl; |
120 | buf += " description=\"" + Qtopia::escapeString(ev.description() ) + "\""; | 126 | buf += " description=\"" + Qtopia::escapeString(ev.description() ) + "\""; |
121 | if (!ev.location().isEmpty() ) | 127 | if (!ev.location().isEmpty() ) |
122 | buf += " location=\"" + Qtopia::escapeString(ev.location() ) + "\""; | 128 | buf += " location=\"" + Qtopia::escapeString(ev.location() ) + "\""; |
@@ -490,10 +496,10 @@ void ODateBookAccessBackend_XML::finalizeRecord( OPimEvent& ev ) { | |||
490 | ev.setTimeZone( "UTC"); // make sure it is really utc | 496 | ev.setTimeZone( "UTC"); // make sure it is really utc |
491 | }else { | 497 | }else { |
492 | /* to current date time */ | 498 | /* to current date time */ |
493 | // qWarning(" Start is %d", start ); | 499 | // owarn << " Start is " << start << "" << oendl; |
494 | OPimTimeZone zone( ev.timeZone().isEmpty() ? OPimTimeZone::current() : ev.timeZone() ); | 500 | OPimTimeZone zone( ev.timeZone().isEmpty() ? OPimTimeZone::current() : ev.timeZone() ); |
495 | QDateTime date = zone.toDateTime( start ); | 501 | QDateTime date = zone.toDateTime( start ); |
496 | qWarning(" Start is %s", date.toString().latin1() ); | 502 | owarn << " Start is " << date.toString() << "" << oendl; |
497 | ev.setStartDateTime( zone.toDateTime( date, OPimTimeZone::current() ) ); | 503 | ev.setStartDateTime( zone.toDateTime( date, OPimTimeZone::current() ) ); |
498 | 504 | ||
499 | date = zone.toDateTime( end ); | 505 | date = zone.toDateTime( end ); |
@@ -514,10 +520,10 @@ void ODateBookAccessBackend_XML::finalizeRecord( OPimEvent& ev ) { | |||
514 | ev.notifiers().add( al ); | 520 | ev.notifiers().add( al ); |
515 | } | 521 | } |
516 | if ( m_raw.contains( ev.uid() ) || m_rep.contains( ev.uid() ) ) { | 522 | if ( m_raw.contains( ev.uid() ) || m_rep.contains( ev.uid() ) ) { |
517 | qWarning("already contains assign uid"); | 523 | owarn << "already contains assign uid" << oendl; |
518 | ev.setUid( 1 ); | 524 | ev.setUid( 1 ); |
519 | } | 525 | } |
520 | qWarning("addind %d %s", ev.uid(), ev.description().latin1() ); | 526 | owarn << "addind " << ev.uid() << " " << ev.description() << "" << oendl; |
521 | if ( ev.hasRecurrence() ) | 527 | if ( ev.hasRecurrence() ) |
522 | m_rep.insert( ev.uid(), ev ); | 528 | m_rep.insert( ev.uid(), ev ); |
523 | else | 529 | else |
@@ -525,7 +531,7 @@ void ODateBookAccessBackend_XML::finalizeRecord( OPimEvent& ev ) { | |||
525 | 531 | ||
526 | } | 532 | } |
527 | void ODateBookAccessBackend_XML::setField( OPimEvent& e, int id, const QString& value) { | 533 | void ODateBookAccessBackend_XML::setField( OPimEvent& e, int id, const QString& value) { |
528 | // qWarning(" setting %s", value.latin1() ); | 534 | // owarn << " setting " << value << "" << oendl; |
529 | switch( id ) { | 535 | switch( id ) { |
530 | case FDescription: | 536 | case FDescription: |
531 | e.setDescription( value ); | 537 | e.setDescription( value ); |
@@ -610,7 +616,7 @@ void ODateBookAccessBackend_XML::setField( OPimEvent& e, int id, const QString& | |||
610 | QStringList list = QStringList::split(' ', value ); | 616 | QStringList list = QStringList::split(' ', value ); |
611 | for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 617 | for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
612 | QDate date( (*it).left(4).toInt(), (*it).mid(4, 2).toInt(), (*it).right(2).toInt() ); | 618 | QDate date( (*it).left(4).toInt(), (*it).mid(4, 2).toInt(), (*it).right(2).toInt() ); |
613 | qWarning("adding exception %s", date.toString().latin1() ); | 619 | owarn << "adding exception " << date.toString() << "" << oendl; |
614 | recur()->exceptions().append( date ); | 620 | recur()->exceptions().append( date ); |
615 | } | 621 | } |
616 | } | 622 | } |
diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index 132b5a6..6f65c48 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/otodoaccesssql.cpp | |||
@@ -28,12 +28,7 @@ | |||
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qdatetime.h> | 31 | /* OPIE */ |
32 | #include <qmap.h> | ||
33 | #include <qstring.h> | ||
34 | |||
35 | #include <qpe/global.h> | ||
36 | |||
37 | #include <opie2/osqldriver.h> | 32 | #include <opie2/osqldriver.h> |
38 | #include <opie2/osqlresult.h> | 33 | #include <opie2/osqlresult.h> |
39 | #include <opie2/osqlmanager.h> | 34 | #include <opie2/osqlmanager.h> |
@@ -43,6 +38,15 @@ | |||
43 | #include <opie2/opimstate.h> | 38 | #include <opie2/opimstate.h> |
44 | #include <opie2/opimnotifymanager.h> | 39 | #include <opie2/opimnotifymanager.h> |
45 | #include <opie2/opimrecurrence.h> | 40 | #include <opie2/opimrecurrence.h> |
41 | #include <opie2/odebug.h> | ||
42 | |||
43 | #include <qpe/global.h> | ||
44 | |||
45 | /* QT */ | ||
46 | #include <qdatetime.h> | ||
47 | #include <qmap.h> | ||
48 | #include <qstring.h> | ||
49 | |||
46 | 50 | ||
47 | using namespace Opie::DB; | 51 | using namespace Opie::DB; |
48 | 52 | ||
@@ -291,7 +295,7 @@ namespace { | |||
291 | } | 295 | } |
292 | 296 | ||
293 | 297 | ||
294 | qDebug("add %s", qu.latin1() ); | 298 | odebug << "add " << qu << "" << oendl; |
295 | return qu; | 299 | return qu; |
296 | } | 300 | } |
297 | 301 | ||
@@ -456,7 +460,7 @@ OPimTodo OPimTodoAccessBackendSQL::find(int uid ) const{ | |||
456 | OPimTodo OPimTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, | 460 | OPimTodo OPimTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, |
457 | uint cur, Frontend::CacheDirection dir ) const{ | 461 | uint cur, Frontend::CacheDirection dir ) const{ |
458 | uint CACHE = readAhead(); | 462 | uint CACHE = readAhead(); |
459 | qDebug("searching for %d", uid ); | 463 | odebug << "searching for " << uid << "" << oendl; |
460 | QArray<int> search( CACHE ); | 464 | QArray<int> search( CACHE ); |
461 | uint size =0; | 465 | uint size =0; |
462 | OPimTodo to; | 466 | OPimTodo to; |
@@ -466,7 +470,7 @@ OPimTodo OPimTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, | |||
466 | /* forward */ | 470 | /* forward */ |
467 | case 0: // FIXME: Not a good style to use magic numbers here (eilers) | 471 | case 0: // FIXME: Not a good style to use magic numbers here (eilers) |
468 | for (uint i = cur; i < ints.count() && size < CACHE; i++ ) { | 472 | for (uint i = cur; i < ints.count() && size < CACHE; i++ ) { |
469 | qDebug("size %d %d", size, ints[i] ); | 473 | odebug << "size " << size << " " << ints[i] << "" << oendl; |
470 | search[size] = ints[i]; | 474 | search[size] = ints[i]; |
471 | size++; | 475 | size++; |
472 | } | 476 | } |
@@ -541,7 +545,7 @@ QArray<int> OPimTodoAccessBackendSQL::effectiveToDos( const QDate& s, | |||
541 | */ | 545 | */ |
542 | QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder, | 546 | QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder, |
543 | int sortFilter, int cat ) { | 547 | int sortFilter, int cat ) { |
544 | qDebug("sorted %d, %d", asc, sortOrder ); | 548 | odebug << "sorted " << asc << ", " << sortOrder << "" << oendl; |
545 | QString query; | 549 | QString query; |
546 | query = "select uid from todolist WHERE "; | 550 | query = "select uid from todolist WHERE "; |
547 | 551 | ||
@@ -600,11 +604,11 @@ QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder, | |||
600 | } | 604 | } |
601 | 605 | ||
602 | if ( !asc ) { | 606 | if ( !asc ) { |
603 | qDebug("not ascending!"); | 607 | odebug << "not ascending!" << oendl; |
604 | query += " DESC"; | 608 | query += " DESC"; |
605 | } | 609 | } |
606 | 610 | ||
607 | qDebug( query ); | 611 | odebug << query << oendl; |
608 | OSQLRawQuery raw(query ); | 612 | OSQLRawQuery raw(query ); |
609 | return uids( m_driver->query(&raw) ); | 613 | return uids( m_driver->query(&raw) ); |
610 | } | 614 | } |
@@ -629,19 +633,19 @@ OPimTodo OPimTodoAccessBackendSQL::todo( const OSQLResult& res ) const{ | |||
629 | 633 | ||
630 | OSQLResultItem::ValueList list = res.results(); | 634 | OSQLResultItem::ValueList list = res.results(); |
631 | OSQLResultItem::ValueList::Iterator it = list.begin(); | 635 | OSQLResultItem::ValueList::Iterator it = list.begin(); |
632 | qDebug("todo1"); | 636 | odebug << "todo1" << oendl; |
633 | OPimTodo to = todo( (*it) ); | 637 | OPimTodo to = todo( (*it) ); |
634 | cache( to ); | 638 | cache( to ); |
635 | ++it; | 639 | ++it; |
636 | 640 | ||
637 | for ( ; it != list.end(); ++it ) { | 641 | for ( ; it != list.end(); ++it ) { |
638 | qDebug("caching"); | 642 | odebug << "caching" << oendl; |
639 | cache( todo( (*it) ) ); | 643 | cache( todo( (*it) ) ); |
640 | } | 644 | } |
641 | return to; | 645 | return to; |
642 | } | 646 | } |
643 | OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const { | 647 | OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const { |
644 | qDebug("todo(ResultItem)"); | 648 | odebug << "todo(ResultItem)" << oendl; |
645 | 649 | ||
646 | // Request information from addressbook table and create the OPimTodo-object. | 650 | // Request information from addressbook table and create the OPimTodo-object. |
647 | 651 | ||
@@ -649,7 +653,7 @@ OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const { | |||
649 | hasDueDate = date( dueDate, item.data("DueDate") ); | 653 | hasDueDate = date( dueDate, item.data("DueDate") ); |
650 | QStringList cats = QStringList::split(";", item.data("categories") ); | 654 | QStringList cats = QStringList::split(";", item.data("categories") ); |
651 | 655 | ||
652 | qDebug("Item is completed: %d", item.data("completed").toInt() ); | 656 | odebug << "Item is completed: " << item.data("completed").toInt() << "" << oendl; |
653 | 657 | ||
654 | OPimTodo to( (bool)item.data("completed").toInt(), item.data("priority").toInt(), | 658 | OPimTodo to( (bool)item.data("completed").toInt(), item.data("priority").toInt(), |
655 | cats, item.data("summary"), item.data("description"), | 659 | cats, item.data("summary"), item.data("description"), |
@@ -750,7 +754,7 @@ QArray<int> OPimTodoAccessBackendSQL::uids( const OSQLResult& res) const{ | |||
750 | OSQLResultItem::ValueList list = res.results(); | 754 | OSQLResultItem::ValueList list = res.results(); |
751 | OSQLResultItem::ValueList::Iterator it; | 755 | OSQLResultItem::ValueList::Iterator it; |
752 | QArray<int> ints(list.count() ); | 756 | QArray<int> ints(list.count() ); |
753 | qDebug(" count = %d", list.count() ); | 757 | odebug << " count = " << list.count() << "" << oendl; |
754 | 758 | ||
755 | int i = 0; | 759 | int i = 0; |
756 | for (it = list.begin(); it != list.end(); ++it ) { | 760 | for (it = list.begin(); it != list.end(); ++it ) { |
@@ -776,7 +780,7 @@ QArray<int> OPimTodoAccessBackendSQL::matchRegexp( const QRegExp &r ) const | |||
776 | 780 | ||
777 | qu += ")"; | 781 | qu += ")"; |
778 | 782 | ||
779 | qDebug( "query: %s", qu.latin1() ); | 783 | odebug << "query: " << qu << "" << oendl; |
780 | 784 | ||
781 | OSQLRawQuery raw( qu ); | 785 | OSQLRawQuery raw( qu ); |
782 | OSQLResult res = m_driver->query( &raw ); | 786 | OSQLResult res = m_driver->query( &raw ); |
@@ -816,7 +820,7 @@ void OPimTodoAccessBackendSQL::removeAllCompleted(){ | |||
816 | 820 | ||
817 | QArray<int> completed_uids = uids( res ); | 821 | QArray<int> completed_uids = uids( res ); |
818 | 822 | ||
819 | qDebug( "Number of completed: %d", completed_uids.size() ); | 823 | odebug << "Number of completed: " << completed_uids.size() << "" << oendl; |
820 | 824 | ||
821 | if ( completed_uids.size() == 0 ) | 825 | if ( completed_uids.size() == 0 ) |
822 | return; | 826 | return; |
@@ -842,12 +846,12 @@ void OPimTodoAccessBackendSQL::removeAllCompleted(){ | |||
842 | } | 846 | } |
843 | qu += query + " );"; | 847 | qu += query + " );"; |
844 | 848 | ||
845 | qDebug( "query: %s", qu.latin1() ); | 849 | odebug << "query: " << qu << "" << oendl; |
846 | 850 | ||
847 | OSQLRawQuery raw2( qu ); | 851 | OSQLRawQuery raw2( qu ); |
848 | res = m_driver->query( &raw2 ); | 852 | res = m_driver->query( &raw2 ); |
849 | if ( res.state() == OSQLResult::Failure ) { | 853 | if ( res.state() == OSQLResult::Failure ) { |
850 | qWarning("OPimTodoAccessBackendSQL::removeAllCompleted():Failure in query: %s", qu.latin1() ); | 854 | owarn << "OPimTodoAccessBackendSQL::removeAllCompleted():Failure in query: " << qu << "" << oendl; |
851 | } | 855 | } |
852 | } | 856 | } |
853 | 857 | ||
@@ -860,7 +864,7 @@ QMap<QString, QString> OPimTodoAccessBackendSQL::requestCustom( int uid ) const | |||
860 | OSQLResult res_custom = m_driver->query( &query ); | 864 | OSQLResult res_custom = m_driver->query( &query ); |
861 | 865 | ||
862 | if ( res_custom.state() == OSQLResult::Failure ) { | 866 | if ( res_custom.state() == OSQLResult::Failure ) { |
863 | qWarning("OSQLResult::Failure in find query !!"); | 867 | owarn << "OSQLResult::Failure in find query !!" << oendl; |
864 | QMap<QString, QString> empty; | 868 | QMap<QString, QString> empty; |
865 | return empty; | 869 | return empty; |
866 | } | 870 | } |
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp index 03d4479..14a325e 100644 --- a/libopie2/opiepim/backend/otodoaccessvcal.cpp +++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp | |||
@@ -27,11 +27,15 @@ | |||
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | /* OPIE */ | ||
31 | #include "vobject_p.h" | 30 | #include "vobject_p.h" |
32 | #include <qpe/timeconversion.h> | 31 | |
32 | /* OPIE */ | ||
33 | #include <opie2/otodoaccessvcal.h> | 33 | #include <opie2/otodoaccessvcal.h> |
34 | #include <opie2/odebug.h> | ||
35 | |||
36 | #include <qpe/timeconversion.h> | ||
34 | 37 | ||
38 | /* QT */ | ||
35 | //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! | 39 | //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! |
36 | #define protected public | 40 | #define protected public |
37 | #include <qfile.h> | 41 | #include <qfile.h> |
@@ -88,7 +92,7 @@ namespace { | |||
88 | // categories | 92 | // categories |
89 | if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){ | 93 | if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){ |
90 | name = vObjectStringZValue( ob ); | 94 | name = vObjectStringZValue( ob ); |
91 | qWarning("Categories:%s", name.data() ); | 95 | owarn << "Categories:" << name.data() << "" << oendl; |
92 | } | 96 | } |
93 | 97 | ||
94 | event.setUid( 1 ); | 98 | event.setUid( 1 ); |
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp index cce6111..3e06d88 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.cpp +++ b/libopie2/opiepim/backend/otodoaccessxml.cpp | |||
@@ -26,6 +26,25 @@ | |||
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 | |||
30 | /* OPIE */ | ||
31 | #include <opie2/opimdateconversion.h> | ||
32 | #include <opie2/opimstate.h> | ||
33 | #include <opie2/opimtimezone.h> | ||
34 | #include <opie2/opimnotifymanager.h> | ||
35 | #include <opie2/opimrecurrence.h> | ||
36 | #include <opie2/otodoaccessxml.h> | ||
37 | #include <opie2/odebug.h> | ||
38 | |||
39 | #include <qpe/global.h> | ||
40 | #include <qpe/stringutil.h> | ||
41 | #include <qpe/timeconversion.h> | ||
42 | |||
43 | /* QT */ | ||
44 | #include <qfile.h> | ||
45 | #include <qvector.h> | ||
46 | |||
47 | /* STD */ | ||
29 | #include <errno.h> | 48 | #include <errno.h> |
30 | #include <fcntl.h> | 49 | #include <fcntl.h> |
31 | 50 | ||
@@ -36,20 +55,6 @@ | |||
36 | #include <unistd.h> | 55 | #include <unistd.h> |
37 | 56 | ||
38 | 57 | ||
39 | #include <qfile.h> | ||
40 | #include <qvector.h> | ||
41 | |||
42 | #include <qpe/global.h> | ||
43 | #include <qpe/stringutil.h> | ||
44 | #include <qpe/timeconversion.h> | ||
45 | |||
46 | #include <opie2/opimdateconversion.h> | ||
47 | #include <opie2/opimstate.h> | ||
48 | #include <opie2/opimtimezone.h> | ||
49 | #include <opie2/opimnotifymanager.h> | ||
50 | #include <opie2/opimrecurrence.h> | ||
51 | #include <opie2/otodoaccessxml.h> | ||
52 | |||
53 | using namespace Opie; | 58 | using namespace Opie; |
54 | 59 | ||
55 | namespace { | 60 | namespace { |
@@ -177,7 +182,7 @@ bool OPimTodoAccessXML::load() { | |||
177 | while ( ( point = strstrlen( dt+i, len -i, collectionString, strLen ) ) != 0l ) { | 182 | while ( ( point = strstrlen( dt+i, len -i, collectionString, strLen ) ) != 0l ) { |
178 | i = point -dt; | 183 | i = point -dt; |
179 | i+= strLen; | 184 | i+= strLen; |
180 | qWarning("Found a start at %d %d", i, (point-dt) ); | 185 | owarn << "Found a start at " << i << " " << (point-dt) << "" << oendl; |
181 | 186 | ||
182 | OPimTodo ev; | 187 | OPimTodo ev; |
183 | m_year = m_month = m_day = 0; | 188 | m_year = m_month = m_day = 0; |
@@ -233,7 +238,7 @@ bool OPimTodoAccessXML::load() { | |||
233 | /* | 238 | /* |
234 | * now add it | 239 | * now add it |
235 | */ | 240 | */ |
236 | qWarning("End at %d", i ); | 241 | owarn << "End at " << i << "" << oendl; |
237 | if (m_events.contains( ev.uid() ) || ev.uid() == 0) { | 242 | if (m_events.contains( ev.uid() ) || ev.uid() == 0) { |
238 | ev.setUid( 1 ); | 243 | ev.setUid( 1 ); |
239 | m_changed = true; | 244 | m_changed = true; |
@@ -256,7 +261,7 @@ bool OPimTodoAccessXML::load() { | |||
256 | 261 | ||
257 | munmap(map_addr, attribut.st_size ); | 262 | munmap(map_addr, attribut.st_size ); |
258 | 263 | ||
259 | qWarning("counts %d records loaded!", m_events.count() ); | 264 | owarn << "counts " << m_events.count() << " records loaded!" << oendl; |
260 | return true; | 265 | return true; |
261 | } | 266 | } |
262 | bool OPimTodoAccessXML::reload() { | 267 | bool OPimTodoAccessXML::reload() { |
@@ -264,9 +269,9 @@ bool OPimTodoAccessXML::reload() { | |||
264 | return load(); | 269 | return load(); |
265 | } | 270 | } |
266 | bool OPimTodoAccessXML::save() { | 271 | bool OPimTodoAccessXML::save() { |
267 | // qWarning("saving"); | 272 | // owarn << "saving" << oendl; |
268 | if (!m_opened || !m_changed ) { | 273 | if (!m_opened || !m_changed ) { |
269 | // qWarning("not saving"); | 274 | // owarn << "not saving" << oendl; |
270 | return true; | 275 | return true; |
271 | } | 276 | } |
272 | QString strNewFile = m_file + ".new"; | 277 | QString strNewFile = m_file + ".new"; |
@@ -307,7 +312,7 @@ bool OPimTodoAccessXML::save() { | |||
307 | f.close(); | 312 | f.close(); |
308 | 313 | ||
309 | if( ::rename( strNewFile.latin1(), m_file.latin1() ) < 0 ) { | 314 | if( ::rename( strNewFile.latin1(), m_file.latin1() ) < 0 ) { |
310 | // qWarning("error renaming"); | 315 | // owarn << "error renaming" << oendl; |
311 | QFile::remove( strNewFile ); | 316 | QFile::remove( strNewFile ); |
312 | } | 317 | } |
313 | 318 | ||
@@ -345,7 +350,7 @@ void OPimTodoAccessXML::clear() { | |||
345 | m_events.clear(); | 350 | m_events.clear(); |
346 | } | 351 | } |
347 | bool OPimTodoAccessXML::add( const OPimTodo& todo ) { | 352 | bool OPimTodoAccessXML::add( const OPimTodo& todo ) { |
348 | // qWarning("add"); | 353 | // owarn << "add" << oendl; |
349 | m_changed = true; | 354 | m_changed = true; |
350 | m_events.insert( todo.uid(), todo ); | 355 | m_events.insert( todo.uid(), todo ); |
351 | 356 | ||
@@ -404,13 +409,13 @@ QArray<int> OPimTodoAccessXML::overDue() { | |||
404 | /* private */ | 409 | /* private */ |
405 | void OPimTodoAccessXML::todo( QAsciiDict<int>* dict, OPimTodo& ev, | 410 | void OPimTodoAccessXML::todo( QAsciiDict<int>* dict, OPimTodo& ev, |
406 | const QCString& attr, const QString& val) { | 411 | const QCString& attr, const QString& val) { |
407 | // qWarning("parse to do from XMLElement" ); | 412 | // owarn << "parse to do from XMLElement" << oendl; |
408 | 413 | ||
409 | int *find=0; | 414 | int *find=0; |
410 | 415 | ||
411 | find = (*dict)[ attr.data() ]; | 416 | find = (*dict)[ attr.data() ]; |
412 | if (!find ) { | 417 | if (!find ) { |
413 | // qWarning("Unknown option" + it.key() ); | 418 | // owarn << "Unknown option" + it.key() << oendl; |
414 | ev.setCustomField( attr, val ); | 419 | ev.setCustomField( attr, val ); |
415 | return; | 420 | return; |
416 | } | 421 | } |
@@ -463,8 +468,8 @@ void OPimTodoAccessXML::todo( QAsciiDict<int>* dict, OPimTodo& ev, | |||
463 | QStringList als = QStringList::split(";", val ); | 468 | QStringList als = QStringList::split(";", val ); |
464 | for (QStringList::Iterator it = als.begin(); it != als.end(); ++it ) { | 469 | for (QStringList::Iterator it = als.begin(); it != als.end(); ++it ) { |
465 | QStringList alarm = QStringList::split(":", (*it), TRUE ); // allow empty | 470 | QStringList alarm = QStringList::split(":", (*it), TRUE ); // allow empty |
466 | qWarning("alarm: %s", alarm.join("___").latin1() ); | 471 | owarn << "alarm: " << alarm.join("___") << "" << oendl; |
467 | qWarning("alarm[0]: %s %s", alarm[0].latin1(), OPimDateConversion::dateTimeFromString( alarm[0] ).toString().latin1() ); | 472 | owarn << "alarm[0]: " << alarm[0] << " " << OPimDateConversion::dateTimeFromString( alarm[0] ).toString() << "" << oendl; |
468 | OPimAlarm al( alarm[2].toInt(), OPimDateConversion::dateTimeFromString( alarm[0] ), alarm[1].toInt() ); | 473 | OPimAlarm al( alarm[2].toInt(), OPimDateConversion::dateTimeFromString( alarm[0] ), alarm[1].toInt() ); |
469 | manager.add( al ); | 474 | manager.add( al ); |
470 | } | 475 | } |
@@ -537,11 +542,11 @@ void OPimTodoAccessXML::todo( QAsciiDict<int>* dict, OPimTodo& ev, | |||
537 | namespace { | 542 | namespace { |
538 | QString customToXml(const QMap<QString, QString>& customMap ) | 543 | QString customToXml(const QMap<QString, QString>& customMap ) |
539 | { | 544 | { |
540 | //qWarning(QString("writing custom %1").arg(customMap.count())); | 545 | //owarn << QString("writing custom %1").arg(customMap.count()) << oendl; |
541 | QString buf(" "); | 546 | QString buf(" "); |
542 | for ( QMap<QString, QString>::ConstIterator cit = customMap.begin(); | 547 | for ( QMap<QString, QString>::ConstIterator cit = customMap.begin(); |
543 | cit != customMap.end(); ++cit) { | 548 | cit != customMap.end(); ++cit) { |
544 | // qWarning(".ITEM."); | 549 | // owarn << ".ITEM." << oendl; |
545 | buf += cit.key(); | 550 | buf += cit.key(); |
546 | buf += "=\""; | 551 | buf += "=\""; |
547 | buf += Qtopia::escapeString(cit.data()); | 552 | buf += Qtopia::escapeString(cit.data()); |
@@ -570,7 +575,7 @@ QString OPimTodoAccessXML::toString( const OPimTodo& ev )const { | |||
570 | str += "DateMonth=\"" + QString::number( ev.dueDate().month() ) + "\" "; | 575 | str += "DateMonth=\"" + QString::number( ev.dueDate().month() ) + "\" "; |
571 | str += "DateDay=\"" + QString::number( ev.dueDate().day() ) + "\" "; | 576 | str += "DateDay=\"" + QString::number( ev.dueDate().day() ) + "\" "; |
572 | } | 577 | } |
573 | // qWarning( "Uid %d", ev.uid() ); | 578 | // owarn << "Uid " << ev.uid() << "" << oendl; |
574 | str += "Uid=\"" + QString::number( ev.uid() ) + "\" "; | 579 | str += "Uid=\"" + QString::number( ev.uid() ) + "\" "; |
575 | 580 | ||
576 | // append the extra options | 581 | // append the extra options |
@@ -617,7 +622,7 @@ QString OPimTodoAccessXML::toString( const OPimTodo& ev )const { | |||
617 | } | 622 | } |
618 | } | 623 | } |
619 | // now write the list | 624 | // now write the list |
620 | qWarning("als: %s", als.join("____________").latin1() ); | 625 | owarn << "als: " << als.join("____________") << "" << oendl; |
621 | str += "Alarms=\""+als.join(";") +"\" "; | 626 | str += "Alarms=\""+als.join(";") +"\" "; |
622 | } | 627 | } |
623 | 628 | ||
@@ -838,7 +843,7 @@ QArray<int> OPimTodoAccessXML::sorted( bool asc, int sortOrder, | |||
838 | } | 843 | } |
839 | /* isOverdue but we should not show overdue - why?*/ | 844 | /* isOverdue but we should not show overdue - why?*/ |
840 | /* if ( (*it).isOverdue() && !bOnly ) { | 845 | /* if ( (*it).isOverdue() && !bOnly ) { |
841 | qWarning("item is overdue but !bOnly"); | 846 | owarn << "item is overdue but !bOnly" << oendl; |
842 | continue; | 847 | continue; |
843 | } | 848 | } |
844 | */ | 849 | */ |
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 | |||
@@ -34,6 +34,8 @@ | |||
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> |
@@ -79,7 +81,7 @@ OPimContact::OPimContact( const QMap<int, QString> &fromMap ):OPimRecord(), mMap | |||
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 |
@@ -931,7 +933,7 @@ QStringList OPimContact::emailList() const | |||
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(); |
@@ -1136,7 +1138,7 @@ 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 | } |
@@ -1155,7 +1157,7 @@ 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 | } |
@@ -1196,7 +1198,7 @@ QDate OPimContact::anniversary() const | |||
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 | ||
@@ -1230,7 +1232,7 @@ void OPimContact::insertEmail( const QString &v ) | |||
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 |
@@ -1239,7 +1241,7 @@ void OPimContact::insertEmail( const QString &v ) | |||
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 |
@@ -1259,7 +1261,7 @@ 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() ) |
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 | |||
@@ -31,6 +31,8 @@ | |||
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 */ |
@@ -442,7 +444,7 @@ OPimContactFields::~OPimContactFields() | |||
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 ); |
@@ -454,15 +456,15 @@ void OPimContactFields::saveToRecord( OPimContact &cnt ) | |||
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 | { |
@@ -470,12 +472,12 @@ void OPimContactFields::loadFromRecord( const OPimContact &cnt ) | |||
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 | ||
@@ -484,13 +486,13 @@ void OPimContactFields::setFieldOrder( int num, int index ) | |||
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 ]; |
@@ -507,7 +509,7 @@ int OPimContactFields::getFieldOrder( int num, int defIndex ) | |||
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 | ||
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 | |||
@@ -28,6 +28,8 @@ _;:, .> :=|. This program is free software; you can | |||
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 |
@@ -46,7 +48,7 @@ QString OPimDateConversion::dateToString( const QDate &d ) | |||
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 | } |
@@ -74,24 +76,24 @@ QDate OPimDateConversion::dateFromString( const QString& s ) | |||
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 | ||
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 | |||
@@ -33,6 +33,8 @@ | |||
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 | ||
@@ -641,10 +643,10 @@ void OPimEvent::fromMap( const QMap<int, QString>& map ) | |||
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 ); |
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 | |||
@@ -31,6 +31,7 @@ | |||
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> |
@@ -163,7 +164,7 @@ void OPimNotifyManager::deregister( const OPimNotify& ) | |||
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 | } |
@@ -191,7 +192,7 @@ QString OPimNotifyManager::alarmsToString() const | |||
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 | ||
@@ -225,7 +226,7 @@ void OPimNotifyManager::alarmsFromString( const QString& 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 ] ), |
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 | |||
@@ -121,7 +121,7 @@ bool OPimRecord::isEmpty() const | |||
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 | }*/ |
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 | |||
@@ -29,6 +29,9 @@ | |||
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> |
@@ -149,7 +152,7 @@ QDateTime OPimTimeZone::toDateTime( time_t t ) | |||
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 | ||
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 | |||
@@ -35,6 +35,8 @@ | |||
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> |
@@ -85,17 +87,17 @@ 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 | } |
@@ -110,7 +112,7 @@ OPimTodo::OPimTodo( bool completed, int priority, | |||
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; |
@@ -133,7 +135,7 @@ OPimTodo::OPimTodo( bool completed, int priority, | |||
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; |
@@ -306,7 +308,7 @@ void OPimTodo::setHasDueDate( bool hasDate ) | |||
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 | } |
@@ -591,10 +593,10 @@ bool OPimTodo::operator==( const OPimTodo &toDoEvent ) const | |||
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 | } |
@@ -606,7 +608,7 @@ OPimTodo &OPimTodo::operator=( const OPimTodo &item ) | |||
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; |
@@ -649,7 +651,7 @@ 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 ); |
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 | |||
@@ -50,7 +50,7 @@ OPimTodoAccess::OPimTodoAccess( OPimTodoAccessBackend* end, enum Access ) | |||
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; |
diff --git a/libopie2/opiepim/ui/opimmainwindow.cpp b/libopie2/opiepim/ui/opimmainwindow.cpp index 40dc297..8ce2062 100644 --- a/libopie2/opiepim/ui/opimmainwindow.cpp +++ b/libopie2/opiepim/ui/opimmainwindow.cpp | |||
@@ -26,16 +26,23 @@ | |||
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 | #include <qapplication.h> | 29 | |
30 | #include <qdatetime.h> | 30 | #include "opimmainwindow.h" |
31 | #include <qcopchannel_qws.h> | 31 | |
32 | /* OPIE */ | ||
33 | #include <opie2/opimresolver.h> | ||
34 | #include <opie2/odebug.h> | ||
32 | 35 | ||
33 | #include <qpe/sound.h> | 36 | #include <qpe/sound.h> |
34 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
35 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
36 | 39 | ||
37 | #include <opie2/opimresolver.h> | 40 | /* QT */ |
38 | #include "opimmainwindow.h" | 41 | #include <qapplication.h> |
42 | #include <qdatetime.h> | ||
43 | #include <qcopchannel_qws.h> | ||
44 | |||
45 | |||
39 | 46 | ||
40 | namespace Opie { | 47 | namespace Opie { |
41 | OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, | 48 | OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, |
@@ -116,7 +123,7 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) | |||
116 | QDateTime dt; int uid; | 123 | QDateTime dt; int uid; |
117 | stream >> dt; | 124 | stream >> dt; |
118 | stream >> uid; | 125 | stream >> uid; |
119 | qWarning(" Date: %s Uid: %d", dt.toString().latin1(), uid ); | 126 | owarn << " Date: " << dt.toString() << " Uid: " << uid << "" << oendl; |
120 | QDateTime current = QDateTime::currentDateTime(); | 127 | QDateTime current = QDateTime::currentDateTime(); |
121 | if ( current.time().hour() != dt.time().hour() && current.time().minute() != dt.time().minute() ) | 128 | if ( current.time().hour() != dt.time().hour() && current.time().minute() != dt.time().minute() ) |
122 | return; | 129 | return; |