soc.2010.detachablepurple: f5b068e4: Updated every old purple_core_get_remote...
gillux at soc.pidgin.im
gillux at soc.pidgin.im
Fri Jul 16 01:17:12 EDT 2010
----------------------------------------------------------------------
Revision: f5b068e4d8213c2bf3d41286aedb45081232ee65
Parent: c83d15980f3f412383ac2ff042aef839f8db4377
Author: gillux at soc.pidgin.im
Date: 07/15/10 22:45:09
Branch: im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/f5b068e4d8213c2bf3d41286aedb45081232ee65
Changelog:
Updated every old purple_core_get_remote_mode(), now replaced by the system
added in the previous commit.
Changes against parent c83d15980f3f412383ac2ff042aef839f8db4377
patched libpurple/account.c
patched libpurple/accountlist.c
patched libpurple/dbus-constructor.c
patched libpurple/dbus-maybe.h
patched libpurple/dbus-server.c
patched libpurple/example/remotenullclient.c
patched purpled/purpled.c
-------------- next part --------------
============================================================
--- libpurple/account.c f7bf70ea28bb9dc72244c69f387d76daf3c383b2
+++ libpurple/account.c 9887a4f105019fcf0a9a36dd2b9e660fd4f124c2
@@ -464,7 +464,7 @@ purple_account_set_property(GObject *obj
* happens when the properties flagged with G_PARAM_CONSTRUCT are
* initialized.
*/
- if (purple_core_get_remote_mode()) {
+ if (purple_core_is_remote_mode()) {
if(!purple_object_get_dbus_path(PURPLE_OBJECT(obj)))
return;
}
@@ -767,8 +767,9 @@ static void purple_account_class_init(Pu
#warning TODO: Setup more signals
#ifdef HAVE_DBUS
- /* Add dbus stuff (method introspection data) */
- if(!purple_core_get_remote_mode())
+ /* Add dbus stuff */
+ if (purple_core_is_daemon_mode()) {
+ /* Install method introspection data */
dbus_g_object_type_install_info(PURPLE_TYPE_ACCOUNT,
&dbus_glib_DBUS_purple_account_object_info);
#endif
@@ -828,7 +829,7 @@ purple_account_new(const char *username,
g_return_val_if_fail(protocol_id != NULL, NULL);
/* Handle remote mode case */
- if(purple_core_get_remote_mode())
+ if (purple_core_is_remote_mode())
return purple_account_new_RPC(username, protocol_id);
account = purple_accounts_find(username, protocol_id);
============================================================
--- libpurple/dbus-server.c 02b12fa3cac5a8e0299e29661e175a547e1bda62
+++ libpurple/dbus-server.c eae6d251ab48b63fdd7ffcff5ec88487b8410899
@@ -721,7 +721,7 @@ purple_dbus_g_init(void)
guint request_ret;
/* Export our objects only if we are in normal mode. */
- if (purple_core_get_remote_mode())
+ if (purple_core_is_remote_mode())
return;
/*
* Create a proxy for the purple service, so we can
============================================================
--- libpurple/dbus-maybe.h 1bca1b04f1d4bc39e6fed006980096a28eb48f41
+++ libpurple/dbus-maybe.h de46e30065f6f0b8106d53633cc351481b3a633b
@@ -18,7 +18,7 @@ G_STMT_START { \
#define PURPLE_DBUS_REGISTER_OBJECT(path, object) \
G_STMT_START { \
- if (!purple_core_get_remote_mode()) { \
+ if (purple_core_is_daemon_mode()) { \
dbus_g_connection_register_g_object(purple_dbus_get_g_connection(), \
path, G_OBJECT(object)); \
purple_object_set_dbus_path(PURPLE_OBJECT(object), path); \
@@ -35,7 +35,7 @@ G_STMT_START { \
#define PURPLE_DBUS_REMOTELY_SET_PROP(account, set_func, gtype, name, var) \
G_STMT_START { \
GValue prop = {0, }; \
- if (purple_core_get_remote_mode()) { \
+ if (purple_core_is_remote_mode()) { \
g_value_init(&prop, gtype); \
set_func(&prop, var); \
if (!purple_dbus_remotely_set_obj_prop(PURPLE_OBJECT(account), \
============================================================
--- libpurple/accountlist.c fd799035a5329260f5d02439505f49c5e4cf221f
+++ libpurple/accountlist.c e76447796cc3ab318cb53df9b79efba0d8cbd798
@@ -564,7 +564,7 @@ purple_accounts_load()
/* In remote mode, don't read the accounts locally,
* load them from the daemon instead.
*/
- if (purple_core_get_remote_mode())
+ if (purple_core_is_remote_mode())
return purple_accounts_get_all_RPC();
node = purple_util_read_xml_from_file("accounts.xml", _("accounts"));
============================================================
--- purpled/purpled.c 8a6c0aa008aead9a16daa869f78a52113113af3d
+++ purpled/purpled.c 244a29d7a54f3f7d15b69e82993fe19b6b015292
@@ -107,6 +107,9 @@ init_libpurple(void)
{
purple_eventloop_set_ui_ops(&glib_eventloops);
+ /* Activate daemon mode! */
+ purple_core_set_running_mode(PURPLE_RUN_DAEMON_MODE);
+
if (!purple_core_init(PURPLED_ID)) {
fprintf(stderr, "libpurple initialization failed.");
exit(1);
============================================================
--- libpurple/example/remotenullclient.c abe02d5e102138c6e488b4c2d89b206c828cacc9
+++ libpurple/example/remotenullclient.c f41b08532f7dd0b6419600dc4f2af1709dab4296
@@ -208,7 +208,7 @@ init_libpurple(void)
purple_plugins_add_search_path(CUSTOM_PLUGIN_PATH);
/* Activate remote mode! */
- purple_core_set_remote_mode(TRUE);
+ purple_core_set_running_mode(PURPLE_RUN_REMOTE_MODE);
/* Now that all the essential stuff has been set, let's try to init the core. It's
* necessary to provide a non-NULL name for the current ui to the core. This name
============================================================
--- libpurple/dbus-constructor.c b470c1c7a72fe0fc1ec7840f11001e2a17dd1642
+++ libpurple/dbus-constructor.c c8326d0818ef83e214e32edd2a7426e0b6adc0bc
@@ -303,6 +303,7 @@ load_accounts_cb(GValueArray* box)
char *protocol_id;
GPtrArray *prop_array;
GValue *username;
+ PurpleRunningMode mode;
/* Each account consists of a DBUS_STRUCT_ACCOUNT */
g_value_init(&val, DBUS_STRUCT_ACCOUNT);
@@ -318,14 +319,15 @@ load_accounts_cb(GValueArray* box)
return;
}
/* Temporarly go in normal mode, and it will create a local account */
- purple_core_set_remote_mode(FALSE);
+ mode = purple_core_get_running_mode();
+ purple_core_set_running_mode(PURPLE_RUN_NORMAL_MODE);
acc = purple_account_new(g_value_get_string(username), protocol_id);
/* Then load the others properties. Keep the normal mode here,
* otherwise it will try to remotely set the properties.
*/
g_ptr_array_foreach(prop_array, (GFunc)load_account_prop_cb, acc);
- purple_core_set_remote_mode(TRUE);
+ purple_core_set_running_mode(mode);
g_free(path_name);
g_free(protocol_id);
More information about the Commits
mailing list