Diffstat (limited to 'libopie/pim/ocontactaccess.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/ocontactaccess.cpp | 57 |
1 files changed, 11 insertions, 46 deletions
diff --git a/libopie/pim/ocontactaccess.cpp b/libopie/pim/ocontactaccess.cpp index e8c0a45..2ca0283 100644 --- a/libopie/pim/ocontactaccess.cpp +++ b/libopie/pim/ocontactaccess.cpp @@ -23,2 +23,5 @@ * $Log$ + * Revision 1.5 2002/10/16 10:52:40 eilers + * Added some docu to the interface and now using the cache infrastucture by zecke.. :) + * * Revision 1.4 2002/10/14 16:21:54 eilers @@ -64,4 +67,3 @@ OContactAccess::OContactAccess ( const QString appname, const QString , OContactAccessBackend* end, bool autosync ): - OPimAccessTemplate<OContact>( end ), - m_changed ( false ) + OPimAccessTemplate<OContact>( end ) { @@ -96,4 +98,3 @@ OContactAccess::~OContactAccess () */ - if ( m_changed ) - save(); + save(); // delete m_backEnd; is done by template.. @@ -101,6 +102,2 @@ OContactAccess::~OContactAccess () -bool OContactAccess::load() -{ - return ( m_backEnd->load() ); -} @@ -112,15 +109,11 @@ bool OContactAccess::save () */ - if ( m_backEnd->wasChangedExternally() ) + if ( OPimAccessTemplate<OContact>::wasChangedExternally() ) reload(); - if ( m_changed ){ - bool status = m_backEnd->save(); - if ( !status ) return false; + bool status = OPimAccessTemplate<OContact>::save(); + if ( !status ) return false; - m_changed = false; - /* Now tell everyone that new data is available. - */ - QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); - - } + /* Now tell everyone that new data is available. + */ + QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); @@ -139,25 +132,2 @@ bool OContactAccess::hasQuerySettings ( int querySettings ) const -bool OContactAccess::add ( const OContact& newcontact ) -{ - m_changed = true; - return ( m_backEnd->add ( newcontact ) ); -} - -bool OContactAccess::replace ( const OContact& contact ) -{ - m_changed = true; - return ( m_backEnd->replace ( contact ) ); -} - -bool OContactAccess::remove ( const OContact& t ) -{ - m_changed = true; - return ( m_backEnd->remove ( t.uid() ) ); -} - -bool OContactAccess::remove ( int uid ) -{ - m_changed = true; - return ( m_backEnd->remove ( uid ) ); -} @@ -169,7 +139,2 @@ bool OContactAccess::wasChangedExternally()const -bool OContactAccess::reload() -{ - return ( m_backEnd->reload() ); -} - void OContactAccess::copMessage( const QCString &msg, const QByteArray & ) |