Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index e893b38..756f405 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp | |||
@@ -13,8 +13,11 @@ | |||
13 | * Version: $Id$ | 13 | * Version: $Id$ |
14 | * ===================================================================== | 14 | * ===================================================================== |
15 | * History: | 15 | * History: |
16 | * $Log$ | 16 | * $Log$ |
17 | * Revision 1.3 2003/12/22 11:41:39 eilers | ||
18 | * Fixing stupid bug, found by sourcode review.. | ||
19 | * | ||
17 | * Revision 1.2 2003/12/22 10:19:26 eilers | 20 | * Revision 1.2 2003/12/22 10:19:26 eilers |
18 | * Finishing implementation of sql-backend for datebook. But I have to | 21 | * Finishing implementation of sql-backend for datebook. But I have to |
19 | * port the PIM datebook application to use it, before I could debug the | 22 | * port the PIM datebook application to use it, before I could debug the |
20 | * whole stuff. | 23 | * whole stuff. |
@@ -205,8 +208,9 @@ OEvent ODateBookAccessBackend_SQL::find( int uid ) const{ | |||
205 | 208 | ||
206 | return retDate; | 209 | return retDate; |
207 | } | 210 | } |
208 | 211 | ||
212 | // FIXME: Speed up update of uid's.. | ||
209 | bool ODateBookAccessBackend_SQL::add( const OEvent& ev ) | 213 | bool ODateBookAccessBackend_SQL::add( const OEvent& ev ) |
210 | { | 214 | { |
211 | QMap<int,QString> eventMap = ev.toMap(); | 215 | QMap<int,QString> eventMap = ev.toMap(); |
212 | 216 | ||
@@ -243,12 +247,16 @@ bool ODateBookAccessBackend_SQL::add( const OEvent& ev ) | |||
243 | OSQLResult res = m_driver->query( &raw ); | 247 | OSQLResult res = m_driver->query( &raw ); |
244 | if ( res.state() != OSQLResult::Success ){ | 248 | if ( res.state() != OSQLResult::Success ){ |
245 | return false; | 249 | return false; |
246 | } | 250 | } |
251 | |||
252 | // Update list of uid's | ||
253 | update(); | ||
247 | 254 | ||
248 | return true; | 255 | return true; |
249 | } | 256 | } |
250 | 257 | ||
258 | // FIXME: Speed up update of uid's.. | ||
251 | bool ODateBookAccessBackend_SQL::remove( int uid ) | 259 | bool ODateBookAccessBackend_SQL::remove( int uid ) |
252 | { | 260 | { |
253 | QString qu = "DELETE from datebook where uid = " | 261 | QString qu = "DELETE from datebook where uid = " |
254 | + QString::number( uid ) + ";"; | 262 | + QString::number( uid ) + ";"; |
@@ -260,8 +268,11 @@ bool ODateBookAccessBackend_SQL::remove( int uid ) | |||
260 | if ( res.state() != OSQLResult::Success ){ | 268 | if ( res.state() != OSQLResult::Success ){ |
261 | return false; | 269 | return false; |
262 | } | 270 | } |
263 | 271 | ||
272 | // Update list of uid's | ||
273 | update(); | ||
274 | |||
264 | return true; | 275 | return true; |
265 | } | 276 | } |
266 | 277 | ||
267 | bool ODateBookAccessBackend_SQL::replace( const OEvent& ev ) | 278 | bool ODateBookAccessBackend_SQL::replace( const OEvent& ev ) |