aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-account-settings.c8
-rw-r--r--libempathy/empathy-chatroom-manager.c20
-rw-r--r--libempathy/empathy-connection-managers.c28
-rw-r--r--libempathy/empathy-contact-groups.c21
-rw-r--r--libempathy/empathy-dispatcher.c245
-rw-r--r--libempathy/empathy-irc-network-manager.c51
-rw-r--r--libempathy/empathy-log-store-empathy.c25
-rw-r--r--libempathy/empathy-status-presets.c20
-rw-r--r--libempathy/empathy-time.c8
-rw-r--r--libempathy/empathy-tp-contact-factory.c2
-rw-r--r--libempathy/empathy-tp-contact-list.c12
-rw-r--r--libempathy/empathy-utils.c14
12 files changed, 234 insertions, 220 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index 5069691a2..0acc8006f 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -320,7 +320,7 @@ empathy_account_settings_free_unset_parameters (
EmpathyAccountSettings *settings)
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
- int i;
+ guint i;
for (i = 0 ; i < priv->unset_parameters->len; i++)
g_free (g_array_index (priv->unset_parameters, gchar *, i));
@@ -520,7 +520,7 @@ empathy_account_settings_is_unset (EmpathyAccountSettings *settings,
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
GArray *a;
- int i;
+ guint i;
a = priv->unset_parameters;
@@ -557,7 +557,7 @@ account_settings_remove_from_unset (EmpathyAccountSettings *settings,
const gchar *param)
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
- int idx;
+ guint idx;
gchar *val;
for (idx = 0; idx < priv->unset_parameters->len; idx++)
@@ -1240,7 +1240,7 @@ gboolean
empathy_account_settings_is_valid (EmpathyAccountSettings *settings)
{
EmpathyAccountSettingsPriv *priv;
- int idx;
+ guint idx;
gchar *current;
gboolean missed = FALSE;
diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c
index 7d80b9441..b8c721bcb 100644
--- a/libempathy/empathy-chatroom-manager.c
+++ b/libempathy/empathy-chatroom-manager.c
@@ -90,8 +90,8 @@ chatroom_manager_file_save (EmpathyChatroomManager *manager)
priv = GET_PRIV (manager);
- doc = xmlNewDoc ("1.0");
- root = xmlNewNode (NULL, "chatrooms");
+ doc = xmlNewDoc ((const xmlChar *) "1.0");
+ root = xmlNewNode (NULL, (const xmlChar *) "chatrooms");
xmlDocSetRootElement (doc, root);
for (l = priv->chatrooms; l; l = l->next) {
@@ -108,12 +108,16 @@ chatroom_manager_file_save (EmpathyChatroomManager *manager)
account_id = empathy_account_get_unique_name (
empathy_chatroom_get_account (chatroom));
- node = xmlNewChild (root, NULL, "chatroom", NULL);
- xmlNewTextChild (node, NULL, "name", empathy_chatroom_get_name (chatroom));
- xmlNewTextChild (node, NULL, "room", empathy_chatroom_get_room (chatroom));
- xmlNewTextChild (node, NULL, "account", account_id);
- xmlNewTextChild (node, NULL, "auto_connect",
- empathy_chatroom_get_auto_connect (chatroom) ? "yes" : "no");
+ node = xmlNewChild (root, NULL, (const xmlChar *) "chatroom", NULL);
+ xmlNewTextChild (node, NULL, (const xmlChar *) "name",
+ (const xmlChar *) empathy_chatroom_get_name (chatroom));
+ xmlNewTextChild (node, NULL, (const xmlChar *) "room",
+ (const xmlChar *) empathy_chatroom_get_name (chatroom));
+ xmlNewTextChild (node, NULL, (const xmlChar *) "account",
+ (const xmlChar *) account_id);
+ xmlNewTextChild (node, NULL, (const xmlChar *) "auto_connect",
+ empathy_chatroom_get_auto_connect (chatroom) ?
+ (const xmlChar *) "yes" : (const xmlChar *) "no");
}
/* Make sure the XML is indented properly */
diff --git a/libempathy/empathy-connection-managers.c b/libempathy/empathy-connection-managers.c
index bd6f315e2..5d381075e 100644
--- a/libempathy/empathy-connection-managers.c
+++ b/libempathy/empathy-connection-managers.c
@@ -111,8 +111,8 @@ empathy_connection_managers_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- EmpathyConnectionManagers *managers = EMPATHY_CONNECTION_MANAGERS (object);
- EmpathyConnectionManagersPriv *priv = GET_PRIV (managers);
+ EmpathyConnectionManagers *self = EMPATHY_CONNECTION_MANAGERS (object);
+ EmpathyConnectionManagersPriv *priv = GET_PRIV (self);
switch (prop_id)
{
@@ -200,9 +200,9 @@ empathy_connection_managers_dup_singleton (void)
}
gboolean
-empathy_connection_managers_is_ready (EmpathyConnectionManagers *managers)
+empathy_connection_managers_is_ready (EmpathyConnectionManagers *self)
{
- EmpathyConnectionManagersPriv *priv = GET_PRIV (managers);
+ EmpathyConnectionManagersPriv *priv = GET_PRIV (self);
return priv->ready;
}
@@ -245,28 +245,28 @@ out:
}
void
-empathy_connection_managers_update (EmpathyConnectionManagers *managers)
+empathy_connection_managers_update (EmpathyConnectionManagers *self)
{
- EmpathyConnectionManagersPriv *priv = GET_PRIV (managers);
+ EmpathyConnectionManagersPriv *priv = GET_PRIV (self);
tp_list_connection_managers (priv->dbus,
empathy_connection_managers_listed_cb,
- NULL, NULL, G_OBJECT (managers));
+ NULL, NULL, G_OBJECT (self));
}
GList *
-empathy_connection_managers_get_cms (EmpathyConnectionManagers *managers)
+empathy_connection_managers_get_cms (EmpathyConnectionManagers *self)
{
- EmpathyConnectionManagersPriv *priv = GET_PRIV (managers);
+ EmpathyConnectionManagersPriv *priv = GET_PRIV (self);
return priv->cms;
}
TpConnectionManager *
-empathy_connection_managers_get_cm (EmpathyConnectionManagers *managers,
+empathy_connection_managers_get_cm (EmpathyConnectionManagers *self,
const gchar *cm)
{
- EmpathyConnectionManagersPriv *priv = GET_PRIV (managers);
+ EmpathyConnectionManagersPriv *priv = GET_PRIV (self);
GList *l;
for (l = priv->cms ; l != NULL; l = g_list_next (l))
@@ -281,13 +281,13 @@ empathy_connection_managers_get_cm (EmpathyConnectionManagers *managers,
}
guint
-empathy_connection_managers_get_cms_num (EmpathyConnectionManagers *managers)
+empathy_connection_managers_get_cms_num (EmpathyConnectionManagers *self)
{
EmpathyConnectionManagersPriv *priv;
- g_return_val_if_fail (EMPATHY_IS_CONNECTION_MANAGERS (managers), 0);
+ g_return_val_if_fail (EMPATHY_IS_CONNECTION_MANAGERS (self), 0);
- priv = GET_PRIV (managers);
+ priv = GET_PRIV (self);
return g_list_length (priv->cms);
}
diff --git a/libempathy/empathy-contact-groups.c b/libempathy/empathy-contact-groups.c
index 22d81d051..7244c1622 100644
--- a/libempathy/empathy-contact-groups.c
+++ b/libempathy/empathy-contact-groups.c
@@ -131,8 +131,8 @@ contact_groups_file_parse (const gchar *filename)
gboolean expanded;
ContactGroup *contact_group;
- name = (gchar *) xmlGetProp (node, "name");
- expanded_str = (gchar *) xmlGetProp (node, "expanded");
+ name = (gchar *) xmlGetProp (node, (const xmlChar *) "name");
+ expanded_str = (gchar *) xmlGetProp (node, (const xmlChar *) "expanded");
if (expanded_str && strcmp (expanded_str, "yes") == 0) {
expanded = TRUE;
@@ -195,12 +195,12 @@ contact_groups_file_save (void)
file = g_build_filename (dir, CONTACT_GROUPS_XML_FILENAME, NULL);
g_free (dir);
- doc = xmlNewDoc ("1.0");
- root = xmlNewNode (NULL, "contacts");
+ doc = xmlNewDoc ((const xmlChar *) "1.0");
+ root = xmlNewNode (NULL, (const xmlChar *) "contacts");
xmlDocSetRootElement (doc, root);
- node = xmlNewChild (root, NULL, "account", NULL);
- xmlNewProp (node, "name", "Default");
+ node = xmlNewChild (root, NULL, (const xmlChar *) "account", NULL);
+ xmlNewProp (node, (const xmlChar *) "name", (const xmlChar *) "Default");
for (l = groups; l; l = l->next) {
ContactGroup *cg;
@@ -208,9 +208,10 @@ contact_groups_file_save (void)
cg = l->data;
- subnode = xmlNewChild (node, NULL, "group", NULL);
- xmlNewProp (subnode, "expanded", cg->expanded ? "yes" : "no");
- xmlNewProp (subnode, "name", cg->name);
+ subnode = xmlNewChild (node, NULL, (const xmlChar *) "group", NULL);
+ xmlNewProp (subnode, (const xmlChar *) "expanded", cg->expanded ?
+ (const xmlChar *) "yes" : (const xmlChar *) "no");
+ xmlNewProp (subnode, (const xmlChar *) "name", (const xmlChar *) cg->name);
}
/* Make sure the XML is indented properly */
@@ -262,7 +263,7 @@ empathy_contact_group_set_expanded (const gchar *group,
g_return_if_fail (group != NULL);
for (l = groups; l; l = l->next) {
- ContactGroup *cg = l->data;
+ cg = l->data;
if (!cg || !cg->name) {
continue;
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 1cb418977..d4c2908e8 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -209,7 +209,7 @@ free_dispatch_data (DispatchData *data)
}
static DispatcherRequestData *
-new_dispatcher_request_data (EmpathyDispatcher *dispatcher,
+new_dispatcher_request_data (EmpathyDispatcher *self,
TpConnection *connection,
const gchar *channel_type,
guint handle_type,
@@ -221,7 +221,7 @@ new_dispatcher_request_data (EmpathyDispatcher *dispatcher,
{
DispatcherRequestData *result = g_slice_new0 (DispatcherRequestData);
- result->dispatcher = g_object_ref (dispatcher);
+ result->dispatcher = g_object_ref (self);
result->connection = connection;
result->should_ensure = FALSE;
@@ -281,10 +281,10 @@ static void
free_connection_data (ConnectionData *cd)
{
GList *l;
+ guint i;
g_hash_table_destroy (cd->dispatched_channels);
g_hash_table_destroy (cd->dispatching_channels);
- int i;
for (l = cd->outstanding_requests ; l != NULL; l = g_list_delete_link (l,l))
{
@@ -303,7 +303,7 @@ free_connection_data (ConnectionData *cd)
static void
free_find_channel_request (FindChannelRequest *r)
{
- int idx;
+ guint idx;
char *str;
g_object_unref (r->dispatcher);
@@ -328,9 +328,9 @@ dispatcher_connection_invalidated_cb (TpConnection *connection,
guint domain,
gint code,
gchar *message,
- EmpathyDispatcher *dispatcher)
+ EmpathyDispatcher *self)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
DEBUG ("Error: %s", message);
g_hash_table_remove (priv->connections, connection);
@@ -359,7 +359,7 @@ dispatcher_operation_can_start (EmpathyDispatcher *self,
}
static void
-dispatch_operation_flush_requests (EmpathyDispatcher *dispatcher,
+dispatch_operation_flush_requests (EmpathyDispatcher *self,
EmpathyDispatchOperation *operation,
GError *error,
ConnectionData *cd)
@@ -397,10 +397,10 @@ dispatcher_channel_invalidated_cb (TpProxy *proxy,
guint domain,
gint code,
gchar *message,
- EmpathyDispatcher *dispatcher)
+ EmpathyDispatcher *self)
{
/* Channel went away... */
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
TpConnection *connection;
EmpathyDispatchOperation *operation;
ConnectionData *cd;
@@ -426,7 +426,7 @@ dispatcher_channel_invalidated_cb (TpProxy *proxy,
if (operation != NULL)
{
GError error = { domain, code, message };
- dispatch_operation_flush_requests (dispatcher, operation, &error, cd);
+ dispatch_operation_flush_requests (self, operation, &error, cd);
g_hash_table_remove (cd->outstanding_channels, object_path);
g_object_unref (operation);
}
@@ -434,21 +434,21 @@ dispatcher_channel_invalidated_cb (TpProxy *proxy,
static void
dispatch_operation_approved_cb (EmpathyDispatchOperation *operation,
- EmpathyDispatcher *dispatcher)
+ EmpathyDispatcher *self)
{
g_assert (empathy_dispatch_operation_is_incoming (operation));
DEBUG ("Send of for dispatching: %s",
empathy_dispatch_operation_get_object_path (operation));
- g_signal_emit (dispatcher, signals[DISPATCH], 0, operation);
+ g_signal_emit (self, signals[DISPATCH], 0, operation);
}
static void
dispatch_operation_claimed_cb (EmpathyDispatchOperation *operation,
- EmpathyDispatcher *dispatcher)
+ EmpathyDispatcher *self)
{
/* Our job is done, remove the dispatch operation and mark the channel as
* dispatched */
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
TpConnection *connection;
ConnectionData *cd;
const gchar *object_path;
@@ -475,23 +475,23 @@ dispatch_operation_claimed_cb (EmpathyDispatchOperation *operation,
static void
dispatch_operation_ready_cb (EmpathyDispatchOperation *operation,
- EmpathyDispatcher *dispatcher)
+ EmpathyDispatcher *self)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
TpConnection *connection;
ConnectionData *cd;
EmpathyDispatchOperationState status;
g_signal_connect (operation, "approved",
- G_CALLBACK (dispatch_operation_approved_cb), dispatcher);
+ G_CALLBACK (dispatch_operation_approved_cb), self);
g_signal_connect (operation, "claimed",
- G_CALLBACK (dispatch_operation_claimed_cb), dispatcher);
+ G_CALLBACK (dispatch_operation_claimed_cb), self);
/* Signal the observers */
DEBUG ("Send to observers: %s",
empathy_dispatch_operation_get_object_path (operation));
- g_signal_emit (dispatcher, signals[OBSERVE], 0, operation);
+ g_signal_emit (self, signals[OBSERVE], 0, operation);
empathy_dispatch_operation_start (operation);
@@ -501,9 +501,9 @@ dispatch_operation_ready_cb (EmpathyDispatchOperation *operation,
g_assert (cd != NULL);
g_object_ref (operation);
- g_object_ref (dispatcher);
+ g_object_ref (self);
- dispatch_operation_flush_requests (dispatcher, operation, NULL, cd);
+ dispatch_operation_flush_requests (self, operation, NULL, cd);
status = empathy_dispatch_operation_get_status (operation);
g_object_unref (operation);
@@ -514,17 +514,17 @@ dispatch_operation_ready_cb (EmpathyDispatchOperation *operation,
{
DEBUG ("Send to approvers: %s",
empathy_dispatch_operation_get_object_path (operation));
- g_signal_emit (dispatcher, signals[APPROVE], 0, operation);
+ g_signal_emit (self, signals[APPROVE], 0, operation);
}
else
{
g_assert (status == EMPATHY_DISPATCHER_OPERATION_STATE_DISPATCHING);
DEBUG ("Send of for dispatching: %s",
empathy_dispatch_operation_get_object_path (operation));
- g_signal_emit (dispatcher, signals[DISPATCH], 0, operation);
+ g_signal_emit (self, signals[DISPATCH], 0, operation);
}
- g_object_unref (dispatcher);
+ g_object_unref (self);
}
static void
@@ -549,10 +549,10 @@ dispatcher_start_dispatching (EmpathyDispatcher *self,
{
case EMPATHY_DISPATCHER_OPERATION_STATE_PREPARING:
g_signal_connect (operation, "ready",
- G_CALLBACK (dispatch_operation_ready_cb), dispatcher);
+ G_CALLBACK (dispatch_operation_ready_cb), self);
break;
case EMPATHY_DISPATCHER_OPERATION_STATE_PENDING:
- dispatch_operation_ready_cb (operation, dispatcher);
+ dispatch_operation_ready_cb (operation, self);
break;
default:
g_assert_not_reached ();
@@ -584,13 +584,13 @@ dispatcher_flush_outstanding_operations (EmpathyDispatcher *self,
if (dispatcher_operation_can_start (self, operation, cd))
{
g_hash_table_iter_remove (&iter);
- dispatcher_start_dispatching (dispatcher, operation, cd);
+ dispatcher_start_dispatching (self, operation, cd);
}
}
}
static void
-dispatcher_connection_new_channel (EmpathyDispatcher *dispatcher,
+dispatcher_connection_new_channel (EmpathyDispatcher *self,
TpConnection *connection,
const gchar *object_path,
const gchar *channel_type,
@@ -599,7 +599,7 @@ dispatcher_connection_new_channel (EmpathyDispatcher *dispatcher,
GHashTable *properties,
gboolean incoming)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
TpChannel *channel;
ConnectionData *cd;
EmpathyDispatchOperation *operation;
@@ -614,7 +614,7 @@ dispatcher_connection_new_channel (EmpathyDispatcher *dispatcher,
NULL
};
- dispatcher_init_connection_if_needed (dispatcher, connection);
+ dispatcher_init_connection_if_needed (self, connection);
cd = g_hash_table_lookup (priv->connections, connection);
@@ -664,7 +664,7 @@ dispatcher_connection_new_channel (EmpathyDispatcher *dispatcher,
g_signal_connect (channel, "invalidated",
G_CALLBACK (dispatcher_channel_invalidated_cb),
- dispatcher);
+ self);
priv->channels = g_list_prepend (priv->channels, channel);
@@ -678,21 +678,21 @@ dispatcher_connection_new_channel (EmpathyDispatcher *dispatcher,
/* Request could either be by us or by a remote party. If there are no
* outstanding requests for this channel type we can assume it's remote.
* Otherwise we wait untill they are all satisfied */
- if (dispatcher_operation_can_start (dispatcher, operation, cd))
- dispatcher_start_dispatching (dispatcher, operation, cd);
+ if (dispatcher_operation_can_start (self, operation, cd))
+ dispatcher_start_dispatching (self, operation, cd);
else
g_hash_table_insert (cd->outstanding_channels,
g_strdup (object_path), operation);
}
else
{
- dispatcher_start_dispatching (dispatcher, operation, cd);
+ dispatcher_start_dispatching (self, operation, cd);
}
}
static void
dispatcher_connection_new_channel_with_properties (
- EmpathyDispatcher *dispatcher,
+ EmpathyDispatcher *self,
TpConnection *connection,
const gchar *object_path,
GHashTable *properties)
@@ -738,7 +738,7 @@ dispatcher_connection_new_channel_with_properties (
requested = FALSE;
}
- dispatcher_connection_new_channel (dispatcher, connection,
+ dispatcher_connection_new_channel (self, connection,
object_path, channel_type, handle_type, handle, properties, !requested);
}
@@ -749,8 +749,8 @@ dispatcher_connection_got_all (TpProxy *proxy,
gpointer user_data,
GObject *object)
{
- EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (object);
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcher *self = EMPATHY_DISPATCHER (object);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
GPtrArray *requestable_channels;
GPtrArray *existing_channels;
@@ -784,7 +784,7 @@ dispatcher_connection_got_all (TpProxy *proxy,
{
request = l->data;
- retval = empathy_dispatcher_find_channel_classes (dispatcher,
+ retval = empathy_dispatcher_find_channel_classes (self,
TP_CONNECTION (proxy), request->channel_type,
request->handle_type, request->properties);
request->callback (retval, request->user_data);
@@ -803,24 +803,24 @@ dispatcher_connection_got_all (TpProxy *proxy,
if (existing_channels != NULL)
{
- int idx;
+ guint idx;
for (idx = 0; idx < existing_channels->len; idx++)
{
GValueArray *values = g_ptr_array_index (existing_channels, idx);
const gchar *object_path;
- GHashTable *properties;
+ GHashTable *props;
object_path = g_value_get_boxed (g_value_array_get_nth (values, 0));
- properties = g_value_get_boxed (g_value_array_get_nth (values, 1));
+ props = g_value_get_boxed (g_value_array_get_nth (values, 1));
- if (tp_strdiff (tp_asv_get_string (properties,
+ if (tp_strdiff (tp_asv_get_string (props,
TP_IFACE_CHANNEL ".ChannelType"),
TP_IFACE_CHANNEL_TYPE_TEXT))
continue;
- dispatcher_connection_new_channel_with_properties (dispatcher,
- TP_CONNECTION (proxy), object_path, properties);
+ dispatcher_connection_new_channel_with_properties (self,
+ TP_CONNECTION (proxy), object_path, props);
}
}
}
@@ -830,21 +830,21 @@ dispatcher_connection_advertise_capabilities_cb (TpConnection *connection,
const GPtrArray *capabilities,
const GError *error,
gpointer user_data,
- GObject *dispatcher)
+ GObject *self)
{
if (error)
DEBUG ("Error: %s", error->message);
}
static void
-dispatcher_init_connection_if_needed (EmpathyDispatcher *dispatcher,
+dispatcher_init_connection_if_needed (EmpathyDispatcher *self,
TpConnection *connection)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
GPtrArray *capabilities;
GType cap_type;
GValue cap = {0, };
- const gchar *remove = NULL;
+ const gchar *remove_ = NULL;
if (g_hash_table_lookup (priv->connections, connection) != NULL)
return;
@@ -853,7 +853,7 @@ dispatcher_init_connection_if_needed (EmpathyDispatcher *dispatcher,
new_connection_data ());
g_signal_connect (connection, "invalidated",
- G_CALLBACK (dispatcher_connection_invalidated_cb), dispatcher);
+ G_CALLBACK (dispatcher_connection_invalidated_cb), self);
if (tp_proxy_has_interface_by_id (TP_PROXY (connection),
TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS))
@@ -861,7 +861,7 @@ dispatcher_init_connection_if_needed (EmpathyDispatcher *dispatcher,
tp_cli_dbus_properties_call_get_all (connection, -1,
TP_IFACE_CONNECTION_INTERFACE_REQUESTS,
dispatcher_connection_got_all,
- NULL, NULL, G_OBJECT (dispatcher));
+ NULL, NULL, G_OBJECT (self));
}
/* Advertise VoIP capabilities */
@@ -881,9 +881,9 @@ dispatcher_init_connection_if_needed (EmpathyDispatcher *dispatcher,
g_ptr_array_add (capabilities, g_value_get_boxed (&cap));
tp_cli_connection_interface_capabilities_call_advertise_capabilities (
- connection, -1, capabilities, &remove,
+ connection, -1, capabilities, &remove_,
dispatcher_connection_advertise_capabilities_cb,
- NULL, NULL, G_OBJECT (dispatcher));
+ NULL, NULL, G_OBJECT (self));
g_value_unset (&cap);
g_ptr_array_free (capabilities, TRUE);
@@ -892,9 +892,9 @@ dispatcher_init_connection_if_needed (EmpathyDispatcher *dispatcher,
static void
dispatcher_new_connection_cb (EmpathyAccountManager *manager,
TpConnection *connection,
- EmpathyDispatcher *dispatcher)
+ EmpathyDispatcher *self)
{
- dispatcher_init_connection_if_needed (dispatcher, connection);
+ dispatcher_init_connection_if_needed (self, connection);
}
static void
@@ -1022,8 +1022,8 @@ dispatcher_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (object);
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcher *self = EMPATHY_DISPATCHER (object);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
switch (property_id)
{
@@ -1042,8 +1042,8 @@ dispatcher_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (object);
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcher *self = EMPATHY_DISPATCHER (object);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
switch (property_id)
{
@@ -1111,18 +1111,18 @@ empathy_dispatcher_class_init (EmpathyDispatcherClass *klass)
}
static void
-empathy_dispatcher_init (EmpathyDispatcher *dispatcher)
+empathy_dispatcher_init (EmpathyDispatcher *self)
{
GList *connections, *l;
- EmpathyDispatcherPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (dispatcher,
+ EmpathyDispatcherPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EMPATHY_TYPE_DISPATCHER, EmpathyDispatcherPriv);
- dispatcher->priv = priv;
+ self->priv = priv;
priv->account_manager = empathy_account_manager_dup_singleton ();
g_signal_connect (priv->account_manager, "new-connection",
G_CALLBACK (dispatcher_new_connection_cb),
- dispatcher);
+ self);
priv->connections = g_hash_table_new_full (g_direct_hash, g_direct_equal,
g_object_unref, (GDestroyNotify) free_connection_data);
@@ -1137,7 +1137,7 @@ empathy_dispatcher_init (EmpathyDispatcher *dispatcher)
for (l = connections; l; l = l->next)
{
dispatcher_new_connection_cb (priv->account_manager, l->data,
- dispatcher);
+ self);
g_object_unref (l->data);
}
g_list_free (connections);
@@ -1151,10 +1151,10 @@ empathy_dispatcher_new (const gchar *name,
GPtrArray *filters,
GStrv capabilities)
{
- g_assert (dispatcher == NULL);
EmpathyHandler *handler;
EmpathyDispatcher *ret;
+ g_assert (dispatcher == NULL);
handler = empathy_handler_new (name, filters, capabilities);
ret = EMPATHY_DISPATCHER (
@@ -1173,11 +1173,11 @@ empathy_dispatcher_dup_singleton (void)
}
static void
-dispatcher_request_failed (EmpathyDispatcher *dispatcher,
+dispatcher_request_failed (EmpathyDispatcher *self,
DispatcherRequestData *request_data,
const GError *error)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
ConnectionData *conn_data;
conn_data = g_hash_table_lookup (priv->connections,
@@ -1196,13 +1196,13 @@ dispatcher_request_failed (EmpathyDispatcher *dispatcher,
}
static void
-dispatcher_connection_new_requested_channel (EmpathyDispatcher *dispatcher,
+dispatcher_connection_new_requested_channel (EmpathyDispatcher *self,
DispatcherRequestData *request_data,
const gchar *object_path,
GHashTable *properties,
const GError *error)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
EmpathyDispatchOperation *operation = NULL;
ConnectionData *conn_data;
@@ -1213,7 +1213,7 @@ dispatcher_connection_new_requested_channel (EmpathyDispatcher *dispatcher,
{
DEBUG ("Channel request failed: %s", error->message);
- dispatcher_request_failed (dispatcher, request_data, error);
+ dispatcher_request_failed (self, request_data, error);
goto out;
}
@@ -1300,12 +1300,12 @@ dispatcher_request_channel_cb (TpConnection *connection,
GObject *weak_object)
{
DispatcherRequestData *request_data = (DispatcherRequestData *) user_data;
- EmpathyDispatcher *dispatcher =
+ EmpathyDispatcher *self =
EMPATHY_DISPATCHER (request_data->dispatcher);
request_data->pending_call = NULL;
- dispatcher_connection_new_requested_channel (dispatcher,
+ dispatcher_connection_new_requested_channel (self,
request_data, object_path, NULL, error);
}
@@ -1348,7 +1348,7 @@ empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
EmpathyDispatcherRequestCb *callback,
gpointer user_data)
{
- EmpathyDispatcher *dispatcher;
+ EmpathyDispatcher *self;
EmpathyDispatcherPriv *priv;
TpConnection *connection;
ConnectionData *connection_data;
@@ -1356,14 +1356,14 @@ empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
g_return_if_fail (EMPATHY_IS_CONTACT (contact));
- dispatcher = empathy_dispatcher_dup_singleton ();
- priv = GET_PRIV (dispatcher);
+ self = empathy_dispatcher_dup_singleton ();
+ priv = GET_PRIV (self);
connection = empathy_contact_get_connection (contact);
connection_data = g_hash_table_lookup (priv->connections, connection);
/* The contact handle might not be known yet */
- request_data = new_dispatcher_request_data (dispatcher, connection,
+ request_data = new_dispatcher_request_data (self, connection,
TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT,
empathy_contact_get_handle (contact), NULL, contact, callback, user_data);
request_data->should_ensure = TRUE;
@@ -1373,7 +1373,7 @@ empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
dispatcher_request_channel (request_data);
- g_object_unref (dispatcher);
+ g_object_unref (self);
}
typedef struct
@@ -1413,17 +1413,17 @@ empathy_dispatcher_chat_with_contact_id (TpConnection *connection,
EmpathyDispatcherRequestCb *callback,
gpointer user_data)
{
- EmpathyDispatcher *dispatcher;
+ EmpathyDispatcher *self;
EmpathyTpContactFactory *factory;
ChatWithContactIdData *data;
g_return_if_fail (TP_IS_CONNECTION (connection));
g_return_if_fail (!EMP_STR_EMPTY (contact_id));
- dispatcher = empathy_dispatcher_dup_singleton ();
+ self = empathy_dispatcher_dup_singleton ();
factory = empathy_tp_contact_factory_dup_singleton (connection);
data = g_slice_new0 (ChatWithContactIdData);
- data->dispatcher = dispatcher;
+ data->dispatcher = self;
data->callback = callback;
data->user_data = user_data;
empathy_tp_contact_factory_get_from_id (factory, contact_id,
@@ -1445,8 +1445,8 @@ dispatcher_request_handles_cb (TpConnection *connection,
if (error != NULL)
{
- EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (object);
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcher *self = EMPATHY_DISPATCHER (object);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
ConnectionData *cd;
cd = g_hash_table_lookup (priv->connections, request_data->connection);
@@ -1459,7 +1459,7 @@ dispatcher_request_handles_cb (TpConnection *connection,
free_dispatcher_request_data (request_data);
- dispatcher_flush_outstanding_operations (dispatcher, cd);
+ dispatcher_flush_outstanding_operations (self, cd);
return;
}
@@ -1473,7 +1473,7 @@ empathy_dispatcher_join_muc (TpConnection *connection,
EmpathyDispatcherRequestCb *callback,
gpointer user_data)
{
- EmpathyDispatcher *dispatcher;
+ EmpathyDispatcher *self;
EmpathyDispatcherPriv *priv;
DispatcherRequestData *request_data;
ConnectionData *connection_data;
@@ -1482,13 +1482,13 @@ empathy_dispatcher_join_muc (TpConnection *connection,
g_return_if_fail (TP_IS_CONNECTION (connection));
g_return_if_fail (!EMP_STR_EMPTY (roomname));
- dispatcher = empathy_dispatcher_dup_singleton ();
- priv = GET_PRIV (dispatcher);
+ self = empathy_dispatcher_dup_singleton ();
+ priv = GET_PRIV (self);
connection_data = g_hash_table_lookup (priv->connections, connection);
/* Don't know the room handle yet */
- request_data = new_dispatcher_request_data (dispatcher, connection,
+ request_data = new_dispatcher_request_data (self, connection,
TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_ROOM, 0, NULL,
NULL, callback, user_data);
@@ -1500,7 +1500,7 @@ empathy_dispatcher_join_muc (TpConnection *connection,
TP_HANDLE_TYPE_ROOM, names,
dispatcher_request_handles_cb, request_data, NULL, NULL);
- g_object_unref (dispatcher);
+ g_object_unref (self);
}
static void
@@ -1512,12 +1512,12 @@ dispatcher_create_channel_cb (TpConnection *connect,
GObject *weak_object)
{
DispatcherRequestData *request_data = (DispatcherRequestData *) user_data;
- EmpathyDispatcher *dispatcher =
+ EmpathyDispatcher *self =
EMPATHY_DISPATCHER (request_data->dispatcher);
request_data->pending_call = NULL;
- dispatcher_connection_new_requested_channel (dispatcher,
+ dispatcher_connection_new_requested_channel (self,
request_data, object_path, properties, error);
}
@@ -1531,18 +1531,18 @@ dispatcher_ensure_channel_cb (TpConnection *connect,
GObject *weak_object)
{
DispatcherRequestData *request_data = (DispatcherRequestData *) user_data;
- EmpathyDispatcher *dispatcher =
+ EmpathyDispatcher *self =
EMPATHY_DISPATCHER (request_data->dispatcher);
request_data->pending_call = NULL;
- dispatcher_connection_new_requested_channel (dispatcher,
+ dispatcher_connection_new_requested_channel (self,
request_data, object_path, properties, error);
}
static void
empathy_dispatcher_call_create_or_ensure_channel (
- EmpathyDispatcher *dispatcher,
+ EmpathyDispatcher *self,
DispatcherRequestData *request_data)
{
if (request_data->should_ensure)
@@ -1564,13 +1564,13 @@ empathy_dispatcher_call_create_or_ensure_channel (
}
void
-empathy_dispatcher_create_channel (EmpathyDispatcher *dispatcher,
+empathy_dispatcher_create_channel (EmpathyDispatcher *self,
TpConnection *connection,
GHashTable *request,
EmpathyDispatcherRequestCb *callback,
gpointer user_data)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
ConnectionData *connection_data;
DispatcherRequestData *request_data;
const gchar *channel_type;
@@ -1578,7 +1578,7 @@ empathy_dispatcher_create_channel (EmpathyDispatcher *dispatcher,
guint handle;
gboolean valid;
- g_return_if_fail (EMPATHY_IS_DISPATCHER (dispatcher));
+ g_return_if_fail (EMPATHY_IS_DISPATCHER (self));
g_return_if_fail (TP_IS_CONNECTION (connection));
g_return_if_fail (request != NULL);
@@ -1594,14 +1594,14 @@ empathy_dispatcher_create_channel (EmpathyDispatcher *dispatcher,
handle = tp_asv_get_uint32 (request, TP_IFACE_CHANNEL ".TargetHandle", NULL);
- request_data = new_dispatcher_request_data (dispatcher, connection,
+ request_data = new_dispatcher_request_data (self, connection,
channel_type, handle_type, handle, request,
NULL, callback, user_data);
connection_data->outstanding_requests = g_list_prepend
(connection_data->outstanding_requests, request_data);
- empathy_dispatcher_call_create_or_ensure_channel (dispatcher, request_data);
+ empathy_dispatcher_call_create_or_ensure_channel (self, request_data);
}
static gboolean
@@ -1635,7 +1635,7 @@ channel_class_matches (GValueArray *class,
if (fixed_properties != NULL)
{
gpointer h_key, h_val;
- int idx;
+ guint idx;
GHashTableIter iter;
gboolean found;
@@ -1686,17 +1686,17 @@ channel_class_matches (GValueArray *class,
}
static GList *
-empathy_dispatcher_find_channel_classes (EmpathyDispatcher *dispatcher,
+empathy_dispatcher_find_channel_classes (EmpathyDispatcher *self,
TpConnection *connection,
const gchar *channel_type,
guint handle_type,
GArray *fixed_properties)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
GValueArray *class;
GPtrArray *classes;
GList *matching_classes;
- int i;
+ guint i;
ConnectionData *cd;
g_return_val_if_fail (channel_type != NULL, NULL);
@@ -1826,7 +1826,7 @@ setup_varargs (va_list var_args,
*/
GList *
empathy_dispatcher_find_requestable_channel_classes
- (EmpathyDispatcher *dispatcher,
+ (EmpathyDispatcher *self,
TpConnection *connection,
const gchar *channel_type,
guint handle_type,
@@ -1837,15 +1837,15 @@ empathy_dispatcher_find_requestable_channel_classes
GArray *properties;
EmpathyDispatcherPriv *priv;
GList *retval;
- int idx;
+ guint idx;
char *str;
- g_return_val_if_fail (EMPATHY_IS_DISPATCHER (dispatcher), NULL);
+ g_return_val_if_fail (EMPATHY_IS_DISPATCHER (self), NULL);
g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL);
g_return_val_if_fail (channel_type != NULL, NULL);
g_return_val_if_fail (handle_type != 0, NULL);
- priv = GET_PRIV (dispatcher);
+ priv = GET_PRIV (self);
va_start (var_args, first_property_name);
@@ -1853,7 +1853,7 @@ empathy_dispatcher_find_requestable_channel_classes
va_end (var_args);
- retval = empathy_dispatcher_find_channel_classes (dispatcher, connection,
+ retval = empathy_dispatcher_find_channel_classes (self, connection,
channel_type, handle_type, properties);
if (properties != NULL)
@@ -1888,7 +1888,7 @@ empathy_dispatcher_find_requestable_channel_classes
*/
void
empathy_dispatcher_find_requestable_channel_classes_async
- (EmpathyDispatcher *dispatcher,
+ (EmpathyDispatcher *self,
TpConnection *connection,
const gchar *channel_type,
guint handle_type,
@@ -1903,12 +1903,12 @@ empathy_dispatcher_find_requestable_channel_classes_async
EmpathyDispatcherPriv *priv;
guint source_id;
- g_return_if_fail (EMPATHY_IS_DISPATCHER (dispatcher));
+ g_return_if_fail (EMPATHY_IS_DISPATCHER (self));
g_return_if_fail (TP_IS_CONNECTION (connection));
g_return_if_fail (channel_type != NULL);
g_return_if_fail (handle_type != 0);
- priv = GET_PRIV (dispatcher);
+ priv = GET_PRIV (self);
va_start (var_args, first_property_name);
@@ -1918,7 +1918,7 @@ empathy_dispatcher_find_requestable_channel_classes_async
/* append another request for this connection */
request = g_slice_new0 (FindChannelRequest);
- request->dispatcher = g_object_ref (dispatcher);
+ request->dispatcher = g_object_ref (self);
request->channel_type = g_strdup (channel_type);
request->handle_type = handle_type;
request->connection = connection;
@@ -1936,8 +1936,8 @@ static GList *
empathy_dispatcher_get_channels (EmpathyHandler *handler,
gpointer user_data)
{
- EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (user_data);
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcher *self = EMPATHY_DISPATCHER (user_data);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
return priv->channels;
}
@@ -1953,9 +1953,9 @@ empathy_dispatcher_handle_channels (EmpathyHandler *handler,
gpointer user_data,
GError **error)
{
- EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (user_data);
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
- int i;
+ EmpathyDispatcher *self = EMPATHY_DISPATCHER (user_data);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
+ guint i;
EmpathyAccount *account;
TpConnection *connection;
@@ -1981,7 +1981,7 @@ empathy_dispatcher_handle_channels (EmpathyHandler *handler,
object_path = g_value_get_boxed (g_value_array_get_nth (arr, 0));
properties = g_value_get_boxed (g_value_array_get_nth (arr, 1));
- dispatcher_connection_new_channel_with_properties (dispatcher,
+ dispatcher_connection_new_channel_with_properties (self,
connection, object_path, properties);
}
@@ -1990,12 +1990,12 @@ empathy_dispatcher_handle_channels (EmpathyHandler *handler,
EmpathyHandler *
-empathy_dispatcher_add_handler (EmpathyDispatcher *dispatcher,
+empathy_dispatcher_add_handler (EmpathyDispatcher *self,
const gchar *name,
GPtrArray *filters,
GStrv capabilities)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
EmpathyHandler *handler;
handler = empathy_handler_new (name, filters, capabilities);
@@ -2005,17 +2005,16 @@ empathy_dispatcher_add_handler (EmpathyDispatcher *dispatcher,
* handler will always report all dispatched channels even if they came from
* a different Handler */
empathy_handler_set_handle_channels_func (handler,
- empathy_dispatcher_handle_channels,
- dispatcher);
+ empathy_dispatcher_handle_channels, self);
return handler;
}
void
-empathy_dispatcher_remove_handler (EmpathyDispatcher *dispatcher,
+empathy_dispatcher_remove_handler (EmpathyDispatcher *self,
EmpathyHandler *handler)
{
- EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+ EmpathyDispatcherPriv *priv = GET_PRIV (self);
GList *h;
h = g_list_find (priv->handlers, handler);
diff --git a/libempathy/empathy-irc-network-manager.c b/libempathy/empathy-irc-network-manager.c
index ad726800a..d537d5574 100644
--- a/libempathy/empathy-irc-network-manager.c
+++ b/libempathy/empathy-irc-network-manager.c
@@ -463,12 +463,12 @@ irc_network_manager_parse_irc_server (EmpathyIrcNetwork *network,
{
gchar *address = NULL, *port = NULL, *ssl = NULL;
- if (strcmp (server_node->name, "server") != 0)
+ if (strcmp ((const gchar *) server_node->name, "server") != 0)
continue;
- address = xmlGetProp (server_node, "address");
- port = xmlGetProp (server_node, "port");
- ssl = xmlGetProp (server_node, "ssl");
+ address = (gchar *) xmlGetProp (server_node, (const xmlChar *) "address");
+ port = (gchar *) xmlGetProp (server_node, (const xmlChar *) "port");
+ ssl = (gchar *) xmlGetProp (server_node, (const xmlChar *) "ssl");
if (address != NULL)
{
@@ -511,8 +511,8 @@ irc_network_manager_parse_irc_network (EmpathyIrcNetworkManager *self,
gchar *str;
gchar *id, *name;
- id = xmlGetProp (node, "id");
- if (xmlHasProp (node, "dropped"))
+ id = (gchar *) xmlGetProp (node, (const xmlChar *) "id");
+ if (xmlHasProp (node, (const xmlChar *) "dropped"))
{
if (!user_defined)
{
@@ -529,16 +529,16 @@ irc_network_manager_parse_irc_network (EmpathyIrcNetworkManager *self,
return;
}
- if (!xmlHasProp (node, "name"))
+ if (!xmlHasProp (node, (const xmlChar *) "name"))
return;
- name = xmlGetProp (node, "name");
+ name = (gchar *) xmlGetProp (node, (const xmlChar *) "name");
network = empathy_irc_network_new (name);
- if (xmlHasProp (node, "network_charset"))
+ if (xmlHasProp (node, (const xmlChar *) "network_charset"))
{
gchar *charset;
- charset = xmlGetProp (node, "network_charset");
+ charset = (gchar *) xmlGetProp (node, (const xmlChar *) "network_charset");
g_object_set (network, "charset", charset, NULL);
xmlFree (charset);
}
@@ -630,12 +630,13 @@ write_network_to_xml (const gchar *id,
/* no need to write this network to the XML */
return;
- network_node = xmlNewChild (root, NULL, "network", NULL);
- xmlNewProp (network_node, "id", id);
+ network_node = xmlNewChild (root, NULL, (const xmlChar *) "network", NULL);
+ xmlNewProp (network_node, (const xmlChar *) "id", (const xmlChar *) id);
if (network->dropped)
{
- xmlNewProp (network_node, "dropped", "1");
+ xmlNewProp (network_node, (const xmlChar *) "dropped",
+ (const xmlChar *) "1");
return;
}
@@ -643,14 +644,16 @@ write_network_to_xml (const gchar *id,
"name", &name,
"charset", &charset,
NULL);
- xmlNewProp (network_node, "name", name);
- xmlNewProp (network_node, "network_charset", charset);
+ xmlNewProp (network_node, (const xmlChar *) "name", (const xmlChar *) name);
+ xmlNewProp (network_node, (const xmlChar *) "network_charset",
+ (const xmlChar *) charset);
g_free (name);
g_free (charset);
servers = empathy_irc_network_get_servers (network);
- servers_node = xmlNewChild (network_node, NULL, "servers", NULL);
+ servers_node = xmlNewChild (network_node, NULL, (const xmlChar *) "servers",
+ NULL);
for (l = servers; l != NULL; l = g_slist_next (l))
{
EmpathyIrcServer *server;
@@ -661,7 +664,8 @@ write_network_to_xml (const gchar *id,
server = l->data;
- server_node = xmlNewChild (servers_node, NULL, "server", NULL);
+ server_node = xmlNewChild (servers_node, NULL, (const xmlChar *) "server",
+ NULL);
g_object_get (server,
"address", &address,
@@ -669,13 +673,16 @@ write_network_to_xml (const gchar *id,
"ssl", &ssl,
NULL);
- xmlNewProp (server_node, "address", address);
+ xmlNewProp (server_node, (const xmlChar *) "address",
+ (const xmlChar *) address);
tmp = g_strdup_printf ("%u", port);
- xmlNewProp (server_node, "port", tmp);
+ xmlNewProp (server_node, (const xmlChar *) "port",
+ (const xmlChar *) tmp);
g_free (tmp);
- xmlNewProp (server_node, "ssl", ssl ? "TRUE": "FALSE");
+ xmlNewProp (server_node, (const xmlChar *) "ssl",
+ ssl ? (const xmlChar *) "TRUE": (const xmlChar *) "FALSE");
g_free (address);
}
@@ -700,8 +707,8 @@ irc_network_manager_file_save (EmpathyIrcNetworkManager *self)
DEBUG ("Saving IRC networks");
- doc = xmlNewDoc ("1.0");
- root = xmlNewNode (NULL, "networks");
+ doc = xmlNewDoc ((const xmlChar *) "1.0");
+ root = xmlNewNode (NULL, (const xmlChar *) "networks");
xmlDocSetRootElement (doc, root);
g_hash_table_foreach (priv->networks, (GHFunc) write_network_to_xml, root);
diff --git a/libempathy/empathy-log-store-empathy.c b/libempathy/empathy-log-store-empathy.c
index 9e5170370..9771a9f28 100644
--- a/libempathy/empathy-log-store-empathy.c
+++ b/libempathy/empathy-log-store-empathy.c
@@ -480,7 +480,7 @@ log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
{
EmpathyMessage *message;
EmpathyContact *sender;
- gchar *time;
+ gchar *time_;
time_t t;
gchar *sender_id;
gchar *sender_name;
@@ -493,17 +493,18 @@ log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
guint cm_id;
TpChannelTextMessageType msg_type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL;
- if (strcmp (node->name, "message") != 0)
+ if (strcmp ((const gchar *) node->name, "message") != 0)
continue;
- body = xmlNodeGetContent (node);
- time = xmlGetProp (node, "time");
- sender_id = xmlGetProp (node, "id");
- sender_name = xmlGetProp (node, "name");
- sender_avatar_token = xmlGetProp (node, "token");
- is_user_str = xmlGetProp (node, "isuser");
- msg_type_str = xmlGetProp (node, "type");
- cm_id_str = xmlGetProp (node, "cm_id");
+ body = (gchar *) xmlNodeGetContent (node);
+ time_ = (gchar *) xmlGetProp (node, (const xmlChar *) "time");
+ sender_id = (gchar *) xmlGetProp (node, (const xmlChar *) "id");
+ sender_name = (gchar *) xmlGetProp (node, (const xmlChar *) "name");
+ sender_avatar_token = (gchar *) xmlGetProp (node,
+ (const xmlChar *) "token");
+ is_user_str = (gchar *) xmlGetProp (node, (const xmlChar *) "isuser");
+ msg_type_str = (gchar *) xmlGetProp (node, (const xmlChar *) "type");
+ cm_id_str = (gchar *) xmlGetProp (node, (const xmlChar *) "cm_id");
if (is_user_str)
is_user = strcmp (is_user_str, "true") == 0;
@@ -514,7 +515,7 @@ log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
if (cm_id_str)
cm_id = atoi (cm_id_str);
- t = empathy_time_parse (time);
+ t = empathy_time_parse (time_);
sender = empathy_contact_new_for_log (account, sender_id, sender_name,
is_user);
@@ -535,7 +536,7 @@ log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
messages = g_list_append (messages, message);
g_object_unref (sender);
- xmlFree (time);
+ xmlFree (time_);
xmlFree (sender_id);
xmlFree (sender_name);
xmlFree (body);
diff --git a/libempathy/empathy-status-presets.c b/libempathy/empathy-status-presets.c
index 1fa991b0b..255f7ab21 100644
--- a/libempathy/empathy-status-presets.c
+++ b/libempathy/empathy-status-presets.c
@@ -127,7 +127,7 @@ status_presets_file_parse (const gchar *filename)
}
status = (gchar *) xmlNodeGetContent (node);
- state_str = (gchar *) xmlGetProp (node, "presence");
+ state_str = (gchar *) xmlGetProp (node, (const xmlChar *) "presence");
if (state_str) {
state = empathy_presence_from_str (state_str);
@@ -208,19 +208,19 @@ status_presets_file_save (void)
file = g_build_filename (dir, STATUS_PRESETS_XML_FILENAME, NULL);
g_free (dir);
- doc = xmlNewDoc ("1.0");
- root = xmlNewNode (NULL, "presets");
+ doc = xmlNewDoc ((const xmlChar *) "1.0");
+ root = xmlNewNode (NULL, (const xmlChar *) "presets");
xmlDocSetRootElement (doc, root);
if (default_preset) {
xmlNodePtr subnode;
xmlChar *state;
- state = (gchar *) empathy_presence_to_str (default_preset->state);
+ state = (xmlChar *) empathy_presence_to_str (default_preset->state);
- subnode = xmlNewTextChild (root, NULL, "default",
- default_preset->status);
- xmlNewProp (subnode, "presence", state);
+ subnode = xmlNewTextChild (root, NULL, (const xmlChar *) "default",
+ (const xmlChar *) default_preset->status);
+ xmlNewProp (subnode, (const xmlChar *) "presence", state);
}
for (l = presets; l; l = l->next) {
@@ -229,7 +229,7 @@ status_presets_file_save (void)
xmlChar *state;
sp = l->data;
- state = (gchar *) empathy_presence_to_str (sp->state);
+ state = (xmlChar *) empathy_presence_to_str (sp->state);
count[sp->state]++;
if (count[sp->state] > STATUS_PRESETS_MAX_EACH) {
@@ -237,8 +237,8 @@ status_presets_file_save (void)
}
subnode = xmlNewTextChild (root, NULL,
- "status", sp->status);
- xmlNewProp (subnode, "presence", state);
+ (const xmlChar *) "status", (const xmlChar *) sp->status);
+ xmlNewProp (subnode, (const xmlChar *) "presence", state);
}
/* Make sure the XML is indented properly */
diff --git a/libempathy/empathy-time.c b/libempathy/empathy-time.c
index 19397e7a9..a39636dde 100644
--- a/libempathy/empathy-time.c
+++ b/libempathy/empathy-time.c
@@ -40,18 +40,18 @@ empathy_time_get_current (void)
time_t
empathy_time_get_local_time (struct tm *tm)
{
- const gchar *timezone;
+ const gchar *tz;
time_t t;
- timezone = g_getenv ("TZ");
+ tz = g_getenv ("TZ");
g_setenv ("TZ", "", TRUE);
tzset ();
t = mktime (tm);
- if (timezone) {
- g_setenv ("TZ", timezone, TRUE);
+ if (tz) {
+ g_setenv ("TZ", tz, TRUE);
} else {
g_unsetenv ("TZ");
}
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index dd6b60586..6683b5936 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -185,7 +185,7 @@ tp_contact_factory_avatar_retrieved_cb (TpConnection *connection,
handle);
empathy_contact_load_avatar_data (contact,
- avatar_data->data,
+ (guchar *) avatar_data->data,
avatar_data->len,
mime_type,
token);
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index 2bf2ec416..3e1015d0c 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -188,7 +188,7 @@ tp_contact_list_group_members_changed_cb (TpChannel *channel,
{
EmpathyTpContactListPriv *priv = GET_PRIV (list);
const gchar *group_name;
- gint i;
+ guint i;
group_name = tp_channel_get_identifier (channel);
@@ -430,12 +430,12 @@ tp_contact_list_remove_handle (EmpathyTpContactList *list,
{
EmpathyTpContactListPriv *priv = GET_PRIV (list);
EmpathyContact *contact;
- const gchar *signal;
+ const gchar *sig;
if (table == priv->pendings)
- signal = "pendings-changed";
+ sig = "pendings-changed";
else if (table == priv->members)
- signal = "members-changed";
+ sig = "members-changed";
else
return;
@@ -443,7 +443,7 @@ tp_contact_list_remove_handle (EmpathyTpContactList *list,
if (contact) {
g_object_ref (contact);
g_hash_table_remove (table, GUINT_TO_POINTER (handle));
- g_signal_emit_by_name (list, signal, contact, 0, 0, NULL,
+ g_signal_emit_by_name (list, sig, contact, 0, 0, NULL,
FALSE);
g_object_unref (contact);
}
@@ -539,7 +539,7 @@ tp_contact_list_get_requestablechannelclasses_cb (TpProxy *connection,
{
EmpathyTpContactListPriv *priv = GET_PRIV (list);
GPtrArray *classes;
- int i;
+ guint i;
if (error) {
DEBUG ("Error: %s", error->message);
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 3b14b0028..a0cb4111e 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -135,7 +135,8 @@ gboolean
empathy_xml_validate (xmlDoc *doc,
const gchar *dtd_filename)
{
- gchar *path, *escaped;
+ gchar *path;
+ xmlChar *escaped;
xmlValidCtxt cvp;
xmlDtd *dtd;
gboolean ret;
@@ -149,7 +150,8 @@ empathy_xml_validate (xmlDoc *doc,
DEBUG ("Loading dtd file %s", path);
/* The list of valid chars is taken from libxml. */
- escaped = xmlURIEscapeStr (path, ":@&=+$,/?;");
+ escaped = xmlURIEscapeStr ((const xmlChar *) path,
+ (const xmlChar *)":@&=+$,/?;");
g_free (path);
memset (&cvp, 0, sizeof (cvp));
@@ -172,7 +174,7 @@ empathy_xml_node_get_child (xmlNodePtr node,
g_return_val_if_fail (child_name != NULL, NULL);
for (l = node->children; l; l = l->next) {
- if (l->name && strcmp (l->name, child_name) == 0) {
+ if (l->name && strcmp ((const gchar *) l->name, child_name) == 0) {
return l;
}
}
@@ -212,12 +214,12 @@ empathy_xml_node_find_child_prop_value (xmlNodePtr node,
for (l = node->children; l && !found; l = l->next) {
xmlChar *prop;
- if (!xmlHasProp (l, prop_name)) {
+ if (!xmlHasProp (l, (const xmlChar *) prop_name)) {
continue;
}
- prop = xmlGetProp (l, prop_name);
- if (prop && strcmp (prop, prop_value) == 0) {
+ prop = xmlGetProp (l, (const xmlChar *) prop_name);
+ if (prop && strcmp ((const gchar *) prop, prop_value) == 0) {
found = l;
}