aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--libempathy/empathy-tp-file.c33
-rw-r--r--libempathy/empathy-tp-file.h2
-rw-r--r--libempathy/empathy-utils.c2
-rw-r--r--src/empathy-event-manager.c4
4 files changed, 9 insertions, 32 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",
diff --git a/libempathy/empathy-tp-file.h b/libempathy/empathy-tp-file.h
index 21007291d..c8565033f 100644
--- a/libempathy/empathy-tp-file.h
+++ b/libempathy/empathy-tp-file.h
@@ -67,7 +67,7 @@ struct _EmpathyTpFileClass
GType empathy_tp_file_get_type (void) G_GNUC_CONST;
-EmpathyTpFile *empathy_tp_file_new (McAccount *account, TpChannel *channel);
+EmpathyTpFile *empathy_tp_file_new (TpChannel *channel);
TpChannel *empathy_tp_file_get_channel (EmpathyTpFile *tp_file);
void empathy_tp_file_accept (EmpathyTpFile *tp_file, guint64 offset);
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index dd0ca1987..ede7cc305 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -862,7 +862,7 @@ empathy_send_file (EmpathyContact *contact,
&value, NULL, NULL, NULL, NULL);
g_value_unset (&value);
- tp_file = empathy_tp_file_new (account, channel);
+ tp_file = empathy_tp_file_new (channel);
if (tp_file) {
empathy_tp_file_set_input_stream (tp_file, in_stream);
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 61d2fe9f8..71840f0e0 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -208,11 +208,9 @@ file_channel_state_cb (TpProxy *proxy,
EMP_FILE_TRANSFER_STATE_LOCAL_PENDING) {
EmpathyContact *contact;
gchar *msg;
- McAccount *account;
EmpathyTpFile *tp_file;
- account = empathy_channel_get_account (channel);
- tp_file = empathy_tp_file_new (account, channel);
+ tp_file = empathy_tp_file_new (channel);
contact = empathy_tp_file_get_contact (tp_file);
empathy_contact_run_until_ready (contact,