Changes: Properly update GUID and timestamps when save
authorMathias Hasselmann <mathias@openismus.com>
Tue, 22 Jun 2010 22:02:20 +0000 (00:02 +0200)
committerMathias Hasselmann <mathias@openismus.com>
Tue, 22 Jun 2010 22:30:28 +0000 (00:30 +0200)
commit863f8710b4ea94204c5cb720646f943565e9f2d1
tree42f62f8277c596b1c7951ec84ea79b7932c63519
parent05d610fcbd2d52bf3f1f33d16b5531dcefe26527
Changes: Properly update GUID and timestamps when save

RevBy: TrustMe
Details:

 * src/dao/contactdetailschema.cpp: defineGuidDetail(), defineTimestampDetail()):
   Mark GUID and timestamp fields readonly again as we must treat them special.

 * src/engine/contactsaverequest.cpp:
   Context, collectInsertions(), collectDeletions(), buildQuery():
 * src/engine/contactsaverequest.h: Context:
   Permit overwriting of GUID and creation timestamp. Preserve existing GUID
   and timestamps when the save request gets an incomplete contact and
   errornously assumes GUID or timestamp must be generated.

 * src/engine/engine.cpp: saveContact(), saveContacts():
   Only update contact id after saving. All other information must be fetched.

 * tests/ut_qtcontacts_trackerplugin/ut_qtcontacts_trackerplugin.cpp:
   testSaveContacts(): Improve GUID and timestamp tests.

 * tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-1.rq:
 * tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-2.rq:
 * tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-3.rq:
 * tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-4.rq:
 * tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-5.rq:
   Update reference queries for save requests.

 * tests/ut_qtcontacts_trackerplugin_querybuilder/ut_qtcontacts_trackerplugin_querybuilder.cpp:
   verifyQuery(), testSaveRequestQuery_data(): Add support for GUID
   placeholders. Strip GUID and timestamps for contacts to verify how the save
   requests is dealing with those cases.
13 files changed:
src/dao/contactdetailschema.cpp
src/engine/contactsaverequest.cpp
src/engine/contactsaverequest.h
src/engine/engine.cpp
src/engine/engine.cpp.orig [new file with mode: 0644]
src/license.h [new file with mode: 0644]
tests/ut_qtcontacts_trackerplugin/ut_qtcontacts_trackerplugin.cpp
tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-1.rq
tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-2.rq
tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-3.rq
tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-4.rq
tests/ut_qtcontacts_trackerplugin_querybuilder/data/202-save-request-5.rq
tests/ut_qtcontacts_trackerplugin_querybuilder/ut_qtcontacts_trackerplugin_querybuilder.cpp