[telepathy-mission-control/master] mcd_connection_connect: don't store @params in the McdConnection at all

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Apr 16 10:13:00 PDT 2009


They may once have been used for something, but now they're just dead
weight; there's no need to keep any reference to them at all, after
tp_cli_connection_manager_call_request_connection has been called.
---
 src/mcd-connection.c |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/src/mcd-connection.c b/src/mcd-connection.c
index 0572736..0ad4759 100644
--- a/src/mcd-connection.c
+++ b/src/mcd-connection.c
@@ -90,7 +90,6 @@ struct _McdConnectionPrivate
 
     /* Account */
     McdAccount *account;
-    GHashTable *params;
 
     /* Associated profile */
     /* McProfile *profile; */
@@ -1628,12 +1627,6 @@ _mcd_connection_finalize (GObject * object)
     if (priv->recognized_presences)
         g_hash_table_destroy (priv->recognized_presences);
 
-    if (priv->params != NULL)
-    {
-        g_hash_table_unref (priv->params);
-        priv->params = NULL;
-    }
-
     G_OBJECT_CLASS (mcd_connection_parent_class)->finalize (object);
 }
 
@@ -2427,9 +2420,12 @@ mcd_connection_close (McdConnection *connection)
 /*
  * _mcd_connection_connect:
  * @connection: the #McdConnection.
- * @params: a #GHashTable of connection parameters.
+ * @params: a #GHashTable of connection parameters
+ *
+ * Activate @connection.
  *
- * Activate @connection. The connection references @params, if non-NULL.
+ * If @params are NULL, tell the account to start connecting. Otherwise,
+ * actually connect, using @params.
  */
 void
 _mcd_connection_connect (McdConnection *connection, GHashTable *params)
@@ -2453,20 +2449,12 @@ _mcd_connection_connect (McdConnection *connection, GHashTable *params)
     if (mcd_account_get_connection_status (priv->account) ==
         TP_CONNECTION_STATUS_DISCONNECTED)
     {
-        if (connection->priv->params != NULL)
-        {
-            g_hash_table_unref (connection->priv->params);
-            connection->priv->params = NULL;
-        }
-
         if (params)
         {
-            connection->priv->params = g_hash_table_ref (params);
             _mcd_connection_connect_with_params (connection, params);
         }
         else
         {
-            connection->priv->params = NULL;
             _mcd_account_connection_begin (priv->account);
         }
     }
-- 
1.5.6.5




More information about the telepathy-commits mailing list