syncevolution/src/backends/sqlite
Patrick Ohly 12334eb676 SyncSource: remove special RegisterSyncSource::InactiveSource pointer
The special semantic of the former RegisterSyncSource::InactiveSource
(invalid pointer of value 1) caused bugs, like using it in
--print-databases (=> segfault) or not being able to store the result
of a createSource() directly in a smart pointer (=> potential leak in
SyncSource::createSource()).

Obviously a bad idea to start with. Replaced with a
RegisterSyncSource::InactiveSource() method which creates a real,
inactive SyncSource instance which can and must be deleted by the
caller.

This is a SyncSource API change for backend developers.
Instead of RegisterSyncSource::InactiveSource, return
RegisterSyncSource::InactiveSource().

Comparisons against RegisterSyncSource::InactiveSource needs
to be replaced with a call to the new SyncSource::isInactive().

User visible fixes:
* --print-databases: no longer crashes when EDS or KDE backends
  are not usable. Instead it prints "not enabled during compilation or
  not usable in the current environment".
* --print-databases: continues with other backends even if
  one backend throws an exception, as the KDE backend does
  when it cannot find Akonadi. Error messages are printed.
2012-03-09 07:25:11 +00:00
..
configure-sub.in Port build system to non-recursive Automake. 2011-08-30 16:38:34 +02:00
README sqlite backend: made it possible to compile out-of-tree 2009-10-02 17:27:45 +02:00
sqlite.am Port build system to non-recursive Automake. 2011-08-30 16:38:34 +02:00
SQLiteContactSource.cpp phone sync: delete<->delete conflict + phone calendar+todo sync (BMC #23744) 2011-11-14 21:17:02 +01:00
SQLiteContactSource.h SQLite backend: adapted to SyncSource API changes 2011-05-05 20:16:10 +08:00
SQLiteContactSourceRegister.cpp SyncSource: remove special RegisterSyncSource::InactiveSource pointer 2012-03-09 07:25:11 +00:00
SQLiteUtil.cpp files and classes renamed, include statements cleaned up 2009-10-05 14:49:32 +02:00
SQLiteUtil.h files and classes renamed, include statements cleaned up 2009-10-05 14:49:32 +02:00

This is a demo backend. It uses a database schema that is similar to
the one used on the iPhone, but it is not as complete.

To compile this backend as part of SyncEvolution, configure with
--enable-sqlite.

To compile it against a binary distribution of SyncEvolution, make
sure that the SyncEvolution, Synthesis and sqlite developer files are
installed and that pkg-config can find syncevolution.pc, synthesis.pc
and sqlite.pc. Set your PKG_CONFIG_PATH if necessary.

Then the source files can be compiled as follows:
   g++ -fpic -DPIC -DENABLE_SQLITE -shared -I. \
       `pkg-config --cflags --libs syncevolution`
       `pkg-config --cflags --libs sqlite`
       *.cpp  \
       -o /tmp/syncsqlite.so

Install /tmp/syncsqlite.so by moving it into the
"lib/syncevolution/backends" directory of the SyncEvolution
installation.

It then should show up as additional choice for the "type" property:
   syncevolution --source-property type=?

   ...
   SQLite Address Book = addressbook = contacts = sqlite-contacts
      vCard 2.1 (default) = text/x-vcard