Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index dd9dbde..a5be4c8 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |||
@@ -5,24 +5,36 @@ | |||
5 | * | 5 | * |
6 | * ===================================================================== | 6 | * ===================================================================== |
7 | *This program is free software; you can redistribute it and/or | 7 | *This program is free software; you can redistribute it and/or |
8 | *modify it under the terms of the GNU Library General Public | 8 | *modify it under the terms of the GNU Library General Public |
9 | * License as published by the Free Software Foundation; either | 9 | * License as published by the Free Software Foundation; either |
10 | * version 2 of the License, or (at your option) any later version. | 10 | * version 2 of the License, or (at your option) any later version. |
11 | * ===================================================================== | 11 | * ===================================================================== |
12 | * ===================================================================== | 12 | * ===================================================================== |
13 | * Version: $Id$ | 13 | * Version: $Id$ |
14 | * ===================================================================== | 14 | * ===================================================================== |
15 | * History: | 15 | * History: |
16 | * $Log$ | 16 | * $Log$ |
17 | * Revision 1.4 2003/12/22 10:19:26 eilers | ||
18 | * 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 | ||
20 | * whole stuff. | ||
21 | * Thus, PIM-Database backend is finished, but highly experimental. And some | ||
22 | * parts are still generic. For instance, the "queryByExample()" methods are | ||
23 | * not (or not fully) implemented. Todo: custom-entries not stored. | ||
24 | * The big show stopper: matchRegExp() (needed by OpieSearch) needs regular | ||
25 | * expression search in the database, which is not supported by sqlite ! | ||
26 | * Therefore we need either an extended sqlite or a workaround which would | ||
27 | * be very slow and memory consuming.. | ||
28 | * | ||
17 | * Revision 1.3 2003/12/08 15:18:10 eilers | 29 | * Revision 1.3 2003/12/08 15:18:10 eilers |
18 | * Committing unfinished sql implementation before merging to libopie2 starts.. | 30 | * Committing unfinished sql implementation before merging to libopie2 starts.. |
19 | * | 31 | * |
20 | * Revision 1.2 2003/09/29 07:44:26 eilers | 32 | * Revision 1.2 2003/09/29 07:44:26 eilers |
21 | * Improvement of PIM-SQL Databases, but search queries are still limited. | 33 | * Improvement of PIM-SQL Databases, but search queries are still limited. |
22 | * Addressbook: Changed table layout. Now, we just need 1/3 of disk-space. | 34 | * Addressbook: Changed table layout. Now, we just need 1/3 of disk-space. |
23 | * Todo: Started to add new attributes. Some type conversions missing. | 35 | * Todo: Started to add new attributes. Some type conversions missing. |
24 | * | 36 | * |
25 | * Revision 1.1 2003/09/22 14:31:16 eilers | 37 | * Revision 1.1 2003/09/22 14:31:16 eilers |
26 | * Added first experimental incarnation of sql-backend for addressbook. | 38 | * Added first experimental incarnation of sql-backend for addressbook. |
27 | * Some modifications to be able to compile the todo sql-backend. | 39 | * Some modifications to be able to compile the todo sql-backend. |
28 | * A lot of changes fill follow... | 40 | * A lot of changes fill follow... |
@@ -501,34 +513,34 @@ bool OContactAccessBackend_SQL::load () | |||
501 | 513 | ||
502 | return true; | 514 | return true; |
503 | 515 | ||
504 | } | 516 | } |
505 | 517 | ||
506 | bool OContactAccessBackend_SQL::reload() | 518 | bool OContactAccessBackend_SQL::reload() |
507 | { | 519 | { |
508 | return load(); | 520 | return load(); |
509 | } | 521 | } |
510 | 522 | ||
511 | bool OContactAccessBackend_SQL::save() | 523 | bool OContactAccessBackend_SQL::save() |
512 | { | 524 | { |
513 | return m_driver->close(); | 525 | return m_driver->close(); // Shouldn't m_driver->sync be better than close ? (eilers) |
514 | } | 526 | } |
515 | 527 | ||
516 | 528 | ||
517 | void OContactAccessBackend_SQL::clear () | 529 | void OContactAccessBackend_SQL::clear () |
518 | { | 530 | { |
519 | ClearQuery cle; | 531 | ClearQuery cle; |
520 | OSQLResult res = m_driver->query( &cle ); | 532 | OSQLResult res = m_driver->query( &cle ); |
521 | CreateQuery qu; | 533 | |
522 | res = m_driver->query(&qu); | 534 | reload(); |
523 | } | 535 | } |
524 | 536 | ||
525 | bool OContactAccessBackend_SQL::wasChangedExternally() | 537 | bool OContactAccessBackend_SQL::wasChangedExternally() |
526 | { | 538 | { |
527 | return false; | 539 | return false; |
528 | } | 540 | } |
529 | 541 | ||
530 | QArray<int> OContactAccessBackend_SQL::allRecords() const | 542 | QArray<int> OContactAccessBackend_SQL::allRecords() const |
531 | { | 543 | { |
532 | 544 | ||
533 | // FIXME: Think about cute handling of changed tables.. | 545 | // FIXME: Think about cute handling of changed tables.. |
534 | // Thus, we don't have to call update here... | 546 | // Thus, we don't have to call update here... |