author | ar <ar> | 2004-06-01 21:38:07 (UTC) |
---|---|---|
committer | ar <ar> | 2004-06-01 21:38:07 (UTC) |
commit | baed1d5ab8589aef14440009bc4e7380bcc5a741 (patch) (unidiff) | |
tree | c636e892c5eec0df2b36d16cb601a7da41a2ef0f /libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | |
parent | 4438393d8eef624565e840b798429071829adea8 (diff) | |
download | opie-baed1d5ab8589aef14440009bc4e7380bcc5a741.zip opie-baed1d5ab8589aef14440009bc4e7380bcc5a741.tar.gz opie-baed1d5ab8589aef14440009bc4e7380bcc5a741.tar.bz2 |
- convert to odebug framework
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
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 | ||