author | eilers <eilers> | 2004-04-28 09:22:02 (UTC) |
---|---|---|
committer | eilers <eilers> | 2004-04-28 09:22:02 (UTC) |
commit | 134b7accd6bdc8fbc160a42f7c52c585e73f4add (patch) (unidiff) | |
tree | 5e221e990d0c94e38d816e147762f205733b0e72 /libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |
parent | 8ce67859c54234dabd88e17a0bc72369ea8301a3 (diff) | |
download | opie-134b7accd6bdc8fbc160a42f7c52c585e73f4add.zip opie-134b7accd6bdc8fbc160a42f7c52c585e73f4add.tar.gz opie-134b7accd6bdc8fbc160a42f7c52c585e73f4add.tar.bz2 |
Some modifications to alow use of generic OPimRecords without need to
cast them manually to the right type
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index 401a3c1..14207be 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |||
@@ -409,48 +409,49 @@ void OPimContactAccessBackend_SQL::clear () | |||
409 | ClearQuery cle; | 409 | ClearQuery cle; |
410 | OSQLResult res = m_driver->query( &cle ); | 410 | OSQLResult res = m_driver->query( &cle ); |
411 | 411 | ||
412 | reload(); | 412 | reload(); |
413 | } | 413 | } |
414 | 414 | ||
415 | bool OPimContactAccessBackend_SQL::wasChangedExternally() | 415 | bool OPimContactAccessBackend_SQL::wasChangedExternally() |
416 | { | 416 | { |
417 | return false; | 417 | return false; |
418 | } | 418 | } |
419 | 419 | ||
420 | QArray<int> OPimContactAccessBackend_SQL::allRecords() const | 420 | QArray<int> OPimContactAccessBackend_SQL::allRecords() const |
421 | { | 421 | { |
422 | 422 | ||
423 | // FIXME: Think about cute handling of changed tables.. | 423 | // FIXME: Think about cute handling of changed tables.. |
424 | // Thus, we don't have to call update here... | 424 | // Thus, we don't have to call update here... |
425 | if ( m_changed ) | 425 | if ( m_changed ) |
426 | ((OPimContactAccessBackend_SQL*)this)->update(); | 426 | ((OPimContactAccessBackend_SQL*)this)->update(); |
427 | 427 | ||
428 | return m_uids; | 428 | return m_uids; |
429 | } | 429 | } |
430 | 430 | ||
431 | bool OPimContactAccessBackend_SQL::add ( const OPimContact &newcontact ) | 431 | bool OPimContactAccessBackend_SQL::add ( const OPimContact &newcontact ) |
432 | { | 432 | { |
433 | qDebug("add in contact SQL-Backend"); | ||
433 | InsertQuery ins( newcontact ); | 434 | InsertQuery ins( newcontact ); |
434 | OSQLResult res = m_driver->query( &ins ); | 435 | OSQLResult res = m_driver->query( &ins ); |
435 | 436 | ||
436 | if ( res.state() == OSQLResult::Failure ) | 437 | if ( res.state() == OSQLResult::Failure ) |
437 | return false; | 438 | return false; |
438 | 439 | ||
439 | int c = m_uids.count(); | 440 | int c = m_uids.count(); |
440 | m_uids.resize( c+1 ); | 441 | m_uids.resize( c+1 ); |
441 | m_uids[c] = newcontact.uid(); | 442 | m_uids[c] = newcontact.uid(); |
442 | 443 | ||
443 | return true; | 444 | return true; |
444 | } | 445 | } |
445 | 446 | ||
446 | 447 | ||
447 | bool OPimContactAccessBackend_SQL::remove ( int uid ) | 448 | bool OPimContactAccessBackend_SQL::remove ( int uid ) |
448 | { | 449 | { |
449 | RemoveQuery rem( uid ); | 450 | RemoveQuery rem( uid ); |
450 | OSQLResult res = m_driver->query(&rem ); | 451 | OSQLResult res = m_driver->query(&rem ); |
451 | 452 | ||
452 | if ( res.state() == OSQLResult::Failure ) | 453 | if ( res.state() == OSQLResult::Failure ) |
453 | return false; | 454 | return false; |
454 | 455 | ||
455 | m_changed = true; | 456 | m_changed = true; |
456 | 457 | ||