-rw-r--r-- | libopie/pim/ocontact.h | 2 | ||||
-rw-r--r-- | libopie/pim/ocontactaccessbackend_xml.h | 24 | ||||
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.h | 24 | ||||
-rw-r--r-- | libopie2/opiepim/ocontact.h | 2 |
4 files changed, 30 insertions, 22 deletions
diff --git a/libopie/pim/ocontact.h b/libopie/pim/ocontact.h index 65ba43e..1fd1c75 100644 --- a/libopie/pim/ocontact.h +++ b/libopie/pim/ocontact.h | |||
@@ -45,6 +45,4 @@ public: | |||
45 | virtual ~OContact(); | 45 | virtual ~OContact(); |
46 | 46 | ||
47 | enum journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE }; | ||
48 | |||
49 | /* | 47 | /* |
50 | * do we need to inline them | 48 | * do we need to inline them |
diff --git a/libopie/pim/ocontactaccessbackend_xml.h b/libopie/pim/ocontactaccessbackend_xml.h index ae6ec9e..c765ff5 100644 --- a/libopie/pim/ocontactaccessbackend_xml.h +++ b/libopie/pim/ocontactaccessbackend_xml.h | |||
@@ -18,4 +18,7 @@ | |||
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.9 2002/12/08 12:48:57 eilers | ||
21 | * Moved journal-enum from ocontact into i the xml-backend.. | ||
22 | * | ||
20 | * Revision 1.8 2002/11/14 17:04:24 eilers | 23 | * Revision 1.8 2002/11/14 17:04:24 eilers |
21 | * Sorting will now work if fullname is identical on some entries | 24 | * Sorting will now work if fullname is identical on some entries |
@@ -343,5 +346,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
343 | { | 346 | { |
344 | //qWarning("odefaultbackend: ACTION::ADD"); | 347 | //qWarning("odefaultbackend: ACTION::ADD"); |
345 | updateJournal (newcontact, OContact::ACTION_ADD); | 348 | updateJournal (newcontact, ACTION_ADD); |
346 | addContact_p( newcontact ); | 349 | addContact_p( newcontact ); |
347 | 350 | ||
@@ -365,5 +368,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
365 | } | 368 | } |
366 | if (found) { | 369 | if (found) { |
367 | updateJournal (contact, OContact::ACTION_REPLACE); | 370 | updateJournal (contact, ACTION_REPLACE); |
368 | m_contactList.remove (it); | 371 | m_contactList.remove (it); |
369 | m_contactList.append (contact); | 372 | m_contactList.append (contact); |
@@ -386,5 +389,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
386 | } | 389 | } |
387 | if (found) { | 390 | if (found) { |
388 | updateJournal ( *it, OContact::ACTION_REMOVE); | 391 | updateJournal ( *it, ACTION_REMOVE); |
389 | m_contactList.remove (it); | 392 | m_contactList.remove (it); |
390 | return true; | 393 | return true; |
@@ -399,4 +402,7 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
399 | 402 | ||
400 | private: | 403 | private: |
404 | |||
405 | enum journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE }; | ||
406 | |||
401 | void addContact_p( const OContact &newcontact ){ | 407 | void addContact_p( const OContact &newcontact ){ |
402 | m_contactList.append (newcontact); | 408 | m_contactList.append (newcontact); |
@@ -418,5 +424,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
418 | 424 | ||
419 | bool foundAction = false; | 425 | bool foundAction = false; |
420 | OContact::journal_action action = OContact::ACTION_ADD; | 426 | journal_action action = ACTION_ADD; |
421 | int journalKey = 0; | 427 | int journalKey = 0; |
422 | QMap<int, QString> contactMap; | 428 | QMap<int, QString> contactMap; |
@@ -539,5 +545,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
539 | */ | 545 | */ |
540 | case JOURNALACTION: | 546 | case JOURNALACTION: |
541 | action = OContact::journal_action(it.data().toInt()); | 547 | action = journal_action(it.data().toInt()); |
542 | foundAction = true; | 548 | foundAction = true; |
543 | qWarning ("ODefBack(journal)::ACTION found: %d", action); | 549 | qWarning ("ODefBack(journal)::ACTION found: %d", action); |
@@ -561,13 +567,13 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
561 | foundAction = false; | 567 | foundAction = false; |
562 | switch ( action ) { | 568 | switch ( action ) { |
563 | case OContact::ACTION_ADD: | 569 | case ACTION_ADD: |
564 | addContact_p (contact); | 570 | addContact_p (contact); |
565 | break; | 571 | break; |
566 | case OContact::ACTION_REMOVE: | 572 | case ACTION_REMOVE: |
567 | if ( !remove (contact.uid()) ) | 573 | if ( !remove (contact.uid()) ) |
568 | qWarning ("ODefBack(journal)::Unable to remove uid: %d", | 574 | qWarning ("ODefBack(journal)::Unable to remove uid: %d", |
569 | contact.uid() ); | 575 | contact.uid() ); |
570 | break; | 576 | break; |
571 | case OContact::ACTION_REPLACE: | 577 | case ACTION_REPLACE: |
572 | if ( !replace ( contact ) ) | 578 | if ( !replace ( contact ) ) |
573 | qWarning ("ODefBack(journal)::Unable to replace uid: %d", | 579 | qWarning ("ODefBack(journal)::Unable to replace uid: %d", |
@@ -596,5 +602,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
596 | 602 | ||
597 | void updateJournal( const OContact& cnt, | 603 | void updateJournal( const OContact& cnt, |
598 | OContact::journal_action action ) { | 604 | journal_action action ) { |
599 | QFile f( m_journalName ); | 605 | QFile f( m_journalName ); |
600 | bool created = !f.exists(); | 606 | bool created = !f.exists(); |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h index ae6ec9e..c765ff5 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h | |||
@@ -18,4 +18,7 @@ | |||
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.9 2002/12/08 12:48:57 eilers | ||
21 | * Moved journal-enum from ocontact into i the xml-backend.. | ||
22 | * | ||
20 | * Revision 1.8 2002/11/14 17:04:24 eilers | 23 | * Revision 1.8 2002/11/14 17:04:24 eilers |
21 | * Sorting will now work if fullname is identical on some entries | 24 | * Sorting will now work if fullname is identical on some entries |
@@ -343,5 +346,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
343 | { | 346 | { |
344 | //qWarning("odefaultbackend: ACTION::ADD"); | 347 | //qWarning("odefaultbackend: ACTION::ADD"); |
345 | updateJournal (newcontact, OContact::ACTION_ADD); | 348 | updateJournal (newcontact, ACTION_ADD); |
346 | addContact_p( newcontact ); | 349 | addContact_p( newcontact ); |
347 | 350 | ||
@@ -365,5 +368,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
365 | } | 368 | } |
366 | if (found) { | 369 | if (found) { |
367 | updateJournal (contact, OContact::ACTION_REPLACE); | 370 | updateJournal (contact, ACTION_REPLACE); |
368 | m_contactList.remove (it); | 371 | m_contactList.remove (it); |
369 | m_contactList.append (contact); | 372 | m_contactList.append (contact); |
@@ -386,5 +389,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
386 | } | 389 | } |
387 | if (found) { | 390 | if (found) { |
388 | updateJournal ( *it, OContact::ACTION_REMOVE); | 391 | updateJournal ( *it, ACTION_REMOVE); |
389 | m_contactList.remove (it); | 392 | m_contactList.remove (it); |
390 | return true; | 393 | return true; |
@@ -399,4 +402,7 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
399 | 402 | ||
400 | private: | 403 | private: |
404 | |||
405 | enum journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE }; | ||
406 | |||
401 | void addContact_p( const OContact &newcontact ){ | 407 | void addContact_p( const OContact &newcontact ){ |
402 | m_contactList.append (newcontact); | 408 | m_contactList.append (newcontact); |
@@ -418,5 +424,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
418 | 424 | ||
419 | bool foundAction = false; | 425 | bool foundAction = false; |
420 | OContact::journal_action action = OContact::ACTION_ADD; | 426 | journal_action action = ACTION_ADD; |
421 | int journalKey = 0; | 427 | int journalKey = 0; |
422 | QMap<int, QString> contactMap; | 428 | QMap<int, QString> contactMap; |
@@ -539,5 +545,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
539 | */ | 545 | */ |
540 | case JOURNALACTION: | 546 | case JOURNALACTION: |
541 | action = OContact::journal_action(it.data().toInt()); | 547 | action = journal_action(it.data().toInt()); |
542 | foundAction = true; | 548 | foundAction = true; |
543 | qWarning ("ODefBack(journal)::ACTION found: %d", action); | 549 | qWarning ("ODefBack(journal)::ACTION found: %d", action); |
@@ -561,13 +567,13 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
561 | foundAction = false; | 567 | foundAction = false; |
562 | switch ( action ) { | 568 | switch ( action ) { |
563 | case OContact::ACTION_ADD: | 569 | case ACTION_ADD: |
564 | addContact_p (contact); | 570 | addContact_p (contact); |
565 | break; | 571 | break; |
566 | case OContact::ACTION_REMOVE: | 572 | case ACTION_REMOVE: |
567 | if ( !remove (contact.uid()) ) | 573 | if ( !remove (contact.uid()) ) |
568 | qWarning ("ODefBack(journal)::Unable to remove uid: %d", | 574 | qWarning ("ODefBack(journal)::Unable to remove uid: %d", |
569 | contact.uid() ); | 575 | contact.uid() ); |
570 | break; | 576 | break; |
571 | case OContact::ACTION_REPLACE: | 577 | case ACTION_REPLACE: |
572 | if ( !replace ( contact ) ) | 578 | if ( !replace ( contact ) ) |
573 | qWarning ("ODefBack(journal)::Unable to replace uid: %d", | 579 | qWarning ("ODefBack(journal)::Unable to replace uid: %d", |
@@ -596,5 +602,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
596 | 602 | ||
597 | void updateJournal( const OContact& cnt, | 603 | void updateJournal( const OContact& cnt, |
598 | OContact::journal_action action ) { | 604 | journal_action action ) { |
599 | QFile f( m_journalName ); | 605 | QFile f( m_journalName ); |
600 | bool created = !f.exists(); | 606 | bool created = !f.exists(); |
diff --git a/libopie2/opiepim/ocontact.h b/libopie2/opiepim/ocontact.h index 65ba43e..1fd1c75 100644 --- a/libopie2/opiepim/ocontact.h +++ b/libopie2/opiepim/ocontact.h | |||
@@ -45,6 +45,4 @@ public: | |||
45 | virtual ~OContact(); | 45 | virtual ~OContact(); |
46 | 46 | ||
47 | enum journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE }; | ||
48 | |||
49 | /* | 47 | /* |
50 | * do we need to inline them | 48 | * do we need to inline them |