aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-03-14 21:05:38 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-03-14 21:05:38 +0800
commit93f70d88d4611f0bd6c79ea19257c6156cadb24d (patch)
treec0974d630d8736361b4746975cb4b88d7b18838c /libempathy
parent398e3bc61957f0503027d32a779da21daab3b5e1 (diff)
downloadgsoc2013-empathy-93f70d88d4611f0bd6c79ea19257c6156cadb24d.tar
gsoc2013-empathy-93f70d88d4611f0bd6c79ea19257c6156cadb24d.tar.gz
gsoc2013-empathy-93f70d88d4611f0bd6c79ea19257c6156cadb24d.tar.bz2
gsoc2013-empathy-93f70d88d4611f0bd6c79ea19257c6156cadb24d.tar.lz
gsoc2013-empathy-93f70d88d4611f0bd6c79ea19257c6156cadb24d.tar.xz
gsoc2013-empathy-93f70d88d4611f0bd6c79ea19257c6156cadb24d.tar.zst
gsoc2013-empathy-93f70d88d4611f0bd6c79ea19257c6156cadb24d.zip
Add a ready property on EmpathyTpContactFactory
svn path=/trunk/; revision=790
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-contact-factory.c19
-rw-r--r--libempathy/empathy-contact-factory.h3
-rw-r--r--libempathy/empathy-tp-contact-factory.c22
-rw-r--r--libempathy/empathy-tp-contact-factory.h1
4 files changed, 34 insertions, 11 deletions
diff --git a/libempathy/empathy-contact-factory.c b/libempathy/empathy-contact-factory.c
index 7cbb7c009..653a29ec4 100644
--- a/libempathy/empathy-contact-factory.c
+++ b/libempathy/empathy-contact-factory.c
@@ -22,7 +22,6 @@
#include <config.h>
#include "empathy-contact-factory.h"
-#include "empathy-tp-contact-factory.h"
#include "empathy-utils.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
@@ -37,9 +36,9 @@ static void empathy_contact_factory_init (EmpathyContactFactory *fact
G_DEFINE_TYPE (EmpathyContactFactory, empathy_contact_factory, G_TYPE_OBJECT);
-static EmpathyTpContactFactory *
-contact_factory_get_tp_factory (EmpathyContactFactory *factory,
- McAccount *account)
+EmpathyTpContactFactory *
+empathy_contact_factory_get_tp_factory (EmpathyContactFactory *factory,
+ McAccount *account)
{
EmpathyContactFactoryPriv *priv = GET_PRIV (factory);
EmpathyTpContactFactory *tp_factory;
@@ -61,7 +60,7 @@ empathy_contact_factory_get_user (EmpathyContactFactory *factory,
{
EmpathyTpContactFactory *tp_factory;
- tp_factory = contact_factory_get_tp_factory (factory, account);
+ tp_factory = empathy_contact_factory_get_tp_factory (factory, account);
return empathy_tp_contact_factory_get_user (tp_factory);
}
@@ -73,7 +72,7 @@ empathy_contact_factory_get_from_id (EmpathyContactFactory *factory,
{
EmpathyTpContactFactory *tp_factory;
- tp_factory = contact_factory_get_tp_factory (factory, account);
+ tp_factory = empathy_contact_factory_get_tp_factory (factory, account);
return empathy_tp_contact_factory_get_from_id (tp_factory, id);
}
@@ -85,7 +84,7 @@ empathy_contact_factory_get_from_handle (EmpathyContactFactory *factory,
{
EmpathyTpContactFactory *tp_factory;
- tp_factory = contact_factory_get_tp_factory (factory, account);
+ tp_factory = empathy_contact_factory_get_tp_factory (factory, account);
return empathy_tp_contact_factory_get_from_handle (tp_factory, handle);
}
@@ -97,7 +96,7 @@ empathy_contact_factory_get_from_handles (EmpathyContactFactory *factory,
{
EmpathyTpContactFactory *tp_factory;
- tp_factory = contact_factory_get_tp_factory (factory, account);
+ tp_factory = empathy_contact_factory_get_tp_factory (factory, account);
return empathy_tp_contact_factory_get_from_handles (tp_factory, handles);
}
@@ -111,7 +110,7 @@ empathy_contact_factory_set_alias (EmpathyContactFactory *factory,
McAccount *account;
account = empathy_contact_get_account (contact);
- tp_factory = contact_factory_get_tp_factory (factory, account);
+ tp_factory = empathy_contact_factory_get_tp_factory (factory, account);
return empathy_tp_contact_factory_set_alias (tp_factory, contact, alias);
}
@@ -125,7 +124,7 @@ empathy_contact_factory_set_avatar (EmpathyContactFactory *factory,
{
EmpathyTpContactFactory *tp_factory;
- tp_factory = contact_factory_get_tp_factory (factory, account);
+ tp_factory = empathy_contact_factory_get_tp_factory (factory, account);
return empathy_tp_contact_factory_set_avatar (tp_factory,
data, size, mime_type);
diff --git a/libempathy/empathy-contact-factory.h b/libempathy/empathy-contact-factory.h
index 24aabc772..a34d1de20 100644
--- a/libempathy/empathy-contact-factory.h
+++ b/libempathy/empathy-contact-factory.h
@@ -27,6 +27,7 @@
#include <libmissioncontrol/mc-account.h>
#include "empathy-contact.h"
+#include "empathy-tp-contact-factory.h"
G_BEGIN_DECLS
@@ -51,6 +52,8 @@ struct _EmpathyContactFactoryClass {
GType empathy_contact_factory_get_type (void) G_GNUC_CONST;
EmpathyContactFactory *empathy_contact_factory_new (void);
+EmpathyTpContactFactory *empathy_contact_factory_get_tp_factory (EmpathyContactFactory *factory,
+ McAccount *account);
EmpathyContact * empathy_contact_factory_get_user (EmpathyContactFactory *factory,
McAccount *account);
EmpathyContact * empathy_contact_factory_get_from_id (EmpathyContactFactory *factory,
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index 7bdfaed89..6700a714e 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -54,6 +54,7 @@ G_DEFINE_TYPE (EmpathyTpContactFactory, empathy_tp_contact_factory, G_TYPE_OBJEC
enum {
PROP_0,
PROP_ACCOUNT,
+ PROP_READY
};
static EmpathyContact *
@@ -1142,6 +1143,16 @@ empathy_tp_contact_factory_set_avatar (EmpathyTpContactFactory *tp_factory,
}
}
+gboolean
+empathy_tp_contact_factory_is_ready (EmpathyTpContactFactory *tp_factory)
+{
+ EmpathyTpContactFactoryPriv *priv = GET_PRIV (tp_factory);
+
+ g_return_val_if_fail (EMPATHY_IS_TP_CONTACT_FACTORY (tp_factory), FALSE);
+
+ return priv->ready;
+}
+
static void
tp_contact_factory_get_property (GObject *object,
guint param_id,
@@ -1154,6 +1165,9 @@ tp_contact_factory_get_property (GObject *object,
case PROP_ACCOUNT:
g_value_set_object (value, priv->account);
break;
+ case PROP_READY:
+ g_value_set_boolean (value, priv->ready);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
@@ -1244,7 +1258,6 @@ empathy_tp_contact_factory_class_init (EmpathyTpContactFactoryClass *klass)
object_class->get_property = tp_contact_factory_get_property;
object_class->set_property = tp_contact_factory_set_property;
- /* Construct-only properties */
g_object_class_install_property (object_class,
PROP_ACCOUNT,
g_param_spec_object ("account",
@@ -1253,6 +1266,13 @@ empathy_tp_contact_factory_class_init (EmpathyTpContactFactoryClass *klass)
MC_TYPE_ACCOUNT,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (object_class,
+ PROP_READY,
+ g_param_spec_boolean ("ready",
+ "Wheter the factor is ready",
+ "Is the factory ready",
+ FALSE,
+ G_PARAM_READABLE));
g_type_class_add_private (object_class, sizeof (EmpathyTpContactFactoryPriv));
}
diff --git a/libempathy/empathy-tp-contact-factory.h b/libempathy/empathy-tp-contact-factory.h
index eac94374b..06aa29c40 100644
--- a/libempathy/empathy-tp-contact-factory.h
+++ b/libempathy/empathy-tp-contact-factory.h
@@ -65,6 +65,7 @@ void empathy_tp_contact_factory_set_avatar (EmpathyTpC
const gchar *data,
gsize size,
const gchar *mime_type);
+gboolean empathy_tp_contact_factory_is_ready (EmpathyTpContactFactory *tp_factory);
G_END_DECLS