diff options
Diffstat (limited to 'plugins/new-mail-notify')
-rw-r--r-- | plugins/new-mail-notify/new-mail-notify.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/plugins/new-mail-notify/new-mail-notify.c b/plugins/new-mail-notify/new-mail-notify.c index 9960e40b11..139838b64a 100644 --- a/plugins/new-mail-notify/new-mail-notify.c +++ b/plugins/new-mail-notify/new-mail-notify.c @@ -49,18 +49,18 @@ static void send_dbus_message (const char *name, const char *data, guint new) { DBusMessage *message; - + /* Create a new message on the DBUS_INTERFACE */ if (!(message = dbus_message_new_signal (DBUS_PATH, DBUS_INTERFACE, name))) return; - + /* Appends the data as an argument to the message */ dbus_message_append_args (message, #if DBUS_VERSION >= 310 DBUS_TYPE_STRING, &data, #else DBUS_TYPE_STRING, data, -#endif +#endif DBUS_TYPE_INVALID); if (new) { @@ -70,14 +70,14 @@ send_dbus_message (const char *name, const char *data, guint new) DBUS_TYPE_STRING, &display_name, DBUS_TYPE_UINT32, &new, #else DBUS_TYPE_STRING, display_name, DBUS_TYPE_UINT32, new, -#endif +#endif DBUS_TYPE_INVALID); - + } /* Sends the message */ dbus_connection_send (bus, message, NULL); - + /* Frees the message */ dbus_message_unref (message); } @@ -102,9 +102,9 @@ reinit_dbus (gpointer user_data) { if (!enabled || init_dbus ()) return FALSE; - + /* keep trying to re-establish dbus connection */ - + return TRUE; } @@ -115,12 +115,12 @@ filter_function (DBusConnection *connection, DBusMessage *message, void *user_da strcmp (dbus_message_get_path (message), DBUS_PATH_LOCAL) == 0) { dbus_connection_unref (bus); bus = NULL; - + g_timeout_add (3000, reinit_dbus, NULL); - + return DBUS_HANDLER_RESULT_HANDLED; } - + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } @@ -128,22 +128,22 @@ static gboolean init_dbus (void) { DBusError error; - + if (bus != NULL) return TRUE; - + dbus_error_init (&error); if (!(bus = dbus_bus_get (DBUS_BUS_SESSION, &error))) { g_warning ("could not get system bus: %s\n", error.message); dbus_error_free (&error); return FALSE; } - + dbus_connection_setup_with_g_main (bus, NULL); dbus_connection_set_exit_on_disconnect (bus, FALSE); - + dbus_connection_add_filter (bus, filter_function, NULL, NULL); - + return TRUE; } @@ -154,17 +154,17 @@ e_plugin_lib_enable (EPluginLib *ep, int enable) if (enable) { if (!init_dbus ()) return -1; - + enabled = TRUE; } else { if (bus != NULL) { dbus_connection_unref (bus); bus = NULL; } - + enabled = FALSE; } - + return 0; } |