Diffstat (limited to 'libopie2/opiepim/core/ocontactaccess.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.cpp | 57 |
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 | |||
@@ -23,2 +23,5 @@ | |||
23 | * $Log$ | 23 | * $Log$ |
24 | * Revision 1.5 2002/10/16 10:52:40 eilers | ||
25 | * Added some docu to the interface and now using the cache infrastucture by zecke.. :) | ||
26 | * | ||
24 | * Revision 1.4 2002/10/14 16:21:54 eilers | 27 | * Revision 1.4 2002/10/14 16:21:54 eilers |
@@ -64,4 +67,3 @@ OContactAccess::OContactAccess ( const QString appname, const QString , | |||
64 | OContactAccessBackend* end, bool autosync ): | 67 | OContactAccessBackend* end, bool autosync ): |
65 | OPimAccessTemplate<OContact>( end ), | 68 | OPimAccessTemplate<OContact>( end ) |
66 | m_changed ( false ) | ||
67 | { | 69 | { |
@@ -96,4 +98,3 @@ OContactAccess::~OContactAccess () | |||
96 | */ | 98 | */ |
97 | if ( m_changed ) | 99 | save(); |
98 | save(); | ||
99 | // delete m_backEnd; is done by template.. | 100 | // delete m_backEnd; is done by template.. |
@@ -101,6 +102,2 @@ OContactAccess::~OContactAccess () | |||
101 | 102 | ||
102 | bool OContactAccess::load() | ||
103 | { | ||
104 | return ( m_backEnd->load() ); | ||
105 | } | ||
106 | 103 | ||
@@ -112,15 +109,11 @@ bool OContactAccess::save () | |||
112 | */ | 109 | */ |
113 | if ( m_backEnd->wasChangedExternally() ) | 110 | if ( OPimAccessTemplate<OContact>::wasChangedExternally() ) |
114 | reload(); | 111 | reload(); |
115 | 112 | ||
116 | if ( m_changed ){ | 113 | bool status = OPimAccessTemplate<OContact>::save(); |
117 | bool status = m_backEnd->save(); | 114 | if ( !status ) return false; |
118 | if ( !status ) return false; | ||
119 | 115 | ||
120 | m_changed = false; | 116 | /* Now tell everyone that new data is available. |
121 | /* Now tell everyone that new data is available. | 117 | */ |
122 | */ | 118 | QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); |
123 | QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); | ||
124 | |||
125 | } | ||
126 | 119 | ||
@@ -139,25 +132,2 @@ bool OContactAccess::hasQuerySettings ( int querySettings ) const | |||
139 | 132 | ||
140 | bool OContactAccess::add ( const OContact& newcontact ) | ||
141 | { | ||
142 | m_changed = true; | ||
143 | return ( m_backEnd->add ( newcontact ) ); | ||
144 | } | ||
145 | |||
146 | bool OContactAccess::replace ( const OContact& contact ) | ||
147 | { | ||
148 | m_changed = true; | ||
149 | return ( m_backEnd->replace ( contact ) ); | ||
150 | } | ||
151 | |||
152 | bool OContactAccess::remove ( const OContact& t ) | ||
153 | { | ||
154 | m_changed = true; | ||
155 | return ( m_backEnd->remove ( t.uid() ) ); | ||
156 | } | ||
157 | |||
158 | bool OContactAccess::remove ( int uid ) | ||
159 | { | ||
160 | m_changed = true; | ||
161 | return ( m_backEnd->remove ( uid ) ); | ||
162 | } | ||
163 | 133 | ||
@@ -169,7 +139,2 @@ bool OContactAccess::wasChangedExternally()const | |||
169 | 139 | ||
170 | bool OContactAccess::reload() | ||
171 | { | ||
172 | return ( m_backEnd->reload() ); | ||
173 | } | ||
174 | |||
175 | void OContactAccess::copMessage( const QCString &msg, const QByteArray & ) | 140 | void OContactAccess::copMessage( const QCString &msg, const QByteArray & ) |