]> git.0d.be Git - empathy.git/commitdiff
Use the right macros to pass a gboolean as user_data
authorCosimo Cecchi <cosimoc@gnome.org>
Mon, 18 May 2009 12:30:08 +0000 (14:30 +0200)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 1 Jun 2009 15:53:20 +0000 (17:53 +0200)
Use GPOINTER_TO_INT and GINT_TO_POINTER instead of passing the address,
as that doesn't work.

libempathy/empathy-ft-handler.c
libempathy/empathy-tp-file.c

index 4a14038750569e23107ec030643d9786765300d2..e2172bcd54873ce3565684d5c466b0b46103eb77 100644 (file)
@@ -694,6 +694,8 @@ ft_handler_check_if_allowed (EmpathyFTHandler *handler)
       TP_IFACE_CHANNEL ".TargetHandle"))
     res = FALSE;
 
+  DEBUG ("check if FT allowed: %s", res ? "True" : "False");
+
   g_object_unref (dispatcher);
 
   return res;
index a5af58b1ec5584777bfcee96774948bc93fa9743..6a28872512b7c6aa59d2f876f8c722e1ba681f76 100644 (file)
@@ -149,11 +149,11 @@ ft_operation_close_clean (EmpathyTpFile *tp_file)
 {
   EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
 
-  DEBUG ("FT operation close clean");
-
   if (priv->is_closed)
     return;
 
+  DEBUG ("FT operation close clean");
+
   priv->is_closed = TRUE;
 
   if (priv->op_callback != NULL)
@@ -166,11 +166,11 @@ ft_operation_close_with_error (EmpathyTpFile *tp_file,
 {
   EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
 
-  DEBUG ("FT operation close with error %s", error->message);
-
   if (priv->is_closed)
     return;
 
+  DEBUG ("FT operation close with error %s", error->message);
+
   priv->is_closed = TRUE;
 
   /* close the channel if it's not cancelled already */
@@ -191,10 +191,10 @@ splice_stream_ready_cb (GObject *source,
 
   tp_file = user_data;
 
-  DEBUG ("Splice stream ready cb");
-
   g_output_stream_splice_finish (G_OUTPUT_STREAM (source), res, &error);
 
+  DEBUG ("Splice stream ready cb, error %p", error);
+
   if (error != NULL)
     {
       ft_operation_close_with_error (tp_file, error);
@@ -520,12 +520,12 @@ channel_closed_cb (TpChannel *proxy,
 {
   EmpathyTpFile *tp_file = EMPATHY_TP_FILE (weak_object);
   EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
-  gboolean *cancel = user_data;
+  gboolean cancel = GPOINTER_TO_INT (user_data);
 
-  DEBUG ("Channel is closed");
+  DEBUG ("Channel is closed, should cancel %s", cancel ? "True" : "False");
 
   if (priv->cancellable != NULL &&
-      !g_cancellable_is_cancelled (priv->cancellable) && *cancel)
+      !g_cancellable_is_cancelled (priv->cancellable) && cancel)
     g_cancellable_cancel (priv->cancellable);  
 }
 
@@ -535,10 +535,11 @@ close_channel_internal (EmpathyTpFile *tp_file,
 {
   EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
 
-  DEBUG ("Closing channel..");
+  DEBUG ("Closing channel, should cancel %s", cancel ?
+         "True" : "False");
 
   tp_cli_channel_call_close (priv->channel, -1,
-    channel_closed_cb, &cancel, NULL, G_OBJECT (tp_file));
+    channel_closed_cb, GINT_TO_POINTER (cancel), NULL, G_OBJECT (tp_file));
 }
 
 /* GObject methods */