/*
- * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Claws Mail -- a GTK based, lightweight, and fast e-mail client
* Copyright (C) 1999-2011 Colin Leroy <colin@colino.net> and
* the Claws Mail team
*
#include "vcal_manager.h"
#include "vcal_folder.h"
-#if(GLIB_CHECK_VERSION(2,26,0))
-
static guint dbus_own_id;
static void add_event_to_builder_if_match(VCalEvent *event, GVariantBuilder *array,
}
-static const GDBusInterfaceVTable interface_vtable =
-{
- handle_method_call,
- NULL,
- NULL,
- {0,0,0,0,0,0,0,0}
-};
+static GDBusInterfaceVTable* interface_vtable = NULL;
static GDBusNodeInfo *introspection_data = NULL;
static GDBusInterfaceInfo *interface_info = NULL;
gpointer user_data)
{
GError *err = NULL;
+
+ cm_return_if_fail(interface_vtable);
+
g_dbus_connection_register_object(connection,
"/org/gnome/Shell/CalendarServer",
introspection_data->interfaces[0],
- &interface_vtable, NULL, NULL, &err);
+ (const GDBusInterfaceVTable *)interface_vtable, NULL, NULL, &err);
if (err != NULL)
debug_print("Error: %s\n", err->message);
}
void connect_dbus(void)
{
debug_print("connect_dbus() invoked\n");
+
+ interface_vtable = g_malloc0(sizeof(GDBusInterfaceVTable));
+ cm_return_if_fail(interface_vtable);
+ interface_vtable->method_call = (GDBusInterfaceMethodCallFunc)handle_method_call;
+
introspection_data = g_dbus_node_info_new_for_xml(
introspection_xml, NULL);
if (introspection_data == NULL) {
debug_print("Couldn't figure out XML.\n");
return;
}
-
+
interface_info = g_dbus_node_info_lookup_interface(
introspection_data,
"org.gnome.Shell.CalendarServer");
{
debug_print("disconnect_dbus() invoked\n");
g_bus_unown_name(dbus_own_id);
-}
-#else
-void connect_dbus(void)
-{
- debug_print("DBUS calendar export is not supported with Glib < 2.26\n");
+ g_free(interface_vtable);
+ interface_vtable = NULL;
}
-void disconnect_dbus(void)
-{
- debug_print("DBUS calendar export is not supported with Glib < 2.26\n");
-}
-#endif