Mercurial > pidgin
diff libpurple/dbus-server.c @ 17709:176d0fc8bc16
Alternative dbus_uniq implementation
| author | Gabriel Schulhof <nix@go-nix.ca> |
|---|---|
| date | Tue, 15 May 2007 20:41:36 +0000 |
| parents | 9f5c9df30287 |
| children | fbebe15c91a7 |
line wrap: on
line diff
--- a/libpurple/dbus-server.c Sun May 13 19:52:05 2007 +0000 +++ b/libpurple/dbus-server.c Tue May 15 20:41:36 2007 +0000 @@ -65,6 +65,12 @@ static GHashTable *map_id_type; static gchar *init_error; +static int dbus_request_name_reply = DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER; + +gboolean purple_dbus_is_owner(void) +{ + return(DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER == dbus_request_name_reply); +} /** * This function initializes the pointer-id traslation system. It @@ -592,6 +598,7 @@ return; } + dbus_request_name_reply = result = dbus_bus_request_name(purple_dbus_connection, DBUS_SERVICE_PURPLE, 0, &error); @@ -604,25 +611,6 @@ return; } - if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { - DBusMessage *msg = dbus_message_new_method_call(DBUS_SERVICE_PURPLE, DBUS_PATH_PURPLE, DBUS_INTERFACE_PURPLE, "PurpleBlistShow") ; - - if (NULL != msg) { - DBusMessage *reply = NULL ; - DBusError dbus_error ; - - dbus_error_init(&dbus_error) ; - reply = dbus_connection_send_with_reply_and_block(purple_dbus_connection, msg, 5000, &dbus_error) ; - dbus_message_unref(msg) ; - if (NULL != reply) - dbus_message_unref(reply) ; - dbus_error_free(&dbus_error) ; - } - - purple_core_quit() ; - _exit(0) ; - } - dbus_connection_setup_with_g_main(purple_dbus_connection, NULL); purple_debug_misc("dbus", "okkk\n");
