author | eilers <eilers> | 2002-10-16 10:52:40 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-16 10:52:40 (UTC) |
commit | f9756ca203a06fa60413ef1a96416d87b9dc1a6b (patch) (side-by-side diff) | |
tree | 0b67c3c485349a1c31ea82e7c12526b990654d58 /libopie2/opiepim/backend | |
parent | 9eba62fc184260f1a0455a6dd057e2ccebf4bdac (diff) | |
download | opie-f9756ca203a06fa60413ef1a96416d87b9dc1a6b.zip opie-f9756ca203a06fa60413ef1a96416d87b9dc1a6b.tar.gz opie-f9756ca203a06fa60413ef1a96416d87b9dc1a6b.tar.bz2 |
Added some docu to the interface and now using the cache infrastucture by zecke.. :)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h index 50ea329..12a75ba 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h @@ -18,4 +18,7 @@ * History: * $Log$ + * Revision 1.4 2002/10/16 10:52:40 eilers + * Added some docu to the interface and now using the cache infrastucture by zecke.. :) + * * Revision 1.3 2002/10/14 16:21:54 eilers * Some minor interface updates @@ -57,5 +60,6 @@ using namespace Opie; class OContactAccessBackend_XML : public OContactAccessBackend { public: - OContactAccessBackend_XML ( QString appname, QString filename = 0l ) + OContactAccessBackend_XML ( QString appname, QString filename = 0l ): + m_changed( false ) { m_appName = appname; @@ -76,4 +80,8 @@ class OContactAccessBackend_XML : public OContactAccessBackend { bool save() { + + if ( !m_changed ) + return true; + QString strNewFile = m_fileName + ".new"; QFile f( strNewFile ); @@ -124,4 +132,6 @@ class OContactAccessBackend_XML : public OContactAccessBackend { /* The journalfile should be removed now... */ removeJournal(); + + m_changed = false; return true; } @@ -146,4 +156,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { void clear () { m_contactList.clear(); + m_changed = false; } @@ -276,4 +287,7 @@ class OContactAccessBackend_XML : public OContactAccessBackend { updateJournal (newcontact, OContact::ACTION_ADD); addContact_p( newcontact ); + + m_changed = true; + return true; } @@ -281,4 +295,6 @@ class OContactAccessBackend_XML : public OContactAccessBackend { bool replace ( const OContact &contact ) { + m_changed = true; + bool found = false; @@ -301,4 +317,6 @@ class OContactAccessBackend_XML : public OContactAccessBackend { bool remove ( int uid ) { + m_changed = true; + bool found = false; QValueListIterator<OContact> it; @@ -554,4 +572,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { protected: + bool m_changed; QString m_journalName; QString m_fileName; |