aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-file.c
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2008-11-22 00:18:01 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-11-22 00:18:01 +0800
commit2885452639d3eb70aac6392e63526babe9c0766a (patch)
treeebe71909100b86f0cfc667a3dc85c47e47a420d5 /libempathy/empathy-tp-file.c
parentefbf766fa6201b6157e2c905f50add0684ed124e (diff)
downloadgsoc2013-empathy-2885452639d3eb70aac6392e63526babe9c0766a.tar
gsoc2013-empathy-2885452639d3eb70aac6392e63526babe9c0766a.tar.gz
gsoc2013-empathy-2885452639d3eb70aac6392e63526babe9c0766a.tar.bz2
gsoc2013-empathy-2885452639d3eb70aac6392e63526babe9c0766a.tar.lz
gsoc2013-empathy-2885452639d3eb70aac6392e63526babe9c0766a.tar.xz
gsoc2013-empathy-2885452639d3eb70aac6392e63526babe9c0766a.tar.zst
gsoc2013-empathy-2885452639d3eb70aac6392e63526babe9c0766a.zip
Removed account property of EmpathyTpFile as it's only actually used once and easy obtainable. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> svn path=/trunk/; revision=1803
Diffstat (limited to 'libempathy/empathy-tp-file.c')
-rw-r--r--libempathy/empathy-tp-file.c33
1 files changed, 6 insertions, 27 deletions
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c
index ee9f01e9b..c9e4c5d4d 100644
--- a/libempathy/empathy-tp-file.c
+++ b/libempathy/empathy-tp-file.c
@@ -274,7 +274,6 @@ copy_stream (GInputStream *in,
struct _EmpathyTpFilePriv {
EmpathyContactFactory *factory;
- McAccount *account;
gchar *id;
MissionControl *mc;
TpChannel *channel;
@@ -300,7 +299,6 @@ struct _EmpathyTpFilePriv {
enum {
PROP_0,
- PROP_ACCOUNT,
PROP_CHANNEL,
PROP_STATE,
PROP_INCOMING,
@@ -358,10 +356,6 @@ tp_file_finalize (GObject *object)
{
g_object_unref (tp_file->priv->factory);
}
- if (tp_file->priv->account)
- {
- g_object_unref (tp_file->priv->account);
- }
if (tp_file->priv->mc)
{
g_object_unref (tp_file->priv->mc);
@@ -542,6 +536,7 @@ tp_file_constructor (GType type,
EmpathyTpFile *tp_file;
TpHandle handle;
GHashTable *properties;
+ McAccount *account;
file_obj = G_OBJECT_CLASS (empathy_tp_file_parent_class)->constructor (type,
n_props, props);
@@ -570,9 +565,11 @@ tp_file_constructor (GType type,
tp_file,
NULL, NULL, NULL);
+ account = empathy_channel_get_account (tp_file->priv->channel);
+
handle = tp_channel_get_handle (tp_file->priv->channel, NULL);
tp_file->priv->contact = empathy_contact_factory_get_from_handle (
- tp_file->priv->factory, tp_file->priv->account, (guint) handle);
+ tp_file->priv->factory, account, (guint) handle);
tp_cli_dbus_properties_run_get_all (tp_file->priv->channel,
-1, EMP_IFACE_CHANNEL_TYPE_FILE, &properties, NULL, NULL);
@@ -603,6 +600,7 @@ tp_file_constructor (GType type,
tp_file->priv->incoming = TRUE;
g_hash_table_destroy (properties);
+ g_object_unref (account);
return file_obj;
}
@@ -619,9 +617,6 @@ tp_file_get_property (GObject *object,
switch (param_id)
{
- case PROP_ACCOUNT:
- g_value_set_object (value, tp_file->priv->account);
- break;
case PROP_CHANNEL:
g_value_set_object (value, tp_file->priv->channel);
break;
@@ -652,9 +647,6 @@ tp_file_set_property (GObject *object,
EmpathyTpFile *tp_file = (EmpathyTpFile *) object;
switch (param_id)
{
- case PROP_ACCOUNT:
- tp_file->priv->account = g_object_ref (g_value_get_object (value));
- break;
case PROP_CHANNEL:
tp_file->priv->channel = g_object_ref (g_value_get_object (value));
break;
@@ -700,7 +692,6 @@ tp_file_set_property (GObject *object,
/**
* empathy_tp_file_new:
- * @account: the #McAccount for the channel
* @channel: a Telepathy channel
*
* Creates a new #EmpathyTpFile wrapping @channel.
@@ -708,14 +699,11 @@ tp_file_set_property (GObject *object,
* Returns: a new #EmpathyTpFile
*/
EmpathyTpFile *
-empathy_tp_file_new (McAccount *account,
- TpChannel *channel)
+empathy_tp_file_new (TpChannel *channel)
{
- g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
return g_object_new (EMPATHY_TYPE_TP_FILE,
- "account", account,
"channel", channel,
NULL);
}
@@ -1007,15 +995,6 @@ empathy_tp_file_class_init (EmpathyTpFileClass *klass)
/* Construct-only properties */
g_object_class_install_property (object_class,
- PROP_ACCOUNT,
- g_param_spec_object ("account",
- "channel Account",
- "The account associated with the channel",
- MC_TYPE_ACCOUNT,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
-
- g_object_class_install_property (object_class,
PROP_CHANNEL,
g_param_spec_object ("channel",
"telepathy channel",