Mercurial > pidgin
comparison libpurple/core.c @ 17714:9d5121f2ab5d
Minor formatting tweaks for the dbus_uniq code.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Wed, 16 May 2007 20:00:20 +0000 |
parents | 601594a64190 |
children | c0dd45834fd9 a217e9b9ebc2 |
comparison
equal
deleted
inserted
replaced
17710:601594a64190 | 17714:9d5121f2ab5d |
---|---|
300 dbus_error_free(&dbus_error); | 300 dbus_error_free(&dbus_error); |
301 | 301 |
302 if (reply) { | 302 if (reply) { |
303 dbus_error_init(&dbus_error); | 303 dbus_error_init(&dbus_error); |
304 dbus_message_get_args(reply, &dbus_error, DBUS_TYPE_STRING, &remote_user_dir, DBUS_TYPE_INVALID); | 304 dbus_message_get_args(reply, &dbus_error, DBUS_TYPE_STRING, &remote_user_dir, DBUS_TYPE_INVALID); |
305 if (remote_user_dir) | 305 remote_user_dir = g_strdup(remote_user_dir); |
306 remote_user_dir = g_strdup(remote_user_dir); | |
307 dbus_error_free(&dbus_error); | 306 dbus_error_free(&dbus_error); |
308 dbus_message_unref(reply); | 307 dbus_message_unref(reply); |
309 } | 308 } |
310 | 309 |
311 return remote_user_dir; | 310 return remote_user_dir; |
319 | 318 |
320 if ((dbus_connection = purple_dbus_get_connection()) == NULL) | 319 if ((dbus_connection = purple_dbus_get_connection()) == NULL) |
321 return; | 320 return; |
322 | 321 |
323 if ((msg = dbus_message_new_method_call(DBUS_SERVICE_PURPLE, DBUS_PATH_PURPLE, DBUS_INTERFACE_PURPLE, "PurpleBlistShow")) == NULL) | 322 if ((msg = dbus_message_new_method_call(DBUS_SERVICE_PURPLE, DBUS_PATH_PURPLE, DBUS_INTERFACE_PURPLE, "PurpleBlistShow")) == NULL) |
324 return ; | 323 return; |
325 | 324 |
326 dbus_error_init(&dbus_error); | 325 dbus_error_init(&dbus_error); |
327 if ((reply = dbus_connection_send_with_reply_and_block(dbus_connection, msg, 5000, &dbus_error)) != NULL) { | 326 if ((reply = dbus_connection_send_with_reply_and_block(dbus_connection, msg, 5000, &dbus_error)) != NULL) { |
328 dbus_message_unref(msg); | 327 dbus_message_unref(msg); |
329 } | 328 } |
331 } | 330 } |
332 #endif /* HAVE_DBUS */ | 331 #endif /* HAVE_DBUS */ |
333 | 332 |
334 gboolean purple_core_ensure_single_instance() | 333 gboolean purple_core_ensure_single_instance() |
335 { | 334 { |
336 gboolean is_single_instance = TRUE; | 335 gboolean is_single_instance = TRUE; |
336 | |
337 #ifdef HAVE_DBUS | 337 #ifdef HAVE_DBUS |
338 /* in the future, other mechanisms might have already set this to FALSE */ | 338 /* in the future, other mechanisms might have already set this to FALSE */ |
339 if (is_single_instance) { | 339 if (is_single_instance) { |
340 if (!purple_dbus_is_owner()) { | 340 if (!purple_dbus_is_owner()) { |
341 const char *user_dir = purple_user_dir(); | 341 const char *user_dir = purple_user_dir(); |
355 | 355 |
356 g_free(dbus_owner_user_dir); | 356 g_free(dbus_owner_user_dir); |
357 } | 357 } |
358 } | 358 } |
359 #endif /* HAVE_DBUS */ | 359 #endif /* HAVE_DBUS */ |
360 | |
360 return is_single_instance; | 361 return is_single_instance; |
361 } | 362 } |
362 | 363 |
363 static gboolean | 364 static gboolean |
364 move_and_symlink_dir(const char *path, const char *basename, const char *old_base, const char *new_base, const char *relative) | 365 move_and_symlink_dir(const char *path, const char *basename, const char *old_base, const char *new_base, const char *relative) |