[evolution-data-server/openismus-work-master: 5/7] EBookBackendFile: Use the new ESourceAddressBookConfig to configure the summary
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work-master: 5/7] EBookBackendFile: Use the new ESourceAddressBookConfig to configure the summary
- Date: Tue, 20 Nov 2012 10:28:43 +0000 (UTC)
commit 60f5be736e94669be801ac8106496869d9a262e8
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Wed Nov 7 17:31:10 2012 +0900
EBookBackendFile: Use the new ESourceAddressBookConfig to configure the summary
addressbook/backends/file/e-book-backend-file.c | 28 ++++++++++++++---------
1 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index 11f8231..6ba4562 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -63,6 +63,7 @@
#define EDB_ERROR_EX(_code, _msg) e_data_book_create_error (E_DATA_BOOK_STATUS_ ## _code, _msg)
#define EDB_NOT_OPENED_ERROR EDB_ERROR(NOT_OPENED)
+
G_DEFINE_TYPE (EBookBackendFile, e_book_backend_file, E_TYPE_BOOK_BACKEND_SYNC)
struct _EBookBackendFilePrivate {
@@ -1240,6 +1241,7 @@ e_book_backend_file_open (EBookBackendSync *backend,
ESource *source;
GError *local_error = NULL;
gboolean populated;
+ ESourceBackendSummarySetup *setup;
source = e_backend_get_source (E_BACKEND (backend));
registry = e_book_backend_get_registry (E_BOOK_BACKEND (backend));
@@ -1248,15 +1250,18 @@ e_book_backend_file_open (EBookBackendSync *backend,
filename = g_build_filename (dirname, "addressbook.db", NULL);
backup = g_build_filename (dirname, "addressbook.db.old", NULL);
+ g_type_ensure (E_TYPE_SOURCE_BACKEND_SUMMARY_SETUP);
+ setup = e_source_get_extension (source, E_SOURCE_EXTENSION_BACKEND_SUMMARY_SETUP);
+
/* The old BDB exists, lets migrate that to sqlite right away
*/
if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
- bf->priv->sqlitedb = e_book_backend_sqlitedb_new (
- dirname,
+ bf->priv->sqlitedb = e_book_backend_sqlitedb_new_full (
+ dirname,
SQLITEDB_EMAIL_ID,
SQLITEDB_FOLDER_ID,
SQLITEDB_FOLDER_NAME,
- TRUE,
+ TRUE, setup,
&local_error);
if (!bf->priv->sqlitedb) {
@@ -1280,7 +1285,7 @@ e_book_backend_file_open (EBookBackendSync *backend,
g_free (dirname);
g_free (filename);
g_free (backup);
-
+
g_object_unref (bf->priv->sqlitedb);
bf->priv->sqlitedb = NULL;
return;
@@ -1321,16 +1326,17 @@ e_book_backend_file_open (EBookBackendSync *backend,
g_free (dirname);
g_free (filename);
g_free (backup);
- return;
- }
+ return;
+ }
/* Create the sqlitedb */
- bf->priv->sqlitedb = e_book_backend_sqlitedb_new (
- dirname,
+ bf->priv->sqlitedb = e_book_backend_sqlitedb_new_full (
+ dirname,
SQLITEDB_EMAIL_ID,
SQLITEDB_FOLDER_ID,
SQLITEDB_FOLDER_NAME,
- TRUE, &local_error);
+ TRUE, setup,
+ &local_error);
if (!bf->priv->sqlitedb) {
g_warning (G_STRLOC ": Failed to open sqlitedb: %s", local_error->message);
@@ -1338,8 +1344,8 @@ e_book_backend_file_open (EBookBackendSync *backend,
g_free (dirname);
g_free (filename);
g_free (backup);
- return;
- }
+ return;
+ }
/* An sqlite DB only 'exists' if the populated flag is set */
populated = e_book_backend_sqlitedb_get_is_populated (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]