summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Mardegan <alberto.mardegan@nokia.com>2009-02-26 14:49:17 +0200
committerAlberto Mardegan <alberto.mardegan@nokia.com>2009-02-26 14:49:17 +0200
commit479af6c535b9b0740857a576e8370339d9575be0 (patch)
tree50b3209127b230a73bb42ffbd1c0a616e768a4f9
parent59b6dc485c75626af1d8fbd6ed16b4af5cd390e8 (diff)
parentf61a872d715b4665eec3346eae62c799d9b1e3c4 (diff)
Merge branch 'debug'5.0.beta60
Conflicts: src/mcd-manager.c
-rw-r--r--configure.ac5
-rw-r--r--server/mc-server.c2
-rw-r--r--src/mcd-account-compat.c4
-rw-r--r--src/mcd-account-conditions.c2
-rw-r--r--src/mcd-account-manager-query.c12
-rw-r--r--src/mcd-account-manager.c30
-rw-r--r--src/mcd-account-requests.c14
-rw-r--r--src/mcd-account.c100
-rw-r--r--src/mcd-channel.c35
-rw-r--r--src/mcd-connection.c136
-rw-r--r--src/mcd-controller.c12
-rw-r--r--src/mcd-dbusprop.c9
-rw-r--r--src/mcd-debug.c15
-rw-r--r--src/mcd-debug.h26
-rw-r--r--src/mcd-dispatch-operation.c8
-rw-r--r--src/mcd-dispatcher.c103
-rw-r--r--src/mcd-manager.c27
-rw-r--r--src/mcd-master.c48
-rw-r--r--src/mcd-mission.c8
-rw-r--r--src/mcd-operation.c6
-rw-r--r--src/mcd-presence-frame.c20
-rw-r--r--src/mcd-proxy.c2
-rw-r--r--src/mcd-service.c38
23 files changed, 335 insertions, 327 deletions
diff --git a/configure.ac b/configure.ac
index 767dda13..0abb173d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,6 +96,11 @@ done
AC_SUBST(TEST_PYTHON)
AM_CONDITIONAL([WANT_TWISTED_TESTS], test false != "$TEST_PYTHON")
+AC_ARG_ENABLE(debug, [ --disable-debug compile without debug code],[enable_debug=${enableval}], enable_debug=yes )
+if test "x$enable_debug" = "xyes"; then
+ CFLAGS="$CFLAGS -DENABLE_DEBUG"
+fi
+
AC_ARG_ENABLE(cast-checks, [ --disable-cast-checks compile with GLIB cast checks disabled],[cchecks=${enableval}],cchecks=yes)
if test "x$cchecks" = "xno"; then
CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"
diff --git a/server/mc-server.c b/server/mc-server.c
index 474e0e27..17958509 100644
--- a/server/mc-server.c
+++ b/server/mc-server.c
@@ -50,7 +50,7 @@ main (int argc, char **argv)
g_type_init ();
- tp_debug_set_flags (g_getenv ("TP_GLIB_DEBUG"));
+ tp_debug_set_flags (g_getenv ("MC_TP_DEBUG"));
mcd = mcd_service_new ();
diff --git a/src/mcd-account-compat.c b/src/mcd-account-compat.c
index fb214a27..8e6fdd1a 100644
--- a/src/mcd-account-compat.c
+++ b/src/mcd-account-compat.c
@@ -248,7 +248,7 @@ process_channel_request (McdAccount *account, gpointer userdata,
g_object_unref (channel);
return;
}
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
connection = mcd_account_get_connection (account);
g_return_if_fail (connection != NULL);
g_return_if_fail (mcd_connection_get_connection_status (connection)
@@ -263,7 +263,7 @@ on_channel_status_changed (McdChannel *channel, McdChannelStatus status,
{
McdAccountCompatReq *req_data;
- g_debug ("%s (%u)", G_STRFUNC, status);
+ DEBUG ("%u", status);
g_return_if_fail (MCD_IS_ACCOUNT (account));
if (status == MCD_CHANNEL_STATUS_FAILED &&
diff --git a/src/mcd-account-conditions.c b/src/mcd-account-conditions.c
index 52aa4115..bb6705ae 100644
--- a/src/mcd-account-conditions.c
+++ b/src/mcd-account-conditions.c
@@ -121,7 +121,7 @@ GHashTable *mcd_account_get_conditions (McdAccount *account)
{
if (strncmp (*key, "condition-", 10) != 0) continue;
condition = g_key_file_get_string (keyfile, unique_name, *key, NULL);
- g_debug ("Condition: %s = %s", *key, condition);
+ DEBUG ("Condition: %s = %s", *key, condition);
g_hash_table_insert (conditions, g_strdup (*key + 10), condition);
}
g_strfreev (keys);
diff --git a/src/mcd-account-manager-query.c b/src/mcd-account-manager-query.c
index f5374767..51382b10 100644
--- a/src/mcd-account-manager-query.c
+++ b/src/mcd-account-manager-query.c
@@ -142,7 +142,7 @@ match_account_property (McdAccount *account, McdIfaceProperty *prop)
GValue value = { 0 };
GError *error = NULL;
- g_debug ("prop %s, value type %s", prop->name, G_VALUE_TYPE_NAME (prop->value));
+ DEBUG ("prop %s, value type %s", prop->name, G_VALUE_TYPE_NAME (prop->value));
unique_name = mcd_account_get_unique_name (account);
mcd_dbusprop_get_property (TP_SVC_DBUS_PROPERTIES (account),
prop->iface, prop->name, &value,
@@ -196,7 +196,7 @@ find_accounts (gpointer key, gpointer value, gpointer userdata)
const gchar *object_path, *string, *status, *message;
guint i;
- g_debug ("%s: %s", G_STRFUNC, (gchar *)key);
+ DEBUG ("%s", (gchar *)key);
if (fd->manager)
{
string = mcd_account_get_manager_name (account);
@@ -232,7 +232,7 @@ find_accounts (gpointer key, gpointer value, gpointer userdata)
if (!status || strcmp (fd->current_status, status) != 0) return;
}
- g_debug ("checking parameters");
+ DEBUG ("checking parameters");
for (i = 0; i < fd->params->len; i++)
{
McdFindParam *param;
@@ -241,7 +241,7 @@ find_accounts (gpointer key, gpointer value, gpointer userdata)
return;
}
- g_debug ("checking properties");
+ DEBUG ("checking properties");
for (i = 0; i < fd->properties->len; i++)
{
McdIfaceProperty *prop;
@@ -250,7 +250,7 @@ find_accounts (gpointer key, gpointer value, gpointer userdata)
return;
}
object_path = mcd_account_get_object_path (account);
- g_debug ("%s", object_path);
+ DEBUG ("%s", object_path);
g_ptr_array_add (fd->accounts, (gpointer)object_path);
}
@@ -308,7 +308,7 @@ account_manager_find_accounts (McSvcAccountManagerInterfaceQuery *self,
McdFindData fd;
guint i;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
memset (&fd, 0, sizeof (fd));
fd.params = g_array_new (FALSE, FALSE, sizeof (McdFindParam));
fd.properties = g_array_new (FALSE, FALSE, sizeof (McdIfaceProperty));
diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index 00ef4e19..d2dfe9f7 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -169,8 +169,7 @@ recover_connection (McdAccountManager *account_manager, gchar *file_contents,
if (!account || !mcd_account_is_enabled (account))
goto err_account;
- g_debug ("%s: account is %s", G_STRFUNC,
- mcd_account_get_unique_name (account));
+ DEBUG ("account is %s", mcd_account_get_unique_name (account));
manager_name = mcd_account_get_manager_name (account);
master = mcd_master_get_default ();
@@ -179,7 +178,7 @@ recover_connection (McdAccountManager *account_manager, gchar *file_contents,
manager = mcd_master_lookup_manager (master, manager_name);
if (G_UNLIKELY (!manager))
{
- g_debug ("Manager %s not found", manager_name);
+ DEBUG ("Manager %s not found", manager_name);
goto err_manager;
}
@@ -190,7 +189,7 @@ recover_connection (McdAccountManager *account_manager, gchar *file_contents,
&error);
if (G_UNLIKELY (error))
{
- g_debug ("%s: got error: %s", G_STRFUNC, error->message);
+ DEBUG ("got error: %s", error->message);
g_error_free (error);
goto err_connection;
}
@@ -218,19 +217,19 @@ list_connection_names_cb (const gchar * const *names, gsize n,
gchar *contents = NULL;
guint i;
- g_debug ("%s called, %u connections", G_STRFUNC, n);
+ DEBUG ("%u connections", n);
g_file_get_contents (priv->account_connections_file, &contents, NULL, NULL);
for (i = 0; i < n; i++)
{
g_return_if_fail (names[i] != NULL);
- g_debug ("Connection %s", names[i]);
+ DEBUG ("Connection %s", names[i]);
if (!recover_connection (account_manager, contents, names[i]))
{
/* Close the connection */
TpConnection *proxy;
- g_debug ("Killing connection");
+ DEBUG ("Killing connection");
proxy = tp_connection_new (priv->dbus_daemon, names[i], NULL, NULL);
if (proxy)
tp_cli_connection_call_disconnect (proxy, -1, NULL, NULL,
@@ -277,8 +276,7 @@ unref_account (gpointer data)
McdAccount *account = MCD_ACCOUNT (data);
McdAccountManager *account_manager;
- g_debug ("%s called for %s", G_STRFUNC,
- mcd_account_get_unique_name (account));
+ DEBUG ("called for %s", mcd_account_get_unique_name (account));
account_manager = mcd_account_get_account_manager (account);
g_signal_handlers_disconnect_by_func (account, on_account_validity_changed,
account_manager);
@@ -404,7 +402,7 @@ mcd_account_manager_create_account (McdAccountManager *account_manager,
McdAccount *account;
gchar *unique_name;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
if (G_UNLIKELY (manager == NULL || manager[0] == 0 ||
protocol == NULL || protocol[0] == 0))
{
@@ -527,7 +525,7 @@ get_valid_accounts (TpSvcDBusProperties *self, const gchar *name,
McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (self);
McdAccountManagerPrivate *priv = account_manager->priv;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
accounts_to_gvalue (priv->accounts, TRUE, value);
}
@@ -538,7 +536,7 @@ get_invalid_accounts (TpSvcDBusProperties *self, const gchar *name,
McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (self);
McdAccountManagerPrivate *priv = account_manager->priv;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
accounts_to_gvalue (priv->accounts, FALSE, value);
}
@@ -589,7 +587,7 @@ write_conf (gpointer userdata)
gchar *filename, *data;
gsize len;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
write_conf_id = 0;
data = g_key_file_to_data (keyfile, &len, &error);
@@ -617,7 +615,7 @@ release_load_accounts_lock (McdLoadAccountsData *lad)
{
g_return_if_fail (lad->account_lock > 0);
lad->account_lock--;
- g_debug ("%s called, count is now %d", G_STRFUNC, lad->account_lock);
+ DEBUG ("called, count is now %d", lad->account_lock);
if (lad->account_lock == 0)
{
register_dbus_service (lad->account_manager);
@@ -817,14 +815,14 @@ mcd_account_manager_init (McdAccountManager *account_manager)
priv->keyfile = g_key_file_new ();
conf_filename = get_account_conf_filename ();
- g_debug ("Loading accounts from %s", conf_filename);
+ DEBUG ("Loading accounts from %s", conf_filename);
if (!g_file_test (conf_filename, G_FILE_TEST_EXISTS))
{
gchar *dirname = g_path_get_dirname (conf_filename);
g_mkdir_with_parents (dirname, 0777);
g_free (dirname);
- g_debug ("Creating file");
+ DEBUG ("Creating file");
g_file_set_contents (conf_filename, INITIAL_CONFIG_FILE_CONTENTS,
sizeof (INITIAL_CONFIG_FILE_CONTENTS) - 1, NULL);
}
diff --git a/src/mcd-account-requests.c b/src/mcd-account-requests.c
index 70d67d62..47896446 100644
--- a/src/mcd-account-requests.c
+++ b/src/mcd-account-requests.c
@@ -49,12 +49,12 @@ online_request_cb (McdAccount *account, gpointer userdata, const GError *error)
if (error)
{
- g_warning ("%s: got error: %s", G_STRFUNC, error->message);
+ g_warning ("got error: %s", error->message);
mcd_channel_take_error (channel, g_error_copy (error));
g_object_unref (channel);
return;
}
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
connection = mcd_account_get_connection (account);
g_return_if_fail (connection != NULL);
g_return_if_fail (mcd_connection_get_connection_status (connection)
@@ -62,7 +62,7 @@ online_request_cb (McdAccount *account, gpointer userdata, const GError *error)
if (mcd_channel_get_status (channel) == MCD_CHANNEL_STATUS_FAILED)
{
- g_debug ("%s: channel %p is failed", G_STRFUNC, channel);
+ DEBUG ("channel %p is failed", channel);
g_object_unref (channel);
return;
}
@@ -176,7 +176,7 @@ create_request (McdAccount *account, GHashTable *properties,
_mcd_account_online_request (account, online_request_cb, channel, error);
if (*error)
{
- g_warning ("%s: _mcd_account_online_request: %s", G_STRFUNC,
+ g_warning ("_mcd_account_online_request: %s",
(*error)->message);
mcd_channel_take_error (channel, g_error_copy (*error));
/* no unref here, as this will invoke our handler which will
@@ -216,7 +216,7 @@ account_request_common (McdAccount *account, GHashTable *properties,
return;
}
request_id = _mcd_channel_get_request_path (channel);
- g_debug ("%s: returning %s", G_STRFUNC, request_id);
+ DEBUG ("returning %s", request_id);
if (use_existing)
mc_svc_account_interface_channelrequests_return_from_ensure_channel
(context, request_id);
@@ -257,7 +257,7 @@ account_request_cancel (McSvcAccountInterfaceChannelRequests *self,
McdChannel *channel;
McdChannelStatus status;
- g_debug ("%s called for %s", G_STRFUNC, request_id);
+ DEBUG ("called for %s", request_id);
g_return_if_fail (request_id != NULL);
channel = get_channel_from_request (MCD_ACCOUNT (self), request_id);
if (!channel)
@@ -270,7 +270,7 @@ account_request_cancel (McSvcAccountInterfaceChannelRequests *self,
}
status = mcd_channel_get_status (channel);
- g_debug ("channel %p is in status %u", channel, status);
+ DEBUG ("channel %p is in status %u", channel, status);
if (status == MCD_CHANNEL_STATUS_REQUEST ||
status == MCD_CHANNEL_STATUS_REQUESTED ||
status == MCD_CHANNEL_STATUS_DISPATCHING)
diff --git a/src/mcd-account.c b/src/mcd-account.c
index c7177f6a..ff817fed 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -173,8 +173,7 @@ _mcd_account_maybe_autoconnect (McdAccount *account)
McdMaster *master = mcd_master_get_default ();
if (_mcd_master_account_conditions_satisfied (master, account))
{
- g_debug ("%s: connecting account %s", G_STRFUNC,
- priv->unique_name);
+ DEBUG ("connecting account %s", priv->unique_name);
_mcd_account_request_connection (account);
}
}
@@ -228,7 +227,7 @@ set_parameter (McdAccount *account, const gchar *name, const GValue *value)
if (!value)
{
g_key_file_remove_key (priv->keyfile, priv->unique_name, key, NULL);
- g_debug ("unset param %s", name);
+ DEBUG ("unset param %s", name);
return;
}
@@ -326,7 +325,7 @@ static void on_manager_ready (McdManager *manager, const GError *error,
if (error)
{
- g_debug ("%s: got error: %s", G_STRFUNC, error->message);
+ DEBUG ("got error: %s", error->message);
}
else
{
@@ -425,8 +424,7 @@ on_connection_abort (McdConnection *connection, McdAccount *account)
{
McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account);
- g_debug ("%s called (%p, account %s)", G_STRFUNC,
- connection, priv->unique_name);
+ DEBUG ("called (%p, account %s)", connection, priv->unique_name);
_mcd_account_set_connection (account, NULL);
}
@@ -501,7 +499,7 @@ emit_property_changed (gpointer userdata)
McdAccount *account = MCD_ACCOUNT (userdata);
McdAccountPrivate *priv = account->priv;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
mc_svc_account_emit_account_property_changed (account,
priv->changed_properties);
@@ -529,14 +527,14 @@ mcd_account_changed_property (McdAccount *account, const gchar *key,
McdAccountPrivate *priv = account->priv;
GValue *val;
- g_debug ("%s called: %s", G_STRFUNC, key);
+ DEBUG ("called: %s", key);
if (priv->changed_properties &&
g_hash_table_lookup (priv->changed_properties, key))
{
/* the changed property was also changed before; then let's force the
* emission of the signal now, so that the property will appear in two
* separate signals */
- g_debug ("Forcibly emit PropertiesChanged now");
+ DEBUG ("Forcibly emit PropertiesChanged now");
g_source_remove (priv->properties_source);
emit_property_changed (account);
}
@@ -550,7 +548,7 @@ mcd_account_changed_property (McdAccount *account, const gchar *key,
if (priv->properties_source == 0)
{
- g_debug ("First changed property");
+ DEBUG ("First changed property");
priv->property_values = g_array_sized_new (FALSE, FALSE,
sizeof (GValue), 4);
priv->properties_source = g_timeout_add (10, emit_property_changed,
@@ -566,7 +564,7 @@ mcd_account_changed_property (McdAccount *account, const gchar *key,
#else
GHashTable *properties;
- g_debug ("%s called: %s", G_STRFUNC, key);
+ DEBUG ("called: %s", key);
properties = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (properties, (gpointer)key, (gpointer)value);
mc_svc_account_emit_account_property_changed (account,
@@ -628,7 +626,7 @@ set_display_name (TpSvcDBusProperties *self, const gchar *name,
McdAccount *account = MCD_ACCOUNT (self);
McdAccountPrivate *priv = account->priv;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
mcd_account_set_string_val (account, name, value);
}
@@ -646,7 +644,7 @@ set_icon (TpSvcDBusProperties *self, const gchar *name, const GValue *value)
McdAccount *account = MCD_ACCOUNT (self);
McdAccountPrivate *priv = account->priv;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
mcd_account_set_string_val (account, name, value);
}
@@ -675,7 +673,7 @@ set_enabled (TpSvcDBusProperties *self, const gchar *name, const GValue *value)
McdAccountPrivate *priv = account->priv;
gboolean enabled;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
enabled = g_value_get_boolean (value);
if (priv->enabled != enabled)
{
@@ -709,7 +707,7 @@ set_nickname (TpSvcDBusProperties *self, const gchar *name, const GValue *value)
McdAccount *account = MCD_ACCOUNT (self);
McdAccountPrivate *priv = account->priv;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
if (mcd_account_set_string_val (account, name, value))
g_signal_emit (account, _mcd_account_signals[ALIAS_CHANGED], 0,
g_value_get_string (value));
@@ -734,7 +732,7 @@ set_avatar (TpSvcDBusProperties *self, const gchar *name, const GValue *value)
GError *error = NULL;
gboolean changed;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
va = g_value_get_boxed (value);
avatar = g_value_get_boxed (va->values);
mime_type = g_value_get_string (va->values + 1);
@@ -787,18 +785,6 @@ get_parameters (TpSvcDBusProperties *self, const gchar *name, GValue *value)
}
static void
-get_preset_parameters (TpSvcDBusProperties *self, const gchar *name,
- GValue *value)
-{
- GHashTable *parameters;
-
- parameters = g_hash_table_new (g_str_hash, g_str_equal);
- g_warning ("Preset parameters not used in current implementation");
- g_value_init (value, TP_HASH_TYPE_STRING_VARIANT_MAP);
- g_value_take_boxed (value, parameters);
-}
-
-static void
set_automatic_presence (TpSvcDBusProperties *self,
const gchar *name, const GValue *value)
{
@@ -809,12 +795,12 @@ set_automatic_presence (TpSvcDBusProperties *self,
gboolean changed = FALSE;
GValueArray *va;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
va = g_value_get_boxed (value);
type = g_value_get_uint (va->values);
status = g_value_get_string (va->values + 1);
message = g_value_get_string (va->values + 2);
- g_debug ("setting automatic presence: %d, %s, %s", type, status, message);
+ DEBUG ("setting automatic presence: %d, %s, %s", type, status, message);
if (priv->auto_presence_type != type)
{
@@ -891,7 +877,7 @@ set_connect_automatically (TpSvcDBusProperties *self,
McdAccountPrivate *priv = account->priv;
gboolean connect_automatically;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
connect_automatically = g_value_get_boolean (value);
if (priv->connect_automatically != connect_automatically)
{
@@ -911,7 +897,7 @@ get_connect_automatically (TpSvcDBusProperties *self,
McdAccount *account = MCD_ACCOUNT (self);
McdAccountPrivate *priv = account->priv;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
g_value_init (value, G_TYPE_BOOLEAN);
g_value_set_boolean (value, priv->connect_automatically);
}
@@ -999,12 +985,12 @@ set_requested_presence (TpSvcDBusProperties *self,
gint type;
GValueArray *va;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
va = g_value_get_boxed (value);
type = (gint)g_value_get_uint (va->values);
status = g_value_get_string (va->values + 1);
message = g_value_get_string (va->values + 2);
- g_debug ("setting requested presence: %d, %s, %s", type, status, message);
+ DEBUG ("setting requested presence: %d, %s, %s", type, status, message);
if (mcd_account_request_presence_int (account, type, status, message))
{
@@ -1053,7 +1039,6 @@ static const McdDBusProp account_properties[] = {
{ "Enabled", set_enabled, get_enabled },
{ "Nickname", set_nickname, get_nickname },
{ "Parameters", NULL, get_parameters },
- { "PresetParameters", NULL, get_preset_parameters },
{ "AutomaticPresence", set_automatic_presence, get_automatic_presence },
{ "ConnectAutomatically", set_connect_automatically, get_connect_automatically },
{ "Connection", NULL, get_connection },
@@ -1105,7 +1090,7 @@ mc_param_type (const TpConnectionManagerParam *param)
case DBUS_TYPE_BOOLEAN:
return G_TYPE_BOOLEAN;
default:
- g_warning ("%s: skipping parameter %s, unknown type %s", G_STRFUNC,
+ g_warning ("skipping parameter %s, unknown type %s",
param->name, param->dbus_signature);
}
return G_TYPE_INVALID;
@@ -1122,7 +1107,7 @@ account_remove (McSvcAccount *self, DBusGMethodInvocation *context)
{
GError *error = NULL;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
if (!mcd_account_delete (MCD_ACCOUNT (self), &error))
{
if (!error)
@@ -1143,7 +1128,7 @@ mcd_account_check_parameters (McdAccount *account)
const TpConnectionManagerParam *param;
gboolean valid;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
param = mcd_manager_get_parameters (priv->manager, priv->protocol_name);
if (!param) return FALSE;
valid = TRUE;
@@ -1153,7 +1138,7 @@ mcd_account_check_parameters (McdAccount *account)
{
if (!mcd_account_get_parameter (account, param->name, NULL))
{
- g_debug ("missing required parameter %s", param->name);
+ DEBUG ("missing required parameter %s", param->name);
valid = FALSE;
break;
}
@@ -1193,7 +1178,7 @@ mcd_account_set_parameters (McdAccount *account, GHashTable *params,
GSList *dbus_properties = NULL;
gboolean reset_connection;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
if (G_UNLIKELY (!priv->manager && !load_manager (account)))
{
g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
@@ -1218,7 +1203,7 @@ mcd_account_set_parameters (McdAccount *account, GHashTable *params,
value = g_hash_table_lookup (params, param->name);
if (value)
{
- g_debug ("Got param %s", param->name);
+ DEBUG ("Got param %s", param->name);
if (G_VALUE_TYPE (value) != type)
{
/* FIXME: define proper error */
@@ -1238,7 +1223,7 @@ mcd_account_set_parameters (McdAccount *account, GHashTable *params,
if (!mcd_account_get_parameter (account, param->name, &old) ||
!value_is_same (value, &old))
{
- g_debug ("Parameter %s changed", param->name);
+ DEBUG ("Parameter %s changed", param->name);
/* can the param be updated on the fly? If yes, prepare to
* do so; and if not, prepare to reset the connection */
if (param->flags & TP_CONN_MGR_PARAM_FLAG_DBUS_PROPERTY)
@@ -1274,7 +1259,7 @@ mcd_account_set_parameters (McdAccount *account, GHashTable *params,
{
if (reset_connection)
{
- g_debug ("resetting connection");
+ DEBUG ("resetting connection");
mcd_connection_close (priv->connection);
mcd_account_connection_begin (account);
}
@@ -1285,7 +1270,7 @@ mcd_account_set_parameters (McdAccount *account, GHashTable *params,
for (list = dbus_properties; list != NULL; list = list->next)
{
name = list->data;
- g_debug ("updating parameter %s", name);
+ DEBUG ("updating parameter %s", name);
value = g_hash_table_lookup (params, name);
_mcd_connection_update_property (priv->connection, name, value);
}
@@ -1318,7 +1303,7 @@ account_update_parameters (McSvcAccount *self, GHashTable *set,
GValue value = { 0 };
GError *error = NULL;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
if (!mcd_account_set_parameters (account, set, &error))
{
@@ -1479,7 +1464,7 @@ _mcd_account_finalize (GObject *object)
{
McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (object);
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
if (priv->changed_properties)
g_hash_table_destroy (priv->changed_properties);
if (priv->property_values)
@@ -1509,7 +1494,7 @@ _mcd_account_dispose (GObject *object)
{
McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (object);
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
if (priv->online_requests)
{
GError *error;
@@ -1779,7 +1764,7 @@ mcd_account_get_parameters (McdAccount *account)
const TpConnectionManagerParam *param;
GHashTable *params;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
if (!priv->manager && !load_manager (account)) return NULL;
params = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -1974,7 +1959,7 @@ mcd_account_set_normalized_name (McdAccount *account, const gchar *name)
{
McdAccountPrivate *priv = account->priv;
- g_debug ("%s called (%s)", G_STRFUNC, name);
+ DEBUG ("called (%s)", name);
if (name)
g_key_file_set_string (priv->keyfile, priv->unique_name,
MC_ACCOUNTS_KEY_NORMALIZED_NAME, name);
@@ -1998,7 +1983,7 @@ mcd_account_set_avatar_token (McdAccount *account, const gchar *token)
{
McdAccountPrivate *priv = account->priv;
- g_debug ("%s called (%s)", G_STRFUNC, token);
+ DEBUG ("called (%s)", token);
if (token)
g_key_file_set_string (priv->keyfile, priv->unique_name,
MC_ACCOUNTS_KEY_AVATAR_TOKEN, token);
@@ -2025,7 +2010,7 @@ mcd_account_set_avatar (McdAccount *account, const GArray *avatar,
McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account);
gchar *data_dir, *filename;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
data_dir = get_account_data_path (priv);
filename = g_build_filename (data_dir, MC_AVATAR_FILENAME, NULL);
if (!g_file_test (data_dir, G_FILE_TEST_EXISTS))
@@ -2105,8 +2090,7 @@ mcd_account_get_avatar (McdAccount *account, GArray **avatar,
}
else
{
- g_debug ("%s: error reading %s: %s", G_STRFUNC,
- filename, error->message);
+ DEBUG ("error reading %s: %s", filename, error->message);
g_error_free (error);
}
}
@@ -2271,8 +2255,8 @@ mcd_account_check_validity (McdAccount *account)
if (valid != priv->valid)
{
GValue value = { 0 };
- g_debug ("Account validity changed (old: %d, new: %d)",
- priv->valid, valid);
+ DEBUG ("Account validity changed (old: %d, new: %d)",
+ priv->valid, valid);
priv->valid = valid;
g_signal_emit (account, _mcd_account_signals[VALIDITY_CHANGED], 0,
valid);
@@ -2327,8 +2311,8 @@ _mcd_account_online_request (McdAccount *account,
McdAccountPrivate *priv = account->priv;
GError *error = NULL;
- g_debug ("%s: connection status for %s is %d",
- G_STRFUNC, priv->unique_name, priv->conn_status);
+ DEBUG ("connection status for %s is %d",
+ priv->unique_name, priv->conn_status);
if (priv->conn_status == TP_CONNECTION_STATUS_CONNECTED)
{
/* invoke the callback now */
@@ -2375,7 +2359,7 @@ mcd_account_get_avatar_filename (McdAccount *account)
gchar *data_dir, *filename;
data_dir = get_account_data_path (priv);
- g_debug("data dir: %s", data_dir);
+ DEBUG("data dir: %s", data_dir);
filename = g_build_filename (data_dir, MC_AVATAR_FILENAME, NULL);
g_free (data_dir);
return filename;
diff --git a/src/mcd-channel.c b/src/mcd-channel.c
index 35cf5c0c..edab637d 100644
--- a/src/mcd-channel.c
+++ b/src/mcd-channel.c
@@ -115,7 +115,7 @@ channel_request_data_free (McdChannelRequestData *crd)
{
GList *list;
- g_debug ("%s called for %p", G_STRFUNC, crd);
+ DEBUG ("called for %p", crd);
g_hash_table_unref (crd->properties);
g_free (crd->preferred_handler);
list = crd->paths;
@@ -137,23 +137,23 @@ on_members_changed (TpChannel *proxy, const gchar *message,
TpHandle self_handle;
guint i;
- g_debug ("%s called (actor %u, reason %u, self_handle %u)", G_STRFUNC,
- actor, reason, tp_channel_group_get_self_handle (proxy));
+ DEBUG ("called (actor %u, reason %u, self_handle %u)",
+ actor, reason, tp_channel_group_get_self_handle (proxy));
self_handle = tp_channel_group_get_self_handle (proxy);
if (added && added->len > 0)
{
- g_debug ("%u added members", added->len);
+ DEBUG ("%u added members", added->len);
for (i = 0; i < added->len; i++)
{
guint added_member = g_array_index (added, guint, i);
- g_debug ("added member %u", added_member);
+ DEBUG ("added member %u", added_member);
/* see whether we are the added member */
if (added_member == self_handle)
{
- g_debug ("This should appear only when the call was accepted");
+ DEBUG ("This should appear only when the call was accepted");
priv->members_accepted = TRUE;
g_signal_emit_by_name (channel, "members-accepted");
break;
@@ -165,7 +165,7 @@ on_members_changed (TpChannel *proxy, const gchar *message,
{
for (i = 0; i < removed->len; i++)
{
- g_debug ("removed member %u", g_array_index (removed, guint, i));
+ DEBUG ("removed member %u", g_array_index (removed, guint, i));
if (actor == g_array_index (removed, guint, i))
{
/* the remote removed itself; if we didn't accept the call,
@@ -183,14 +183,14 @@ proxy_destroyed (TpProxy *self, guint domain, gint code, gchar *message,
{
McdChannel *channel = user_data;
- g_debug ("Channel proxy destroyed (%s)!", message);
+ DEBUG ("Channel proxy destroyed (%s)!", message);
/*
McdChannelPrivate *priv = channel->priv;
g_object_unref (priv->tp_chan);
priv->tp_chan = NULL;
*/
mcd_mission_abort (MCD_MISSION (channel));
- g_debug ("Channel closed");
+ DEBUG ("Channel closed");
}
static inline void
@@ -216,13 +216,13 @@ on_channel_ready (TpChannel *tp_chan, const GError *error, gpointer user_data)
g_slice_free (McdChannel *, channel_ptr);
if (error)
{
- g_debug ("%s got error: %s", G_STRFUNC, error->message);
+ DEBUG ("got error: %s", error->message);
return;
}
if (!channel) return;
- g_debug ("channel %p is ready", channel);
+ DEBUG ("channel %p is ready", channel);
priv = channel->priv;
requested = tp_asv_get_boolean
(tp_channel_borrow_immutable_properties (tp_chan),
@@ -246,7 +246,7 @@ mcd_channel_close (McdChannel *channel)
tp_channel_get_channel_type_id (priv->tp_chan) !=
TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_LIST)
{
- g_debug ("%s: Requesting telepathy to close the channel", G_STRFUNC);
+ DEBUG ("Requesting telepathy to close the channel");
tp_cli_channel_call_close (priv->tp_chan, -1, NULL, NULL, NULL, NULL);
}
}
@@ -352,7 +352,7 @@ _mcd_channel_dispose (GObject * object)
{
McdChannelPrivate *priv = MCD_CHANNEL_PRIV (object);
- g_debug ("\n\n%s for %p (is disposed = %d)", G_STRFUNC, object, priv->is_disposed);
+ DEBUG ("%p (is disposed = %d)", object, priv->is_disposed);
if (priv->is_disposed)
return;
@@ -375,10 +375,10 @@ mcd_channel_abort (McdMission *mission)
McdChannel *channel = MCD_CHANNEL (mission);
McdChannelPrivate *priv = channel->priv;
- g_debug ("%s: %p", G_STRFUNC, mission);
+ DEBUG ("%p", mission);
if (priv->is_aborted)
{
- g_debug ("Already aborted");
+ DEBUG ("Already aborted");
return;
}
priv->is_aborted = TRUE;
@@ -626,7 +626,7 @@ _mcd_channel_create_proxy (McdChannel *channel, TpConnection *connection,
void
mcd_channel_set_status (McdChannel *channel, McdChannelStatus status)
{
- g_debug ("%s: %p, %u", G_STRFUNC, channel, status);
+ DEBUG ("%p, %u", channel, status);
g_return_if_fail(MCD_IS_CHANNEL(channel));
if (status != channel->priv->status)
@@ -1172,8 +1172,7 @@ copy_status (McdChannel *source, McdChannel *dest)
dst_priv = dest->priv;
if (dst_priv->status != src_priv->status)
{
- g_debug ("%s: source is %d, dest is %d", G_STRFUNC,
- src_priv->status, dst_priv->status);
+ DEBUG ("source is %d, dest is %d", src_priv->status, dst_priv->status);
if (src_priv->status == MCD_CHANNEL_STATUS_FAILED)
{
const GError *error;
diff --git a/src/mcd-connection.c b/src/mcd-connection.c
index 17dafac9..2543f1ae 100644
--- a/src/mcd-connection.c
+++ b/src/mcd-connection.c
@@ -271,9 +271,9 @@ _check_presence (McdConnectionPrivate *priv, TpConnectionPresenceType presence,
if (*fallbacks == NULL)
*fallbacks = "available";
- g_debug ("%s: account %s: presence %s not supported, setting %s",
- G_STRFUNC, mcd_account_get_unique_name (priv->account),
- *status, *fallbacks);
+ DEBUG ("account %s: presence %s not supported, setting %s",
+ mcd_account_get_unique_name (priv->account),
+ *status, *fallbacks);
*status = *fallbacks;
return TRUE;
}
@@ -328,8 +328,7 @@ presence_get_statuses_cb (TpProxy *proxy, const GValue *v_statuses,
g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
(GDestroyNotify)mcd_presence_info_free);
- g_debug ("%s: account %s:",
- G_STRFUNC, mcd_account_get_unique_name (priv->account));
+ DEBUG ("account %s:", mcd_account_get_unique_name (priv->account));
statuses = g_value_get_boxed (v_statuses);
g_hash_table_iter_init (&iter, statuses);
while (g_hash_table_iter_next (&iter, &ht_key, &ht_value))
@@ -338,7 +337,7 @@ presence_get_statuses_cb (TpProxy *proxy, const GValue *v_statuses,
McdPresenceInfo *pi;
status = ht_key;
- g_debug (" %s", status);
+ DEBUG (" %s", status);
pi = g_slice_new (McdPresenceInfo);
pi->presence = g_value_get_uint (va->values);
@@ -434,7 +433,7 @@ on_presence_requested (McdAccount *account,
McdConnection *connection = MCD_CONNECTION (user_data);
McdConnectionPrivate *priv = connection->priv;
- g_debug ("Presence requested: %d", presence);
+ DEBUG ("Presence requested: %d", presence);
if (presence == TP_CONNECTION_PRESENCE_TYPE_UNSET) return;
if (presence == TP_CONNECTION_PRESENCE_TYPE_OFFLINE)
@@ -524,8 +523,9 @@ on_capabilities_changed (TpConnection *proxy, const GPtrArray *caps,
TpProxyPendingCall *call;
guint i;
- g_debug ("%s: got capabilities for channel %p handle %d, type %s",
- G_STRFUNC, channel, mcd_channel_get_handle (channel), mcd_channel_get_channel_type (channel));
+ DEBUG ("got capabilities for channel %p handle %d, type %s",
+ channel, mcd_channel_get_handle (channel),
+ mcd_channel_get_channel_type (channel));
type = dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT, G_TYPE_STRING,
G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT,
G_TYPE_UINT, G_TYPE_INVALID);
@@ -551,8 +551,8 @@ on_capabilities_changed (TpConnection *proxy, const GPtrArray *caps,
if (g_object_get_data (G_OBJECT (channel), "tp_chan_call") != NULL)
goto done;
chan_handle_type = mcd_channel_get_handle_type (channel);
- g_debug ("%s: requesting channel again (type = %s, handle_type = %u, handle = %u)",
- G_STRFUNC, chan_type, chan_handle_type, chan_handle);
+ DEBUG ("requesting channel again (type = %s, handle_type = %u, handle = %u)",
+ chan_type, chan_handle_type, chan_handle);
call = tp_cli_connection_call_request_channel (priv->tp_conn, -1,
chan_type,
chan_handle_type,
@@ -577,7 +577,7 @@ on_channel_capabilities_timeout (McdChannel *channel,
/* We reach this point if this channel was waiting for capabilities; we
* abort it and return the original error */
- g_debug ("%s: channel %p timed out, returning error!", G_STRFUNC, channel);
+ DEBUG ("channel %p timed out, returning error!", channel);
mc_error = map_tp_error_to_mc_error (channel, cwd->error);
mcd_channel_take_error (channel, mc_error);
@@ -595,7 +595,7 @@ on_capabilities_timeout (McdConnection *connection)
McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection);
const GList *list, *list_curr;
- g_debug ("%s: got_capabilities is %d", G_STRFUNC, priv->got_capabilities);
+ DEBUG ("got_capabilities is %d", priv->got_capabilities);
priv->got_capabilities = TRUE;
list = mcd_operation_get_missions ((McdOperation *)connection);
while (list)
@@ -641,14 +641,14 @@ _mcd_connection_setup_capabilities (McdConnection *connection)
if (!priv->has_capabilities_if)
{
- g_debug ("%s: connection does not support capabilities interface", G_STRFUNC);
+ DEBUG ("connection does not support capabilities interface");
priv->got_capabilities = TRUE;
return;
}
protocol_name = mcd_account_get_protocol_name (priv->account);
capabilities = mcd_dispatcher_get_channel_capabilities (priv->dispatcher,
protocol_name);
- g_debug ("%s: advertising capabilities", G_STRFUNC);
+ DEBUG ("advertising capabilities");
tp_cli_connection_interface_capabilities_call_advertise_capabilities (priv->tp_conn, -1,
capabilities,
&removed,
@@ -680,18 +680,18 @@ _mcd_connection_setup_contact_capabilities (McdConnection *connection)
if (!priv->has_contact_capabilities_if)
{
- g_debug ("%s: connection does not support contact capabilities interface", G_STRFUNC);
+ DEBUG ("connection does not support contact capabilities interface");
priv->got_contact_capabilities = TRUE;
return;
}
contact_capabilities = mcd_dispatcher_get_channel_enhanced_capabilities
(priv->dispatcher);
- g_debug ("%s: advertising capabilities", G_STRFUNC);
+ DEBUG ("advertising capabilities");
mc_cli_connection_interface_contact_capabilities_call_set_self_capabilities
(priv->tp_conn, -1, contact_capabilities, NULL, NULL, NULL, NULL);
- g_debug ("SetSelfCapabilities: Called.");
+ DEBUG ("SetSelfCapabilities: Called.");
/* free the connection capabilities (FIXME) */
g_ptr_array_free (contact_capabilities, TRUE);
@@ -748,7 +748,7 @@ avatars_set_avatar_cb (TpConnection *proxy, const gchar *token,
g_warning ("%s: error: %s", G_STRFUNC, error->message);
return;
}
- g_debug ("%s: received token: %s", G_STRFUNC, token);
+ DEBUG ("received token: %s", token);
mcd_account_set_avatar_token (priv->account, token);
}
@@ -758,7 +758,7 @@ avatars_clear_avatar_cb (TpConnection *proxy, const GError *error,
{
if (!error)
{
- g_debug ("%s: Clear avatar succeeded", G_STRFUNC);
+ DEBUG ("Clear avatar succeeded");
}
else
{
@@ -779,12 +779,12 @@ on_avatar_retrieved (TpConnection *proxy, guint contact_id, const gchar *token,
/* if we are setting the avatar, we must ignore this signal */
if (priv->setting_avatar) return;
- g_debug ("%s: Avatar retrieved for contact %d, token: %s", G_STRFUNC, contact_id, token);
+ DEBUG ("Avatar retrieved for contact %d, token: %s", contact_id, token);
prev_token = mcd_account_get_avatar_token (priv->account);
if (!prev_token || strcmp (token, prev_token) != 0)
{
- g_debug ("%s: received mime-type: %s", G_STRFUNC, mime_type);
+ DEBUG ("received mime-type: %s", mime_type);
mcd_account_set_avatar (priv->account, avatar, mime_type, token, NULL);
}
g_free (prev_token);
@@ -813,13 +813,13 @@ on_avatar_updated (TpConnection *proxy, guint contact_id, const gchar *token,
/* if we are setting the avatar, we must ignore this signal */
if (priv->setting_avatar) return;
- g_debug ("%s: contact %d, token: %s", G_STRFUNC, contact_id, token);
+ DEBUG ("contact %d, token: %s", contact_id, token);
prev_token = mcd_account_get_avatar_token (priv->account);
if (!prev_token || strcmp (token, prev_token) != 0)
{
GArray handles;
- g_debug ("%s: avatar has changed", G_STRFUNC);
+ DEBUG ("avatar has changed");
/* the avatar has changed, let's retrieve the new one */
handles.len = 1;
handles.data = (gchar *)&contact_id;
@@ -838,7 +838,7 @@ _mcd_connection_set_avatar (McdConnection *connection, const GArray *avatar,
{
McdConnectionPrivate *priv = connection->priv;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
if (avatar->len > 0 && avatar->len < G_MAXUINT)
{
tp_cli_connection_interface_avatars_call_set_avatar (priv->tp_conn, -1,
@@ -882,7 +882,7 @@ avatars_request_tokens_cb (TpConnection *proxy, GHashTable *tokens,
mcd_account_get_avatar (priv->account, &avatar, &mime_type);
if (avatar)
{
- g_debug ("No avatar set, setting our own");
+ DEBUG ("No avatar set, setting our own");
_mcd_connection_set_avatar (connection, avatar, mime_type);
g_array_free (avatar, TRUE);
}
@@ -934,7 +934,7 @@ _mcd_connection_setup_avatar (McdConnection *connection)
GArray handles;
TpHandle self_handle;
- g_debug ("checking for server token");
+ DEBUG ("checking for server token");
/* Set the avatar only if no other one was set */
self_handle = tp_connection_get_self_handle (priv->tp_conn);
handles.len = 1;
@@ -960,7 +960,7 @@ on_aliases_changed (TpConnection *proxy, const GPtrArray *aliases,
guint contact;
guint i;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
type = dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT, G_TYPE_STRING,
G_TYPE_INVALID);
for (i = 0; i < aliases->len; i++)
@@ -970,10 +970,10 @@ on_aliases_changed (TpConnection *proxy, const GPtrArray *aliases,
g_value_init (&data, type);
g_value_set_static_boxed (&data, g_ptr_array_index(aliases, i));
dbus_g_type_struct_get (&data, 0, &contact, 1, &alias, G_MAXUINT);
- g_debug("Got alias for contact %u: %s", contact, alias);
+ DEBUG ("Got alias for contact %u: %s", contact, alias);
if (contact == tp_connection_get_self_handle (proxy))
{
- g_debug("This is our alias");
+ DEBUG ("This is our alias");
if (!priv->alias || strcmp (priv->alias, alias) != 0)
{
g_free (priv->alias);
@@ -1004,7 +1004,7 @@ _mcd_connection_set_alias (McdConnection *connection,
GHashTable *aliases;
TpHandle self_handle;
- g_debug ("%s: setting alias '%s'", G_STRFUNC, alias);
+ DEBUG ("setting alias '%s'", alias);
aliases = g_hash_table_new (NULL, NULL);
self_handle = tp_connection_get_self_handle (priv->tp_conn);
@@ -1048,7 +1048,7 @@ _mcd_connection_setup_alias (McdConnection *connection)
static gboolean
mcd_connection_reconnect (McdConnection *connection)
{
- g_debug ("%s: %p", G_STRFUNC, connection);
+ DEBUG ("%p", connection);
mcd_connection_connect (connection, NULL);
return FALSE;
}
@@ -1065,7 +1065,7 @@ on_connection_status_changed (TpConnection *tp_conn, GParamSpec *pspec,
"status", &conn_status,
"status-reason", &conn_reason,
NULL);
- g_debug ("%s: status_changed called from tp (%d)", G_STRFUNC, conn_status);
+ DEBUG ("status_changed called from tp (%d)", conn_status);
switch (conn_status)
{
@@ -1107,7 +1107,7 @@ static void proxy_destroyed (DBusGProxy *tp_conn, guint domain, gint code,
gchar *message, McdConnection *connection)
{
McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection);
- g_debug ("Proxy destroyed (%s)!", message);
+ DEBUG ("Proxy destroyed (%s)!", message);
_mcd_connection_release_tp_connection (connection);
@@ -1128,7 +1128,7 @@ static void proxy_destroyed (DBusGProxy *tp_conn, guint domain, gint code,
* abort the connection but try to reconnect later */
if (priv->reconnect_timer == 0)
{
- g_debug ("Preparing for reconnection");
+ DEBUG ("Preparing for reconnection");
priv->reconnect_timer = g_timeout_add_seconds
(priv->reconnect_interval,
(GSourceFunc)mcd_connection_reconnect, connection);
@@ -1153,7 +1153,7 @@ connect_cb (TpConnection *tp_conn, const GError *error,
{
McdConnection *connection = MCD_CONNECTION (weak_object);
- g_debug ("%s called for connection %p", G_STRFUNC, connection);
+ DEBUG ("called for connection %p", connection);
if (error)
{
@@ -1169,7 +1169,7 @@ request_unrequested_channels (McdConnection *connection)
channels = mcd_operation_get_missions ((McdOperation *)connection);
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
/* go through the channels that were requested while the connection was not
* ready, and process them */
while (channels)
@@ -1178,7 +1178,7 @@ request_unrequested_channels (McdConnection *connection)
if (mcd_channel_get_status (channel) == MCD_CHANNEL_STATUS_REQUEST)
{
- g_debug ("Requesting channel %p", channel);
+ DEBUG ("Requesting channel %p", channel);
mcd_connection_request_channel (connection, channel);
}
channels = channels->next;
@@ -1194,7 +1194,7 @@ dispatch_undispatched_channels (McdConnection *connection)
priv->can_dispatch = TRUE;
channels = mcd_operation_get_missions ((McdOperation *)connection);
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
while (channels)
{
McdChannel *channel = MCD_CHANNEL (channels->data);
@@ -1216,7 +1216,7 @@ dispatch_undispatched_channels (McdConnection *connection)
tcd->object_path, tcd->channel_type,
tcd->handle, tcd->handle_type);
g_object_set_data (G_OBJECT (channel), MCD_TMP_CHANNEL_DATA, NULL);
- g_debug ("Dispatching channel %p", channel);
+ DEBUG ("Dispatching channel %p", channel);
/* dispatch the channel */
_mcd_dispatcher_send_channels (priv->dispatcher,
g_list_prepend (NULL, channel),
@@ -1312,7 +1312,7 @@ mcd_connection_recover_channel (McdConnection *connection,
McdConnectionPrivate *priv = connection->priv;
McdChannel *channel;
- g_debug ("%s called for %s", G_STRFUNC, object_path);
+ DEBUG ("called for %s", object_path);
channel = mcd_channel_new_from_properties (priv->tp_conn, object_path,
properties);
if (G_UNLIKELY (!channel)) return;
@@ -1446,13 +1446,13 @@ on_connection_ready (TpConnection *tp_conn, const GError *error,
g_slice_free (McdConnection *, connection_ptr);
if (error)
{
- g_debug ("%s got error: %s", G_STRFUNC, error->message);
+ DEBUG ("got error: %s", error->message);
return;
}
if (!connection) return;
- g_debug ("%s: connection is ready", G_STRFUNC);
+ DEBUG ("connection is ready");
priv = MCD_CONNECTION_PRIV (connection);
_mcd_connection_get_normalized_name (connection);
@@ -1537,8 +1537,8 @@ _mcd_connection_connect_with_params (McdConnection *connection,
protocol_name = mcd_account_get_protocol_name (priv->account);
- g_debug ("%s: Trying connect account: %s",
- G_STRFUNC, mcd_account_get_unique_name (priv->account));
+ DEBUG ("Trying connect account: %s",
+ mcd_account_get_unique_name (priv->account));
mcd_account_set_connection_status (priv->account,
TP_CONNECTION_STATUS_CONNECTING,
@@ -1570,7 +1570,7 @@ _mcd_connection_release_tp_connection (McdConnection *connection)
{
McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection);
- g_debug ("%s(%p) called", G_STRFUNC, connection);
+ DEBUG ("%p", connection);
mcd_account_set_current_presence (priv->account,
TP_CONNECTION_PRESENCE_TYPE_OFFLINE,
"offline", NULL);
@@ -1605,7 +1605,7 @@ _mcd_connection_release_tp_connection (McdConnection *connection)
static void
on_account_removed (McdAccount *account, McdConnection *connection)
{
- g_debug ("Account %s removed, aborting connection",
+ DEBUG ("Account %s removed, aborting connection",
mcd_account_get_unique_name (account));
mcd_mission_abort (MCD_MISSION (connection));
}
@@ -1616,7 +1616,7 @@ _mcd_connection_dispose (GObject * object)
McdConnection *connection = MCD_CONNECTION (object);
McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection);
- g_debug ("%s called for object %p", G_STRFUNC, object);
+ DEBUG ("called for object %p", object);
if (priv->is_disposed)
{
@@ -2022,7 +2022,7 @@ remove_capabilities_refs (gpointer data)
{
struct capabilities_wait_data *cwd = data;
- g_debug ("\n\n\n%s called\n\n\n", G_STRFUNC);
+ DEBUG ("called");
tp_proxy_signal_connection_disconnect (cwd->signal_connection);
g_error_free (cwd->error);
g_free (cwd);
@@ -2062,7 +2062,7 @@ request_channel_cb (TpConnection *proxy, const gchar *channel_path,
if (tp_error != NULL)
{
- g_debug ("%s: Got error: %s", G_STRFUNC, tp_error->message);
+ DEBUG ("got error: %s", tp_error->message);
if (error_on_creation != NULL)
{
/* replace the error, so that the initial one is reported */
@@ -2081,8 +2081,8 @@ request_channel_cb (TpConnection *proxy, const gchar *channel_path,
/* the channel request has failed probably because we are just
* connected and we didn't recive the contact capabilities yet. In
* this case, wait for this contact's capabilities to arrive */
- g_debug ("%s: listening for remote capabilities on channel handle %d, type %d",
- G_STRFUNC, chan_handle, mcd_channel_get_handle_type (channel));
+ DEBUG ("listening for remote capabilities on channel handle %d, type %d",
+ chan_handle, mcd_channel_get_handle_type (channel));
/* Store the error, we might need it later */
cwd = g_malloc (sizeof (struct capabilities_wait_data));
cwd->error = g_error_copy (tp_error);
@@ -2166,7 +2166,7 @@ request_handles_cb (TpConnection *proxy, const GArray *handles,
chan_handle_type = mcd_channel_get_handle_type (channel),
chan_handle = g_array_index (handles, guint, 0);
- g_debug ("Got handle %u", chan_handle);
+ DEBUG ("Got handle %u", chan_handle);
/* Check if a telepathy channel has already been created; this could happen
* in the case we had a chat window open, the UI crashed and now the same
@@ -2178,15 +2178,15 @@ request_handles_cb (TpConnection *proxy, const GArray *handles,
if (chan_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA) break;
existing_channel = MCD_CHANNEL (channels->data);
- g_debug ("Chan: %d, handle type %d, channel type %s",
- mcd_channel_get_handle (existing_channel),
- mcd_channel_get_handle_type (existing_channel),
- mcd_channel_get_channel_type (existing_channel));
+ DEBUG ("Chan: %d, handle type %d, channel type %s",
+ mcd_channel_get_handle (existing_channel),
+ mcd_channel_get_handle_type (existing_channel),
+ mcd_channel_get_channel_type (existing_channel));
if (chan_handle == mcd_channel_get_handle (existing_channel) &&
chan_handle_type == mcd_channel_get_handle_type (existing_channel) &&
chan_type == mcd_channel_get_channel_type_quark (existing_channel))
{
- g_debug ("%s: Channel already existing, returning old one", G_STRFUNC);
+ DEBUG ("Channel already existing, returning old one");
/* FIXME: this situation is weird. We should have checked for the
* existance of the channel _before_ getting here, already when
* creating the request */
@@ -2224,13 +2224,13 @@ common_request_channel_cb (TpConnection *proxy, gboolean yours,
/* No special handling of "no capabilities" error: being confident that
* https://bugs.freedesktop.org/show_bug.cgi?id=15769 will be fixed
* soon :-) */
- g_debug ("%s: Got error: %s", G_STRFUNC, error->message);
+ DEBUG ("got error: %s", error->message);
mc_error = map_tp_error_to_mc_error (channel, error);
mcd_channel_take_error (channel, mc_error);
mcd_mission_abort ((McdMission *)channel);
return;
}
- g_debug ("%s: %p, object %s", G_STRFUNC, channel, channel_path);
+ DEBUG ("%p, object %s", channel, channel_path);
/* if this was a call to EnsureChannel, it can happen that the returned
* channel was already created before; in that case we keep the McdChannel
@@ -2259,7 +2259,7 @@ common_request_channel_cb (TpConnection *proxy, gboolean yours,
/* if the channel request was cancelled, abort the channel now */
if (mcd_channel_get_status (channel) == MCD_CHANNEL_STATUS_FAILED)
{
- g_debug ("Channel %p was cancelled, aborting", channel);
+ DEBUG ("Channel %p was cancelled, aborting", channel);
mcd_mission_abort (MCD_MISSION (channel));
}
@@ -2405,14 +2405,14 @@ mcd_connection_cancel_channel_request (McdConnection *connection,
if (chan_requestor_serial == operation_id &&
strcmp (chan_requestor_client_id, requestor_client_id) == 0)
{
- g_debug ("%s: requested channel found (%p)", G_STRFUNC, channel);
+ DEBUG ("requested channel found (%p)", channel);
mcd_mission_abort (MCD_MISSION (channel));
g_free (chan_requestor_client_id);
return TRUE;
}
g_free (chan_requestor_client_id);
}
- g_debug ("%s: requested channel not found!", G_STRFUNC);
+ DEBUG ("requested channel not found!");
return FALSE;
}
@@ -2432,7 +2432,7 @@ gboolean mcd_connection_remote_avatar_changed (McdConnection *connection,
guint contact_id,
const gchar *token)
{
- g_debug ("%s called, but it's a stub", G_STRFUNC);
+ DEBUG ("called, but it's a stub");
return FALSE;
}
@@ -2462,8 +2462,8 @@ mcd_connection_connect (McdConnection *connection, GHashTable *params)
g_return_if_fail (priv->tp_conn_mgr);
g_return_if_fail (priv->account);
- g_debug ("%s called for %p, account %s", G_STRFUNC, connection,
- mcd_account_get_unique_name (priv->account));
+ DEBUG ("called for %p, account %s", connection,
+ mcd_account_get_unique_name (priv->account));
if (priv->reconnect_timer)
{
@@ -2484,8 +2484,8 @@ mcd_connection_connect (McdConnection *connection, GHashTable *params)
}
else
{
- g_debug ("%s: Not connecting because not disconnected (%i)",
- G_STRFUNC, mcd_connection_get_connection_status (connection));
+ DEBUG ("Not connecting because not disconnected (%i)",
+ mcd_connection_get_connection_status (connection));
}
}
diff --git a/src/mcd-controller.c b/src/mcd-controller.c
index 1432be13..fc8bb520 100644
--- a/src/mcd-controller.c
+++ b/src/mcd-controller.c
@@ -106,9 +106,9 @@ mcd_controller_shutdown (McdController *controller, const gchar *reason)
if(!priv->shutdown_timeout_id)
{
- g_debug ("MC will bail out because of \"%s\" out exit after %i",
- reason ? reason : "No reason specified",
- EXIT_COUNTDOWN_TIME);
+ DEBUG ("MC will bail out because of \"%s\" out exit after %i",
+ reason ? reason : "No reason specified",
+ EXIT_COUNTDOWN_TIME);
priv->shutdown_timeout_id = g_timeout_add (EXIT_COUNTDOWN_TIME,
_mcd_controller_exit_by_timeout,
@@ -116,8 +116,8 @@ mcd_controller_shutdown (McdController *controller, const gchar *reason)
}
else
{
- g_debug ("Already shutting down. This one has the reason %s",
- reason ? reason:"No reason specified");
+ DEBUG ("Already shutting down. This one has the reason %s",
+ reason ? reason:"No reason specified");
}
mcd_debug_print_tree (controller);
}
@@ -132,7 +132,7 @@ mcd_controller_cancel_shutdown (McdController *controller)
if (priv->shutdown_timeout_id)
{
- g_debug ("Cancelling exit timeout");
+ DEBUG ("Cancelling exit timeout");
g_source_remove (priv->shutdown_timeout_id);
priv->shutdown_timeout_id = 0;
}
diff --git a/src/mcd-dbusprop.c b/src/mcd-dbusprop.c
index 50cc4ba0..4fb2d24f 100644
--- a/src/mcd-dbusprop.c
+++ b/src/mcd-dbusprop.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <telepathy-glib/errors.h>
#include "mcd-dbusprop.h"
+#include "mcd-debug.h"
#include <_gen/interfaces.h>
#include <_gen/interfaces-body.h>
#include <_gen/gtypes.h>
@@ -76,7 +77,7 @@ mcd_dbusprop_set_property (TpSvcDBusProperties *self,
{
const McdDBusProp *prop_array, *property;
- g_debug ("%s: %s, %s", G_STRFUNC, interface_name, property_name);
+ DEBUG ("%s, %s", interface_name, property_name);
prop_array = get_interface_properties (self, interface_name);
if (!prop_array)
@@ -175,7 +176,7 @@ dbusprop_get (TpSvcDBusProperties *self,
GValue value = { 0 };
GError *error = NULL;
- g_debug ("%s: %s, %s", G_STRFUNC, interface_name, property_name);
+ DEBUG ("%s, %s", interface_name, property_name);
mcd_dbusprop_get_property (self, interface_name, property_name,
&value, &error);
@@ -208,7 +209,7 @@ dbusprop_get_all (TpSvcDBusProperties *self,
GHashTable *properties;
GError *error = NULL;
- g_debug ("%s: %s", G_STRFUNC, interface_name);
+ DEBUG ("%s", interface_name);
prop_array = get_interface_properties (self, interface_name);
if (!prop_array)
@@ -276,7 +277,7 @@ mcd_dbus_get_interfaces (TpSvcDBusProperties *self, const gchar *name,
GPtrArray *a_ifaces;
GType type;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
a_ifaces = g_ptr_array_new ();
diff --git a/src/mcd-debug.c b/src/mcd-debug.c
index c3c4482b..30d2e2de 100644
--- a/src/mcd-debug.c
+++ b/src/mcd-debug.c
@@ -38,7 +38,7 @@
#include "mcd-debug.h"
#include "mcd-operation.h"
-static gint mc_debug = 0;
+gint mcd_debug_level = 0;
gpointer
mcd_debug_ref (gpointer obj, const gchar *filename, gint linenum)
@@ -47,7 +47,7 @@ mcd_debug_ref (gpointer obj, const gchar *filename, gint linenum)
gpointer (*untouchable_ref) (gpointer object);
untouchable_ref = g_object_ref;
- if (mc_debug >= 2)
+ if (mcd_debug_level >= 2)
g_debug ("[%s:%d]: Referencing (%d) object %p of type %s",
filename, linenum, G_OBJECT (obj)->ref_count,
obj, G_OBJECT_TYPE_NAME(obj));
@@ -60,7 +60,7 @@ mcd_debug_unref (gpointer obj, const gchar *filename, gint linenum)
void (*untouchable_unref) (gpointer object);
untouchable_unref = g_object_unref;
- if (mc_debug >= 2)
+ if (mcd_debug_level >= 2)
g_debug ("[%s:%d]: Unreferencing (%d) object %p of type %s",
filename, linenum, G_OBJECT (obj)->ref_count, obj,
G_OBJECT_TYPE_NAME(obj));
@@ -102,7 +102,7 @@ mcd_debug_print_tree (gpointer object)
{
g_return_if_fail (MCD_IS_MISSION (object));
- if (mc_debug >= 2)
+ if (mcd_debug_level >= 2)
{
g_debug ("Object Hierarchy of object %p", object);
g_debug ("[");
@@ -117,11 +117,12 @@ void mcd_debug_init ()
mc_debug_str = getenv ("MC_DEBUG");
if (mc_debug_str)
- mc_debug = atoi (mc_debug_str);
+ mcd_debug_level = atoi (mc_debug_str);
}
-inline gint mcd_debug_get_level ()
+void
+mcd_debug_set_level (gint level)
{
- return mc_debug;
+ mcd_debug_level = level;
}
diff --git a/src/mcd-debug.h b/src/mcd-debug.h
index af6bf7f2..cce9c2ac 100644
--- a/src/mcd-debug.h
+++ b/src/mcd-debug.h
@@ -31,12 +31,36 @@
G_BEGIN_DECLS
+#undef DEBUG
+
+#ifdef ENABLE_DEBUG
+
+#define DEBUG(format, ...) G_STMT_START { \
+ if (_mcd_debug_get_level () > 0) \
+ g_debug ("%s: " format, G_STRFUNC, ##__VA_ARGS__); \
+} G_STMT_END
+
+/* reference count debugging */
+#ifndef g_object_ref
#define g_object_ref(obj) (mcd_debug_ref (obj, __FILE__, __LINE__))
#define g_object_unref(obj) (mcd_debug_unref (obj, __FILE__, __LINE__))
+#endif
+
+#else /* !defined ENABLE_DEBUG */
+
+#define DEBUG(format, ...) do {} while (0)
+
+#endif /* ENABLE_DEBUG */
+
+extern gint mcd_debug_level;
void mcd_debug_init (void);
-inline gint mcd_debug_get_level (void);
+void mcd_debug_set_level (gint level);
+static inline gint _mcd_debug_get_level (void)
+{
+ return mcd_debug_level;
+}
gpointer mcd_debug_ref (gpointer obj, const gchar *filename, gint linenum);
void mcd_debug_unref (gpointer obj, const gchar *filename, gint linenum);
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 622fafab..389ab6fc 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -98,7 +98,7 @@ get_connection (TpSvcDBusProperties *self, const gchar *name, GValue *value)
McdDispatchOperationPrivate *priv = MCD_DISPATCH_OPERATION_PRIV (self);
const gchar *object_path;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
g_value_init (value, DBUS_TYPE_G_OBJECT_PATH);
if (priv->connection &&
(object_path = mcd_connection_get_object_path (priv->connection)))
@@ -114,7 +114,7 @@ get_account (TpSvcDBusProperties *self, const gchar *name, GValue *value)
McdAccount *account;
const gchar *object_path;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
g_value_init (value, DBUS_TYPE_G_OBJECT_PATH);
if (priv->connection &&
(account = mcd_connection_get_account (priv->connection)) &&
@@ -131,7 +131,7 @@ get_channels (TpSvcDBusProperties *self, const gchar *name, GValue *value)
GPtrArray *channel_array;
GList *list;
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
channel_array = g_ptr_array_sized_new (g_list_length (priv->channels));
for (list = priv->channels; list != NULL; list = list->next)
@@ -163,7 +163,7 @@ get_possible_handlers (TpSvcDBusProperties *self, const gchar *name,
{
McdDispatchOperationPrivate *priv = MCD_DISPATCH_OPERATION_PRIV (self);
- g_debug ("%s called for %s", G_STRFUNC, priv->unique_name);
+ DEBUG ("called for %s", priv->unique_name);
g_value_init (value, G_TYPE_STRV);
g_warning ("%s not implemented", G_STRFUNC);
g_value_set_static_boxed (value, NULL);
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 51fa5a3a..8ba8ac1a 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -259,8 +259,7 @@ static inline void
mcd_dispatcher_context_ref (McdDispatcherContext *context)
{
g_return_if_fail (context != NULL);
- g_debug ("%s called on %p (ref = %d)", G_STRFUNC,
- context, context->ref_count);
+ DEBUG ("called on %p (ref = %d)", context, context->ref_count);
context->ref_count++;
}
@@ -302,7 +301,7 @@ mcd_dispatcher_context_handler_done (McdDispatcherContext *context)
* re-dispatch them to another handler */
}
- g_debug ("%s: %d channels still dispatching", G_STRFUNC, channels_left);
+ DEBUG ("%d channels still dispatching", channels_left);
if (channels_left == 0)
{
g_signal_emit (context->dispatcher,
@@ -401,8 +400,8 @@ _mcd_dispatcher_get_filter_chain (McdDispatcher * dispatcher,
if (iface_chains == NULL)
{
- g_debug ("%s: No chains for interface %s", G_STRFUNC,
- g_quark_to_string (channel_type_quark));
+ DEBUG ("No chains for interface %s",
+ g_quark_to_string (channel_type_quark));
}
else
switch (filter_flags)
@@ -670,13 +669,13 @@ _mcd_dispatcher_channel_handler_destroy_cb (DBusGProxy * channelhandler,
* anything. */
if (!userdata || !(G_IS_OBJECT (userdata)) || !(MCD_IS_CHANNEL (userdata)))
{
- g_debug ("Channel has already been closed. No need to clean up.");
+ DEBUG ("Channel has already been closed. No need to clean up.");
return;
}
channel = MCD_CHANNEL (userdata);
- g_debug ("Channelhandler object been destroyed, chan still valid.");
+ DEBUG ("Channelhandler object been destroyed, chan still valid.");
mcd_mission_abort (MCD_MISSION (channel));
}
@@ -696,7 +695,7 @@ cancel_proxy_call (McdChannel *channel, struct cancel_call_data *call_data)
dbus_g_proxy_cancel_call (call_data->handler_proxy, call_data->call);
- g_debug ("%s: signalling Handle channel failed", G_STRFUNC);
+ DEBUG ("signalling Handle channel failed");
/* We can't reliably map channel handler error codes to MC error
* codes. So just using generic error message.
@@ -782,7 +781,7 @@ _mcd_dispatcher_handle_channel_async_cb (DBusGProxy * proxy, GError * error,
&unique_proxy_error);
if (unique_proxy_error == NULL)
{
- g_debug ("Adding the destroy handler support.");
+ DEBUG ("Adding the destroy handler support.");
g_signal_connect (unique_name_proxy,
"destroy",
G_CALLBACK (_mcd_dispatcher_channel_handler_destroy_cb),
@@ -829,8 +828,8 @@ start_old_channel_handler (McdDispatcherContext *context)
if (chandler == NULL)
{
GError *mc_error;
- g_debug ("No handler for channel type %s",
- mcd_channel_get_channel_type (channel));
+ DEBUG ("No handler for channel type %s",
+ mcd_channel_get_channel_type (channel));
mc_error = g_error_new (MC_ERROR, MC_CHANNEL_REQUEST_GENERIC_ERROR,
"No handler for channel type %s",
@@ -859,15 +858,15 @@ start_old_channel_handler (McdDispatcherContext *context)
chandler->obj_path,
"org.freedesktop.Telepathy.ChannelHandler");
- g_debug ("Starting chan handler (bus = %s, obj = '%s'): conn = %s, chan_type = %s,"
- " obj_path = %s, handle_type = %d, handle = %d",
- chandler->bus_name,
- chandler->obj_path,
- TP_PROXY (tp_conn)->object_path,
- mcd_channel_get_channel_type (channel),
- mcd_channel_get_object_path (channel),
- mcd_channel_get_handle_type (channel),
- mcd_channel_get_handle (channel));
+ DEBUG ("Starting chan handler (bus = %s, obj = '%s'): conn = %s, chan_type = %s,"
+ " obj_path = %s, handle_type = %d, handle = %d",
+ chandler->bus_name,
+ chandler->obj_path,
+ TP_PROXY (tp_conn)->object_path,
+ mcd_channel_get_channel_type (channel),
+ mcd_channel_get_object_path (channel),
+ mcd_channel_get_handle_type (channel),
+ mcd_channel_get_handle (channel));
if (chandler->version >= 2)
{
@@ -875,7 +874,7 @@ start_old_channel_handler (McdDispatcherContext *context)
guint request_id;
GHashTable *options;
- g_debug ("new chandler");
+ DEBUG ("new chandler");
g_object_get (channel,
"outgoing", &outgoing,
"requestor-serial", &request_id,
@@ -1279,7 +1278,7 @@ mcd_dispatcher_run_handler (McdDispatcherContext *context,
handler_data = g_slice_new (McdHandlerCallData);
handler_data->context = context;
handler_data->channels = handled_best;
- g_debug ("Invoking handler %s (context %p)", handler->name, context);
+ DEBUG ("Invoking handler %s (context %p)", handler->name, context);
mc_cli_client_handler_call_handle_channels (handler->proxy, -1,
account_path, connection_path,
channels_array, satisfied_requests, user_action_time,
@@ -1292,7 +1291,7 @@ mcd_dispatcher_run_handler (McdDispatcherContext *context,
}
else
{
- g_debug ("Client.Handler not found, invoking old-style handler");
+ DEBUG ("Client.Handler not found, invoking old-style handler");
for (cl = unhandled; cl != NULL; cl = cl->next)
{
mcd_dispatcher_context_set_channel (context,
@@ -1339,8 +1338,7 @@ static void
mcd_dispatcher_context_release_client_lock (McdDispatcherContext *context)
{
g_return_if_fail (context->client_locks > 0);
- g_debug ("%s called on %p, locks = %d", G_STRFUNC,
- context, context->client_locks);
+ DEBUG ("called on %p, locks = %d", context, context->client_locks);
context->client_locks--;
if (context->client_locks == 0)
{
@@ -1357,7 +1355,7 @@ observe_channels_cb (TpProxy *proxy, const GError *error,
/* we display the error just for debugging, but we don't really care */
if (error)
- g_debug ("Observer returned error: %s", error->message);
+ DEBUG ("Observer returned error: %s", error->message);
mcd_dispatcher_context_release_client_lock (context);
}
@@ -1450,7 +1448,7 @@ add_dispatch_operation_cb (TpProxy *proxy, const GError *error,
if (error)
{
- g_debug ("Failed to add DO on approver: %s", error->message);
+ DEBUG ("Failed to add DO on approver: %s", error->message);
/* if all approvers fail to add the DO, then we behave as if no
* approver was registered: i.e., we continue dispatching */
@@ -1590,7 +1588,7 @@ static void
on_channel_abort_context (McdChannel *channel, McdDispatcherContext *context)
{
const GError *error;
- g_debug ("Channel %p aborted while in a dispatcher context", channel);
+ DEBUG ("Channel %p aborted while in a dispatcher context", channel);
/* TODO: it's still not clear what we should do with these aborted
* channels; for now, we keep them in the context, pretending that nothing
@@ -1681,7 +1679,7 @@ _mcd_dispatcher_enter_state_machine (McdDispatcher *dispatcher,
}
else
{
- g_debug ("%u channels to dispatch, filters disabled", n_channels);
+ DEBUG ("%u channels to dispatch, filters disabled", n_channels);
chain = NULL;
}
@@ -1720,15 +1718,15 @@ _mcd_dispatcher_enter_state_machine (McdDispatcher *dispatcher,
if (chain)
{
- g_debug ("entering state machine for context %p", context);
+ DEBUG ("entering state machine for context %p", context);
sp_timestamp ("invoke internal filters");
mcd_dispatcher_context_process (context, TRUE);
}
else
{
- g_debug ("No filters found for context %p, "
- "starting the channel handler", context);
+ DEBUG ("No filters found for context %p, "
+ "starting the channel handler", context);
mcd_dispatcher_run_clients (context);
}
}
@@ -2243,7 +2241,7 @@ create_mcd_client (McdDispatcher *self,
client->activatable = activatable;
if (!activatable)
client->active = TRUE;
- g_debug ("McdClient created for %s", name);
+ DEBUG ("McdClient created for %s", name);
/* The .client file is not mandatory as per the spec. However if it
* exists, it is better to read it than activating the service to read the
@@ -2259,7 +2257,7 @@ create_mcd_client (McdDispatcher *self,
g_key_file_load_from_file (file, filename, 0, &error);
if (G_LIKELY (!error))
{
- g_debug ("File found for %s: %s", name, filename);
+ DEBUG ("File found for %s: %s", name, filename);
parse_client_file (client, file);
file_found = TRUE;
}
@@ -2276,7 +2274,7 @@ create_mcd_client (McdDispatcher *self,
if (!file_found)
{
- g_debug ("No .client file for %s. Ask on D-Bus.", name);
+ DEBUG ("No .client file for %s. Ask on D-Bus.", name);
tp_cli_dbus_properties_call_get (client->proxy, -1,
MC_IFACE_CLIENT, "Interfaces", get_interfaces_cb, client,
NULL, G_OBJECT (self));
@@ -2324,7 +2322,7 @@ new_names_cb (McdDispatcher *self,
continue;
}
- g_debug ("%s: Register client %s", G_STRFUNC, name);
+ DEBUG ("Register client %s", name);
g_hash_table_insert (priv->clients, g_strdup (name),
create_mcd_client (self, name, activatable));
@@ -2587,7 +2585,7 @@ mcd_dispatcher_context_process (McdDispatcherContext * context, gboolean result)
{
context->next_func_index++;
- g_debug ("Next filter");
+ DEBUG ("Next filter");
filter->func (context, filter->user_data);
return; /*State machine goes on...*/
}
@@ -2609,7 +2607,7 @@ mcd_dispatcher_context_process (McdDispatcherContext * context, gboolean result)
}
else
{
- g_debug ("Filters failed, disposing request");
+ DEBUG ("Filters failed, disposing request");
error.domain = TP_ERRORS;
error.code = TP_ERROR_NOT_AVAILABLE;
error.message = "Filters failed";
@@ -2628,12 +2626,11 @@ mcd_dispatcher_context_unref (McdDispatcherContext * context)
g_return_if_fail (context);
g_return_if_fail (context->ref_count > 0);
- g_debug ("%s called on %p (ref = %d)", G_STRFUNC,
- context, context->ref_count);
+ DEBUG ("called on %p (ref = %d)", context, context->ref_count);
context->ref_count--;
if (context->ref_count == 0)
{
- g_debug ("%s: freeing the context %p", G_STRFUNC, context);
+ DEBUG ("freeing the context %p", context);
for (list = context->channels; list != NULL; list = list->next)
{
McdChannel *channel = MCD_CHANNEL (list->data);
@@ -2922,7 +2919,7 @@ on_request_status_changed (McdChannel *channel, McdChannelStatus status,
status != MCD_CHANNEL_STATUS_DISPATCHED)
return;
- g_debug ("%s called, %u", G_STRFUNC, status);
+ DEBUG ("called, %u", status);
if (status == MCD_CHANNEL_STATUS_FAILED)
{
const GError *error;
@@ -2975,8 +2972,8 @@ _mcd_dispatcher_add_request (McdDispatcher *dispatcher, McdAccount *account,
/* No handler found. But it's possible that by the time that the
* channel will be created some handler will have popped up, so we
* must not destroy it. */
- g_debug ("No handler for request %s",
- _mcd_channel_get_request_path (channel));
+ DEBUG ("No handler for request %s",
+ _mcd_channel_get_request_path (channel));
return;
}
@@ -3161,7 +3158,7 @@ _mcd_dispatcher_add_channel_request (McdDispatcher *dispatcher,
* is not, @request must mirror the status of @channel */
if (status == MCD_CHANNEL_STATUS_DISPATCHED)
{
- g_debug ("reinvoking handler on channel %p", channel);
+ DEBUG ("reinvoking handler on channel %p", channel);
/* copy the object path and the immutable properties from the
* existing channel */
@@ -3181,7 +3178,7 @@ _mcd_dispatcher_add_channel_request (McdDispatcher *dispatcher,
McdDispatcherContext *context;
context = find_context_from_channel (dispatcher, channel);
- g_debug ("channel %p is in context %p", channel, context);
+ DEBUG ("channel %p is in context %p", channel, context);
if (context->approvers_invoked > 0)
{
/* the existing channel is waiting for approval; but since the
@@ -3194,7 +3191,7 @@ _mcd_dispatcher_add_channel_request (McdDispatcher *dispatcher,
else
context->skip_approval = TRUE;
}
- g_debug ("channel %p is proxying %p", request, channel);
+ DEBUG ("channel %p is proxying %p", request, channel);
_mcd_channel_set_request_proxy (request, channel);
}
}
@@ -3206,7 +3203,7 @@ get_handled_channels_cb (TpProxy *proxy, const GValue *v_channels,
{
McdClient *client = user_data;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
client->got_handled_channels = TRUE;
if (G_LIKELY (!error))
@@ -3241,7 +3238,7 @@ mcd_client_call_when_got_handled_channels (McdClient *client,
McdReadyCb callback,
gpointer user_data)
{
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
if (client->got_handled_channels)
callback (client, NULL, user_data);
else
@@ -3261,7 +3258,7 @@ mcd_client_call_when_got_handled_channels (McdClient *client,
static void
channel_recover_release_lock (McdChannelRecover *cr)
{
- g_debug ("%s called on %p (locks = %d)", G_STRFUNC, cr, cr->handler_locks);
+ DEBUG ("called on %p (locks = %d)", cr, cr->handler_locks);
cr->handler_locks--;
if (cr->handler_locks == 0)
{
@@ -3270,7 +3267,7 @@ channel_recover_release_lock (McdChannelRecover *cr)
{
gboolean requested;
- g_debug ("channel %p is not handled, redispatching", cr->channel);
+ DEBUG ("channel %p is not handled, redispatching", cr->channel);
requested = mcd_channel_is_requested (cr->channel);
_mcd_dispatcher_send_channels (cr->dispatcher,
@@ -3289,7 +3286,7 @@ check_handled_channels (gpointer object, const GError *error,
McdClient *client = object;
McdChannelRecover *cr = user_data;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
if (G_LIKELY (!error) && client->handled_channels != NULL)
{
const gchar *path;
@@ -3300,7 +3297,7 @@ check_handled_channels (gpointer object, const GError *error,
{
if (g_strcmp0 (path, client->handled_channels[i]) == 0)
{
- g_debug ("Channel %s is handled by %s", path, client->name);
+ DEBUG ("Channel %s is handled by %s", path, client->name);
cr->handled = TRUE;
break;
}
diff --git a/src/mcd-manager.c b/src/mcd-manager.c
index f79545fa..a862a508 100644
--- a/src/mcd-manager.c
+++ b/src/mcd-manager.c
@@ -90,7 +90,7 @@ on_manager_ready (TpConnectionManager *tp_conn_mgr, const GError *error,
McdManagerPrivate *priv;
priv = manager->priv;
- g_debug ("manager %s is ready", priv->name);
+ DEBUG ("manager %s is ready", priv->name);
priv->ready = TRUE;
mcd_object_ready (manager, readiness_quark, error);
}
@@ -134,8 +134,7 @@ on_presence_requested_idle (gpointer data)
TpConnectionPresenceType actual_presence =
mcd_presence_frame_get_actual_presence (priv->presence_frame);
- g_debug ("%s: %d, %d", G_STRFUNC, requested_presence,
- actual_presence);
+ DEBUG ("%d, %d", requested_presence, actual_presence);
if ((actual_presence == TP_CONNECTION_PRESENCE_TYPE_OFFLINE
|| actual_presence == TP_CONNECTION_PRESENCE_TYPE_UNSET)
&& (requested_presence != TP_CONNECTION_PRESENCE_TYPE_OFFLINE
@@ -156,8 +155,8 @@ on_presence_requested (McdPresenceFrame * presence_frame,
{
McdManagerPrivate *priv;
- g_debug ("%s: Current connectivity status is %d", G_STRFUNC,
- mcd_mission_is_connected (MCD_MISSION (data)));
+ DEBUG ("Current connectivity status is %d",
+ mcd_mission_is_connected (MCD_MISSION (data)));
if (mcd_mission_is_connected (MCD_MISSION (data)))
{
@@ -166,7 +165,7 @@ on_presence_requested (McdPresenceFrame * presence_frame,
else
{
priv = MCD_MANAGER_PRIV(data);
- g_debug ("%s: Delaying call to on_presence_requested_idle", G_STRFUNC);
+ DEBUG ("Delaying call to on_presence_requested_idle");
priv->delay_presence_request = TRUE;
}
}
@@ -247,12 +246,12 @@ _mcd_manager_connect (McdMission * mission)
{
McdManagerPrivate *priv = MCD_MANAGER_PRIV (mission);
- g_debug ("%s: delay_presence_request = %d", G_STRFUNC, priv->delay_presence_request);
+ DEBUG ("delay_presence_request = %d", priv->delay_presence_request);
if (priv->delay_presence_request)
{
priv->delay_presence_request = FALSE;
g_idle_add (on_presence_requested_idle, mission);
- g_debug ("%s: Added idle func on_presence_requested_idle", G_STRFUNC);
+ DEBUG ("Added idle func on_presence_requested_idle");
}
MCD_MISSION_CLASS (mcd_manager_parent_class)->connect (mission);
}
@@ -262,20 +261,20 @@ _mcd_manager_disconnect (McdMission * mission)
{
GList *connections;
- g_debug ("%s(%p)", G_STRFUNC, mission);
+ DEBUG ("%p", mission);
MCD_MISSION_CLASS (mcd_manager_parent_class)->disconnect (mission);
/* We now call mcd_mission_abort() on all child connections; but since this
* could modify the list of the children, we cannot just use
* mcd_operation_foreach(). Instead, make a copy of the list and work on
* that. */
- g_debug("manager tree before abort:");
+ DEBUG("manager tree before abort:");
mcd_debug_print_tree(mission);
connections = g_list_copy ((GList *)mcd_operation_get_missions
(MCD_OPERATION (mission)));
g_list_foreach (connections, (GFunc) mcd_mission_abort, NULL);
g_list_free (connections);
- g_debug("manager tree after abort:");
+ DEBUG("manager tree after abort:");
mcd_debug_print_tree(mission);
}
@@ -298,7 +297,7 @@ mcd_manager_setup (McdManager *manager)
tp_connection_manager_call_when_ready (priv->tp_conn_mgr, on_manager_ready,
NULL, NULL, (GObject *)manager);
- g_debug ("%s: Manager %s created", G_STRFUNC, priv->name);
+ DEBUG ("Manager %s created", priv->name);
return TRUE;
error:
@@ -589,8 +588,8 @@ mcd_manager_create_connection (McdManager *manager, McdAccount *account)
(manager, account);
mcd_operation_take_mission (MCD_OPERATION (manager),
MCD_MISSION (connection));
- g_debug ("%s: Created a connection %p for account: %s", G_STRFUNC,
- connection, mcd_account_get_unique_name (account));
+ DEBUG ("Created a connection %p for account: %s",
+ connection, mcd_account_get_unique_name (account));
return connection;
}
diff --git a/src/mcd-master.c b/src/mcd-master.c
index 534e3fc8..7bf69085 100644
--- a/src/mcd-master.c
+++ b/src/mcd-master.c
@@ -145,13 +145,13 @@ check_account_transport (gpointer key, gpointer value, gpointer userdata)
TP_CONNECTION_STATUS_CONNECTED)
return;
- g_debug ("%s: account %s would like to connect",
- G_STRFUNC, mcd_account_get_unique_name (account));
+ DEBUG ("account %s would like to connect",
+ mcd_account_get_unique_name (account));
conditions = mcd_account_get_conditions (account);
if (mcd_transport_plugin_check_conditions (td->plugin, td->transport,
conditions))
{
- g_debug ("conditions matched");
+ DEBUG ("conditions matched");
_mcd_account_request_connection (account);
if (g_hash_table_size (conditions) > 0)
mcd_account_connection_bind_transport (account, td->transport);
@@ -167,7 +167,7 @@ mcd_master_transport_connected (McdMaster *master, McdTransportPlugin *plugin,
GHashTable *accounts;
TransportData td;
- g_debug ("%s: %s", G_STRFUNC, mcd_transport_get_name (plugin, transport));
+ DEBUG ("%s", mcd_transport_get_name (plugin, transport));
td.master = master;
td.plugin = plugin;
@@ -187,8 +187,8 @@ disconnect_account_transport (gpointer key, gpointer value, gpointer userdata)
{
McdConnection *connection;
- g_debug ("%s: account %s must disconnect",
- G_STRFUNC, mcd_account_get_unique_name (account));
+ DEBUG ("account %s must disconnect",
+ mcd_account_get_unique_name (account));
connection = mcd_account_get_connection (account);
if (connection)
mcd_connection_close (connection);
@@ -198,7 +198,7 @@ disconnect_account_transport (gpointer key, gpointer value, gpointer userdata)
* reconnect */
if (_mcd_master_account_conditions_satisfied (td->master, account))
{
- g_debug ("conditions matched");
+ DEBUG ("conditions matched");
_mcd_account_request_connection (account);
}
}
@@ -212,7 +212,7 @@ mcd_master_transport_disconnected (McdMaster *master, McdTransportPlugin *plugin
GHashTable *accounts;
TransportData td;
- g_debug ("%s: %s", G_STRFUNC, mcd_transport_get_name (plugin, transport));
+ DEBUG ("%s", mcd_transport_get_name (plugin, transport));
td.master = master;
td.plugin = plugin;
@@ -245,7 +245,7 @@ mcd_master_connect_automatic_accounts (McdMaster *master)
/* if the account conditions are satisfied, connect */
if (_mcd_master_account_conditions_satisfied (master, account))
{
- g_debug ("conditions matched");
+ DEBUG ("conditions matched");
_mcd_account_request_connection (account);
}
}
@@ -257,8 +257,8 @@ on_transport_status_changed (McdTransportPlugin *plugin,
McdTransport *transport,
McdTransportStatus status, McdMaster *master)
{
- g_debug ("Transport %s changed status to %u",
- mcd_transport_get_name (plugin, transport), status);
+ DEBUG ("Transport %s changed status to %u",
+ mcd_transport_get_name (plugin, transport), status);
if (status == MCD_TRANSPORT_STATUS_CONNECTED)
mcd_master_transport_connected (master, plugin, transport);
@@ -297,7 +297,7 @@ mcd_master_load_plugins (McdMaster *master)
dir = g_dir_open (MCD_DEFAULT_FILTER_PLUGIN_DIR, 0, &error);
if (!dir)
{
- g_debug ("Could not open plugin directory: %s", error->message);
+ DEBUG ("Could not open plugin directory: %s", error->message);
g_error_free (error);
return;
}
@@ -323,12 +323,12 @@ mcd_master_load_plugins (McdMaster *master)
g_ptr_array_add (priv->plugins, module);
}
else
- g_debug ("Error looking up symbol " MCD_PLUGIN_INIT_FUNC
- " from plugin %s: %s", name, g_module_error ());
+ DEBUG ("Error looking up symbol " MCD_PLUGIN_INIT_FUNC
+ " from plugin %s: %s", name, g_module_error ());
}
else
{
- g_debug ("Error opening plugin: %s: %s", name, g_module_error ());
+ DEBUG ("Error opening plugin: %s: %s", name, g_module_error ());
}
}
g_dir_close (dir);
@@ -370,7 +370,7 @@ dbus_filter_func (DBusConnection *connection,
&new_owner,
DBUS_TYPE_INVALID)) {
- g_debug ("%s: error: %s", G_STRFUNC, error.message);
+ DEBUG ("error: %s", error.message);
dbus_error_free (&error);
return result;
@@ -380,7 +380,7 @@ dbus_filter_func (DBusConnection *connection,
{
if (g_hash_table_lookup (priv->clients_needing_presence, prev_owner))
{
- g_debug ("Process %s which requested default presence is dead", prev_owner);
+ DEBUG ("Process %s which requested default presence is dead", prev_owner);
g_hash_table_remove (priv->clients_needing_presence, prev_owner);
if (g_hash_table_size (priv->clients_needing_presence) == 0 &&
priv->offline_on_idle)
@@ -408,7 +408,7 @@ _mcd_master_connect (McdMission * mission)
static void
_mcd_master_disconnect (McdMission * mission)
{
- g_debug ("%s", G_STRFUNC);
+ DEBUG ("called");
MCD_MISSION_CLASS (mcd_master_parent_class)->disconnect (mission);
}
@@ -770,7 +770,7 @@ mcd_master_set_offline_on_idle (McdMaster *master, gboolean offline_on_idle)
{
McdMasterPrivate *priv = MCD_MASTER_PRIV (master);
- g_debug ("%s: setting offline_on_idle to %d", G_STRFUNC, offline_on_idle);
+ DEBUG ("setting offline_on_idle to %d", offline_on_idle);
priv->offline_on_idle = offline_on_idle;
}
@@ -835,7 +835,7 @@ mcd_master_set_default_presence (McdMaster * master, const gchar *client_id)
{
if (g_hash_table_lookup (priv->clients_needing_presence, client_id) == NULL)
{
- g_debug ("New process requesting default presence (%s)", client_id);
+ DEBUG ("New process requesting default presence (%s)", client_id);
g_hash_table_insert (priv->clients_needing_presence,
g_strdup (client_id), GINT_TO_POINTER(1));
}
@@ -851,8 +851,8 @@ mcd_master_set_default_presence (McdMaster * master, const gchar *client_id)
mcd_presence_frame_get_requested_presence (priv->presence_frame)
>= TP_CONNECTION_PRESENCE_TYPE_AVAILABLE))
{
- g_debug ("%s: Default presence requested while connected or "
- "already connecting", G_STRFUNC);
+ DEBUG ("Default presence requested while connected or "
+ "already connecting");
return FALSE;
}
mcd_master_set_offline_on_idle (master, TRUE);
@@ -1234,7 +1234,7 @@ mcd_plugin_register_transport (McdPlugin *plugin,
{
McdMasterPrivate *priv = MCD_MASTER_PRIV (plugin);
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
g_signal_connect (transport_plugin, "status-changed",
G_CALLBACK (on_transport_status_changed),
MCD_MASTER (plugin));
@@ -1251,7 +1251,7 @@ mcd_plugin_register_account_connection (McdPlugin *plugin,
McdAccountConnectionData *acd;
GList *list;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
acd = g_malloc (sizeof (McdAccountConnectionData));
acd->priority = priority;
acd->func = func;
diff --git a/src/mcd-mission.c b/src/mcd-mission.c
index 4a01b140..94fa55bd 100644
--- a/src/mcd-mission.c
+++ b/src/mcd-mission.c
@@ -182,7 +182,7 @@ _mcd_mission_get_mode (McdMission * mission)
static void
on_parent_abort (McdMission *parent, McdMission *mission)
{
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
mcd_mission_set_parent (mission, NULL);
}
@@ -196,7 +196,7 @@ _mcd_mission_set_parent (McdMission * mission, McdMission * parent)
priv = MCD_MISSION_PRIV (mission);
- g_debug ("%s: child = %p, parent = %p", G_STRFUNC, mission, parent);
+ DEBUG ("child = %p, parent = %p", mission, parent);
if (priv->parent)
{
@@ -243,7 +243,7 @@ _mcd_mission_dispose (GObject * object)
priv->is_disposed = TRUE;
- g_debug ("mission disposed %p", object);
+ DEBUG ("mission disposed %p", object);
if (priv->parent)
{
g_signal_handlers_disconnect_by_func (priv->parent,
@@ -258,7 +258,7 @@ _mcd_mission_dispose (GObject * object)
static void
_mcd_mission_finalize (GObject * object)
{
- g_debug ("mission finalized %p", object);
+ DEBUG ("mission finalized %p", object);
G_OBJECT_CLASS (mcd_mission_parent_class)->finalize (object);
}
diff --git a/src/mcd-operation.c b/src/mcd-operation.c
index 7787aace..27365a4c 100644
--- a/src/mcd-operation.c
+++ b/src/mcd-operation.c
@@ -97,7 +97,7 @@ _mcd_operation_abort (McdOperation * operation)
{
const GList *node;
- g_debug ("Operation abort received, aborting all children");
+ DEBUG ("Operation abort received, aborting all children");
node = MCD_OPERATION_PRIV (operation)->missions;
while (node)
{
@@ -130,7 +130,7 @@ _mcd_operation_dispose (GObject * object)
}
priv->is_disposed = TRUE;
- g_debug ("operation disposed");
+ DEBUG ("operation disposed");
g_signal_handlers_disconnect_by_func (object,
G_CALLBACK (_mcd_operation_abort),
@@ -219,7 +219,7 @@ _mcd_operation_remove_mission (McdOperation * operation, McdMission * mission)
g_signal_emit_by_name (G_OBJECT (operation), "mission-removed", mission);
- g_debug ("removing mission: %p", mission);
+ DEBUG ("removing mission: %p", mission);
g_object_unref (mission);
}
diff --git a/src/mcd-presence-frame.c b/src/mcd-presence-frame.c
index aa53f525..c3119bf3 100644
--- a/src/mcd-presence-frame.c
+++ b/src/mcd-presence-frame.c
@@ -342,7 +342,7 @@ _mcd_presence_frame_request_presence (McdPresenceFrame * presence_frame,
priv->requested_presence = mcd_presence_new (presence, presence_message,
status,
TP_CONNECTION_STATUS_REASON_REQUESTED);
- g_debug ("%s: Presence %d is being requested", G_STRFUNC, presence);
+ DEBUG ("Presence %d is being requested", presence);
g_signal_emit_by_name (presence_frame, "presence-requested",
presence, presence_message);
@@ -364,16 +364,16 @@ mcd_presence_frame_request_presence (McdPresenceFrame * presence_frame,
}
priv->last_presence = mcd_presence_copy (priv->actual_presence);
- g_debug ("%s: updated last_presence = %d, msg = %s", G_STRFUNC,
- priv->last_presence->presence,
- priv->last_presence->message);
+ DEBUG ("updated last_presence = %d, msg = %s",
+ priv->last_presence->presence,
+ priv->last_presence->message);
if (priv->last_presence->presence == TP_CONNECTION_PRESENCE_TYPE_UNSET)
{
priv->last_presence->presence = TP_CONNECTION_PRESENCE_TYPE_OFFLINE;
}
- g_debug ("Presence requested: %d", presence);
+ DEBUG ("Presence requested: %d", presence);
_mcd_presence_frame_request_presence (presence_frame, presence,
presence_message);
@@ -459,7 +459,7 @@ _mcd_presence_frame_update_actual_presence (McdPresenceFrame * presence_frame,
TpConnectionStatusReason connection_reason;
gboolean changed;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
pi.presence = TP_CONNECTION_PRESENCE_TYPE_UNSET;
pi.requested_presence = mcd_presence_frame_get_requested_presence (presence_frame);
@@ -480,7 +480,7 @@ _mcd_presence_frame_update_actual_presence (McdPresenceFrame * presence_frame,
connection_status,
connection_reason);
- g_debug ("%s: presence actual: %d", G_STRFUNC, pi.presence);
+ DEBUG ("presence actual: %d", pi.presence);
if (changed)
{
g_signal_emit_by_name (G_OBJECT (presence_frame),
@@ -531,8 +531,8 @@ _mcd_presence_frame_update_actual_status (McdPresenceFrame *presence_frame)
TpConnectionStatus status;
status = mcd_account_get_connection_status (account);
- g_debug ("Account %s is %d", mcd_account_get_unique_name (account),
- status);
+ DEBUG ("Account %s is %d", mcd_account_get_unique_name (account),
+ status);
if (status == TP_CONNECTION_STATUS_CONNECTING)
{
priv->actual_status = status;
@@ -608,7 +608,7 @@ mcd_presence_frame_remove_account (McdPresenceFrame * presence_frame,
pos = g_list_find (priv->accounts, account);
if (!pos) return FALSE;
- g_debug ("%s: removing account %s", G_STRFUNC, mcd_account_get_unique_name (account));
+ DEBUG ("removing account %s", mcd_account_get_unique_name (account));
/*_mcd_presence_frame_update_actual_presence (presence_frame, NULL);*/
g_signal_handlers_disconnect_by_func (account,
on_account_current_presence_changed,
diff --git a/src/mcd-proxy.c b/src/mcd-proxy.c
index 7bd2fa0a..6a1be029 100644
--- a/src/mcd-proxy.c
+++ b/src/mcd-proxy.c
@@ -122,7 +122,7 @@ _mcd_proxy_dispose (GObject * object)
}
priv->is_disposed = TRUE;
- g_debug ("proxy disposed\n");
+ DEBUG ("proxy disposed\n");
if (priv->proxy_object)
{
diff --git a/src/mcd-service.c b/src/mcd-service.c
index f8a5ad6a..3de9149e 100644
--- a/src/mcd-service.c
+++ b/src/mcd-service.c
@@ -263,7 +263,7 @@ mcd_service_cancel_channel_request (GObject * obj, guint operation_id,
{
GError *err = NULL;
gchar *sender = dbus_g_method_get_sender (mi);
- g_debug ("%s (%u)", G_STRFUNC, operation_id);
+ DEBUG ("%u", operation_id);
if (!mcd_master_cancel_channel_request (MCD_MASTER (obj), operation_id,
sender, &err))
{
@@ -301,7 +301,7 @@ mcd_service_get_account_for_connection(GObject *obj,
gchar **ret_unique_name,
GError **error)
{
- g_debug ("%s: object_path = %s", __FUNCTION__, object_path);
+ DEBUG ("%s: object_path = %s", __FUNCTION__, object_path);
if (!mcd_master_get_account_for_connection (MCD_MASTER (obj),
object_path,
@@ -379,8 +379,8 @@ mcd_service_remote_avatar_changed(GObject *obj,
McdConnection *connection;
GError *error = NULL;
- g_debug ("%s: object_path = %s, id = %u, token = %s", __FUNCTION__,
- object_path, contact_id, token);
+ DEBUG ("%s: object_path = %s, id = %u, token = %s", __FUNCTION__,
+ object_path, contact_id, token);
connection = mcd_master_get_connection (MCD_MASTER (obj),
object_path, &error);
@@ -405,7 +405,7 @@ _on_filter_process (DBusGProxy *proxy, guint counter, gboolean process)
ctx = g_hash_table_lookup (ctx_table, GUINT_TO_POINTER (counter));
if (ctx)
{
- g_debug ("%s: Process channel %d", __FUNCTION__, counter);
+ DEBUG ("%s: Process channel %d", __FUNCTION__, counter);
g_hash_table_remove (ctx_table, GUINT_TO_POINTER (counter));
mcd_dispatcher_context_process (ctx, process);
}
@@ -424,7 +424,7 @@ _on_filter_new_channel (McdDispatcherContext *ctx, DBusGProxy *proxy)
g_object_get (G_OBJECT (connection), "tp-connection", &tp_conn, NULL);
- g_debug ("%s: Filtering new channel", __FUNCTION__);
+ DEBUG ("%s: Filtering new channel", __FUNCTION__);
dbus_g_proxy_call_no_reply (proxy, "FilterChannel",
G_TYPE_STRING, TP_PROXY (tp_conn)->bus_name,
DBUS_TYPE_G_OBJECT_PATH, TP_PROXY (tp_conn)->object_path,
@@ -462,7 +462,7 @@ _on_filter_proxy_destroy (DBusGProxy *proxy)
(GHRFunc) _ctx_table_remove_foreach,
NULL);
- g_debug ("%s: Unregistering filter", __FUNCTION__);
+ DEBUG ("Unregistering filter");
mcd_dispatcher_unregister_filter (dispatcher,
(McdFilterFunc) _on_filter_new_channel,
quark, flags);
@@ -485,7 +485,7 @@ mcd_service_register_filter(GObject *obj,
static gboolean initialized = FALSE;
guint quark = g_quark_from_string (channel_type);
- g_debug ("%s: Registering new filter", __FUNCTION__);
+ DEBUG ("Registering new filter");
if (!initialized)
{
@@ -541,7 +541,7 @@ mcd_register_dbus_object (McdService * obj)
dbus_error_init (&error);
- g_debug ("Requesting MC dbus service");
+ DEBUG ("Requesting MC dbus service");
dbus_bus_request_name (dbus_g_connection_get_connection (connection),
MISSION_CONTROL_DBUS_SERVICE, 0, &error);
@@ -552,12 +552,12 @@ mcd_register_dbus_object (McdService * obj)
dbus_error_free (&error);
}
- g_debug ("Registering MC object");
+ DEBUG ("Registering MC object");
mcd_debug_print_tree (obj);
dbus_g_connection_register_g_object (connection,
MISSION_CONTROL_DBUS_OBJECT,
G_OBJECT (obj));
- g_debug ("Registered MC object");
+ DEBUG ("Registered MC object");
mcd_debug_print_tree (obj);
}
@@ -574,9 +574,9 @@ _on_account_status_changed (McdPresenceFrame * presence_frame,
mcd_account_get_current_presence (account, &presence, &status, &message);
/* Emit the AccountStatusChanged signal */
- g_debug ("Emitting account status changed for %s: status = %d, reason = %d",
- mcd_account_get_unique_name (account), connection_status,
- connection_reason);
+ DEBUG ("Emitting account status changed for %s: status = %d, reason = %d",
+ mcd_account_get_unique_name (account), connection_status,
+ connection_reason);
/* HACK for old MC compatibility */
if (connection_status == TP_CONNECTION_STATUS_CONNECTED &&
@@ -604,9 +604,9 @@ _on_account_presence_changed (McdPresenceFrame * presence_frame,
gchar * presence_message, McdService * obj)
{
/* Emit the AccountStatusChanged signal */
- g_debug ("Emitting presence changed for %s: presence = %d, message = %s",
- mcd_account_get_unique_name (account), presence,
- presence_message);
+ DEBUG ("Emitting presence changed for %s: presence = %d, message = %s",
+ mcd_account_get_unique_name (account), presence,
+ presence_message);
/* HACK for old MC compatibility */
if (mcd_presence_frame_get_account_status (presence_frame, account)
@@ -819,7 +819,7 @@ mcd_service_constructed (GObject *obj)
{
McdServicePrivate *priv = MCD_OBJECT_PRIV (obj);
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
g_object_get (obj,
"presence-frame", &priv->presence_frame,
"dispatcher", &priv->dispatcher,
@@ -860,7 +860,7 @@ mcd_service_init (McdService * obj)
obj->main_loop = g_main_loop_new (NULL, FALSE);
priv->last_status = -1;
- g_debug ("%s called", G_STRFUNC);
+ DEBUG ("called");
}
static void