summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/ocontactaccess.cpp
authoreilers <eilers>2002-10-16 10:52:40 (UTC)
committer eilers <eilers>2002-10-16 10:52:40 (UTC)
commitf9756ca203a06fa60413ef1a96416d87b9dc1a6b (patch) (side-by-side diff)
tree0b67c3c485349a1c31ea82e7c12526b990654d58 /libopie2/opiepim/core/ocontactaccess.cpp
parent9eba62fc184260f1a0455a6dd057e2ccebf4bdac (diff)
downloadopie-f9756ca203a06fa60413ef1a96416d87b9dc1a6b.zip
opie-f9756ca203a06fa60413ef1a96416d87b9dc1a6b.tar.gz
opie-f9756ca203a06fa60413ef1a96416d87b9dc1a6b.tar.bz2
Added some docu to the interface and now using the cache infrastucture by zecke.. :)
Diffstat (limited to 'libopie2/opiepim/core/ocontactaccess.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp57
1 files changed, 11 insertions, 46 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index e8c0a45..2ca0283 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -21,6 +21,9 @@
* =====================================================================
* History:
* $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
* Some minor interface updates
*
@@ -62,8 +65,7 @@
OContactAccess::OContactAccess ( const QString appname, const QString ,
OContactAccessBackend* end, bool autosync ):
- OPimAccessTemplate<OContact>( end ),
- m_changed ( false )
+ OPimAccessTemplate<OContact>( end )
{
/* take care of the backend. If there is no one defined, we
* will use the XML-Backend as default (until we have a cute SQL-Backend..).
@@ -94,15 +96,10 @@ OContactAccess::~OContactAccess ()
/* The user may forget to save the changed database, therefore try to
* do it for him..
*/
- if ( m_changed )
- save();
+ save();
// delete m_backEnd; is done by template..
}
-bool OContactAccess::load()
-{
- return ( m_backEnd->load() );
-}
bool OContactAccess::save ()
{
@@ -110,19 +107,15 @@ bool OContactAccess::save ()
* Data. This will remove added items which is unacceptable !
* Therefore: Reload database and merge the data...
*/
- 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()" );
return true;
}
@@ -137,29 +130,6 @@ bool OContactAccess::hasQuerySettings ( int querySettings ) const
return ( m_backEnd->hasQuerySettings ( querySettings ) );
}
-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 ) );
-}
bool OContactAccess::wasChangedExternally()const
{
@@ -167,11 +137,6 @@ bool OContactAccess::wasChangedExternally()const
}
-bool OContactAccess::reload()
-{
- return ( m_backEnd->reload() );
-}
-
void OContactAccess::copMessage( const QCString &msg, const QByteArray & )
{
if ( msg == "addressbookUpdated()" ){