[evolution-kolab] Make sure E_TYPE_SOURCE_KOLAB_FOLDER is registered.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab] Make sure E_TYPE_SOURCE_KOLAB_FOLDER is registered.
- Date: Tue, 4 Sep 2012 13:36:23 +0000 (UTC)
commit 176d810808a74d093e9fc91ce57d3d2d6ea3bd35
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue Sep 4 09:22:15 2012 -0400
Make sure E_TYPE_SOURCE_KOLAB_FOLDER is registered.
GType needs to be registered ahead of time for ESource to pair
"[Kolab Folder]" from a key file with ESourceKolabFolderClass.
src/addressbook/e-book-backend-kolab.c | 10 ++++++++++
src/calendar/e-cal-backend-kolab.c | 9 +++++++++
src/collection/e-kolab-backend.c | 3 ++-
3 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-kolab.c b/src/addressbook/e-book-backend-kolab.c
index affaf49..76f3b89 100644
--- a/src/addressbook/e-book-backend-kolab.c
+++ b/src/addressbook/e-book-backend-kolab.c
@@ -50,6 +50,12 @@
#include "e-book-backend-kolab.h"
+/* This forces the GType to be registered in a way that
+ * avoids a "statement with no effect" compiler warning.
+ * FIXME Use g_type_ensure() once we require GLib 2.34. */
+#define REGISTER_TYPE(type) \
+ (g_type_class_unref (g_type_class_ref (type)))
+
/*----------------------------------------------------------------------------*/
/* table of KolabMailAccess objects */
@@ -1186,6 +1192,10 @@ e_book_backend_kolab_class_init (EBookBackendKolabClass *klass)
sync_class->get_contact_sync = book_backend_kolab_get_contact;
sync_class->get_contact_list_sync = book_backend_kolab_get_contact_list;
sync_class->get_contact_list_uids_sync = book_backend_kolab_get_contact_list_uids;
+
+ /* Register relevant ESourceExtension types. */
+ REGISTER_TYPE (E_TYPE_SOURCE_KOLAB_FOLDER);
+
} /* e_book_backend_kolab_class_init () */
diff --git a/src/calendar/e-cal-backend-kolab.c b/src/calendar/e-cal-backend-kolab.c
index d48be33..7198a44 100644
--- a/src/calendar/e-cal-backend-kolab.c
+++ b/src/calendar/e-cal-backend-kolab.c
@@ -52,6 +52,12 @@
#include "kolab-util-calendar-cache.h"
#include "e-cal-backend-kolab.h"
+/* This forces the GType to be registered in a way that
+ * avoids a "statement with no effect" compiler warning.
+ * FIXME Use g_type_ensure() once we require GLib 2.34. */
+#define REGISTER_TYPE(type) \
+ (g_type_class_unref (g_type_class_ref (type)))
+
/*----------------------------------------------------------------------------*/
/* table of KolabMailAccess objects */
@@ -2016,6 +2022,9 @@ e_cal_backend_kolab_class_init (ECalBackendKolabClass *klass)
sync_class->get_timezone_sync = cal_backend_kolab_get_timezone;
sync_class->add_timezone_sync = cal_backend_kolab_add_timezone;
+ /* Register relevant ESourceExtension types. */
+ REGISTER_TYPE (E_TYPE_SOURCE_KOLAB_FOLDER);
+
} /* e_cal_backend_kolab_class_init () */
diff --git a/src/collection/e-kolab-backend.c b/src/collection/e-kolab-backend.c
index 0c28a0a..03c38a5 100644
--- a/src/collection/e-kolab-backend.c
+++ b/src/collection/e-kolab-backend.c
@@ -26,7 +26,8 @@
((obj), E_TYPE_KOLAB_BACKEND, EKolabBackendPrivate))
/* This forces the GType to be registered in a way that
- * avoids a "statement with no effect" compiler warning. */
+ * avoids a "statement with no effect" compiler warning.
+ * FIXME Use g_type_ensure() once we require GLib 2.34. */
#define REGISTER_TYPE(type) \
(g_type_class_unref (g_type_class_ref (type)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]