[evolution-data-server] Adapt ECalBackendContacts to libedata-cal changes.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Adapt ECalBackendContacts to libedata-cal changes.
- Date: Mon, 26 Sep 2011 13:47:55 +0000 (UTC)
commit 5a97046a6359cb826e977cbb050480f2392bc825
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Sep 9 13:24:50 2011 -0400
Adapt ECalBackendContacts to libedata-cal changes.
calendar/backends/contacts/Makefile.am | 1 -
.../contacts/e-cal-backend-contacts-factory.c | 59 +++++---------------
.../contacts/e-cal-backend-contacts-factory.h | 36 ------------
.../backends/contacts/e-cal-backend-contacts.c | 14 +++-
.../backends/contacts/e-cal-backend-contacts.h | 38 +++++++------
5 files changed, 45 insertions(+), 103 deletions(-)
---
diff --git a/calendar/backends/contacts/Makefile.am b/calendar/backends/contacts/Makefile.am
index f386ed7..12f3031 100644
--- a/calendar/backends/contacts/Makefile.am
+++ b/calendar/backends/contacts/Makefile.am
@@ -13,7 +13,6 @@ libecalbackendcontacts_la_CPPFLAGS = \
libecalbackendcontacts_la_SOURCES = \
e-cal-backend-contacts-factory.c \
- e-cal-backend-contacts-factory.h \
e-cal-backend-contacts.c \
e-cal-backend-contacts.h
diff --git a/calendar/backends/contacts/e-cal-backend-contacts-factory.c b/calendar/backends/contacts/e-cal-backend-contacts-factory.c
index 36e1920..c7b06e6 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts-factory.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts-factory.c
@@ -7,18 +7,20 @@
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-#include <string.h>
-
-#include "e-cal-backend-contacts-factory.h"
+#include <libedata-cal/e-cal-backend-factory.h>
#include "e-cal-backend-contacts.h"
+#define FACTORY_NAME "contacts"
+
typedef ECalBackendFactory ECalBackendContactsEventsFactory;
typedef ECalBackendFactoryClass ECalBackendContactsEventsFactoryClass;
+/* Module Entry Points */
+void e_module_load (GTypeModule *type_module);
+void e_module_unload (GTypeModule *type_module);
+
/* Forward Declarations */
GType e_cal_backend_contacts_events_factory_get_type (void);
@@ -27,34 +29,12 @@ G_DEFINE_DYNAMIC_TYPE (
e_cal_backend_contacts_events_factory,
E_TYPE_CAL_BACKEND_FACTORY)
-static const gchar *
-_get_protocol (ECalBackendFactory *factory)
-{
- return "contacts";
-}
-
-static ECalBackend *
-_events_new_backend (ECalBackendFactory *factory,
- ESource *source)
-{
- return g_object_new (
- e_cal_backend_contacts_get_type (),
- "kind", ICAL_VEVENT_COMPONENT,
- "source", source, NULL);
-}
-
-static icalcomponent_kind
-_events_get_kind (ECalBackendFactory *factory)
-{
- return ICAL_VEVENT_COMPONENT;
-}
-
static void
e_cal_backend_contacts_events_factory_class_init (ECalBackendFactoryClass *class)
{
- class->get_protocol = _get_protocol;
- class->get_kind = _events_get_kind;
- class->new_backend = _events_new_backend;
+ class->factory_name = FACTORY_NAME;
+ class->component_kind = ICAL_VEVENT_COMPONENT;
+ class->backend_type = E_TYPE_CAL_BACKEND_CONTACTS;
}
static void
@@ -67,25 +47,14 @@ e_cal_backend_contacts_events_factory_init (ECalBackendFactory *factory)
{
}
-void
-eds_module_initialize (GTypeModule *type_module)
+G_MODULE_EXPORT void
+e_module_load (GTypeModule *type_module)
{
e_cal_backend_contacts_events_factory_register_type (type_module);
}
-void
-eds_module_shutdown (void)
+G_MODULE_EXPORT void
+e_module_unload (GTypeModule *type_module)
{
}
-void
-eds_module_list_types (const GType **types,
- gint *num_types)
-{
- static GType contacts_types[1];
-
- contacts_types[0] = e_cal_backend_contacts_events_factory_get_type ();
-
- *types = contacts_types;
- *num_types = G_N_ELEMENTS (contacts_types);
-}
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.c b/calendar/backends/contacts/e-cal-backend-contacts.c
index 230c48c..9ac3781 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -987,10 +987,13 @@ e_cal_backend_contacts_send_objects (ECalBackendSync *backend,
/* Then the real implementations */
static void
-e_cal_backend_contacts_set_online (ECalBackend *backend,
- gboolean is_online)
+e_cal_backend_contacts_notify_online_cb (ECalBackend *backend,
+ gboolean is_online)
{
- e_cal_backend_notify_online (backend, is_online);
+ gboolean online;
+
+ online = e_backend_get_online (E_BACKEND (backend));
+ e_cal_backend_notify_online (backend, online);
e_cal_backend_notify_readonly (backend, TRUE);
}
@@ -1241,6 +1244,10 @@ e_cal_backend_contacts_init (ECalBackendContacts *cbc)
cbc->priv = priv;
e_cal_backend_sync_set_lock (E_CAL_BACKEND_SYNC (cbc), TRUE);
+
+ g_signal_connect (
+ cbc, "notify::online",
+ G_CALLBACK (e_cal_backend_contacts_notify_online_cb), NULL);
}
static void
@@ -1283,6 +1290,5 @@ e_cal_backend_contacts_class_init (ECalBackendContactsClass *class)
sync_class->get_free_busy_sync = e_cal_backend_contacts_get_free_busy;
backend_class->start_view = e_cal_backend_contacts_start_view;
- backend_class->set_online = e_cal_backend_contacts_set_online;
backend_class->internal_get_timezone = e_cal_backend_contacts_internal_get_timezone;
}
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.h b/calendar/backends/contacts/e-cal-backend-contacts.h
index de37279..38ed65d 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.h
+++ b/calendar/backends/contacts/e-cal-backend-contacts.h
@@ -25,27 +25,33 @@
#include <libedata-cal/e-cal-backend-sync.h>
-G_BEGIN_DECLS
-
-
+/* Standard GObject macros */
+#define E_TYPE_CAL_BACKEND_CONTACTS \
+ (e_cal_backend_contacts_get_type ())
+#define E_CAL_BACKEND_CONTACTS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_CAL_BACKEND_CONTACTS, ECalBackendContacts))
+#define E_CAL_BACKEND_CONTACTS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_CAL_BACKEND_CONTACTS, ECalBackendContactsClass))
+#define E_IS_CAL_BACKEND_CONTACTS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_CAL_BACKEND_CONTACTS))
+#define E_IS_CAL_BACKEND_CONTACTS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_CAL_BACKEND_CONTACTS))
+#define E_CAL_BACKEND_CONTACTS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_CAL_BACKEND_CONTACTS, ECalBackendContactsClass))
-#define E_TYPE_CAL_BACKEND_CONTACTS (e_cal_backend_contacts_get_type ())
-#define E_CAL_BACKEND_CONTACTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_BACKEND_CONTACTS, \
- ECalBackendContacts))
-#define E_CAL_BACKEND_CONTACTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_BACKEND_CONTACTS, \
- ECalBackendContactsClass))
-#define E_IS_CAL_BACKEND_CONTACTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_BACKEND_CONTACTS))
-#define E_IS_CAL_BACKEND_CONTACTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_BACKEND_CONTACTS))
+G_BEGIN_DECLS
typedef struct _ECalBackendContacts ECalBackendContacts;
typedef struct _ECalBackendContactsClass ECalBackendContactsClass;
-
typedef struct _ECalBackendContactsPrivate ECalBackendContactsPrivate;
struct _ECalBackendContacts {
ECalBackendSync backend;
-
- /* Private data */
ECalBackendContactsPrivate *priv;
};
@@ -53,10 +59,8 @@ struct _ECalBackendContactsClass {
ECalBackendSyncClass parent_class;
};
-GType e_cal_backend_contacts_get_type (void);
-
-
+GType e_cal_backend_contacts_get_type (void);
G_END_DECLS
-#endif
+#endif /* E_CAL_BACKEND_CONTACTS_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]