diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-03-18 16:24:26 +0100 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-03-18 16:24:26 +0100 |
commit | 4aed09fd82855454888f10fc47e5728636505c21 (patch) | |
tree | 6e40200a278e2573760e38003a638e44602b587d | |
parent | f698a028242b591c05000c4f97e1b054f645cda8 (diff) |
tp_protocol_new() has been removed
Fix this by passing a TpClientFactory instead of TpDBusDaemon to mcd-storage.
-rw-r--r-- | src/mcd-account-manager.c | 2 | ||||
-rw-r--r-- | src/mcd-storage.c | 37 | ||||
-rw-r--r-- | src/mcd-storage.h | 4 |
3 files changed, 22 insertions, 21 deletions
diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c index 45c180e3..c96ab27a 100644 --- a/src/mcd-account-manager.c +++ b/src/mcd-account-manager.c @@ -1599,7 +1599,7 @@ _mcd_account_manager_constructed (GObject *obj) priv->minotaur = mcd_connectivity_monitor_new (); - priv->storage = mcd_storage_new (priv->dbus_daemon); + priv->storage = mcd_storage_new (priv->client_factory); priv->accounts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, unref_account); diff --git a/src/mcd-storage.c b/src/mcd-storage.c index 648419c7..fccf9de1 100644 --- a/src/mcd-storage.c +++ b/src/mcd-storage.c @@ -47,7 +47,7 @@ static GList *stores = NULL; static void sort_and_cache_plugins (void); enum { - PROP_DBUS_DAEMON = 1, + PROP_CLIENT_FACTORY = 1, }; struct _McdStorageClass { @@ -117,7 +117,7 @@ storage_dispose (GObject *object) GObjectFinalizeFunc dispose = G_OBJECT_CLASS (mcd_storage_parent_class)->dispose; - tp_clear_object (&self->dbusd); + tp_clear_object (&self->factory); if (dispose != NULL) dispose (object); @@ -131,9 +131,9 @@ storage_set_property (GObject *obj, guint prop_id, switch (prop_id) { - case PROP_DBUS_DAEMON: - tp_clear_object (&self->dbusd); - self->dbusd = TP_DBUS_DAEMON (g_value_dup_object (val)); + case PROP_CLIENT_FACTORY: + g_assert (self->factory == NULL); /* construct only */ + self->factory = g_value_dup_object (val); break; default: @@ -150,8 +150,8 @@ storage_get_property (GObject *obj, guint prop_id, switch (prop_id) { - case PROP_DBUS_DAEMON: - g_value_set_object (val, self->dbusd); + case PROP_CLIENT_FACTORY: + g_value_set_object (val, self->factory); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); @@ -163,25 +163,25 @@ static void mcd_storage_class_init (McdStorageClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; - GParamSpec *spec = g_param_spec_object ("dbus-daemon", - "DBus daemon", - "DBus daemon", - TP_TYPE_DBUS_DAEMON, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + GParamSpec *spec = g_param_spec_object ("client-factory", + "client-factory", + "TpClientFactory", + TP_TYPE_CLIENT_FACTORY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); object_class->set_property = storage_set_property; object_class->get_property = storage_get_property; object_class->dispose = storage_dispose; object_class->finalize = storage_finalize; - g_object_class_install_property (object_class, PROP_DBUS_DAEMON, spec); + g_object_class_install_property (object_class, PROP_CLIENT_FACTORY, spec); } McdStorage * -mcd_storage_new (TpDBusDaemon *dbus_daemon) +mcd_storage_new (TpClientFactory *factory) { return g_object_new (MCD_TYPE_STORAGE, - "dbus-daemon", dbus_daemon, + "client-factory", factory, NULL); } @@ -570,7 +570,8 @@ unique_name (const McpAccountManager *ma, gchar *esc_manager, *esc_protocol, *esc_base; guint i; gsize base_len = strlen (TP_ACCOUNT_OBJECT_PATH_BASE); - DBusGConnection *connection = tp_proxy_get_dbus_connection (self->dbusd); + TpDBusDaemon *dbus = tp_client_factory_get_dbus_daemon (self->factory); + DBusGConnection *connection = tp_proxy_get_dbus_connection (dbus); esc_manager = tp_escape_as_identifier (manager); esc_protocol = g_strdelimit (g_strdup (protocol), "-", '_'); @@ -654,8 +655,8 @@ identify_account_async (McpAccountManager *mcpa, g_task_set_task_data (task, g_strdup (base), g_free); - protocol = tp_protocol_new (self->dbusd, manager, protocol_name, - NULL, &error); + protocol = tp_client_factory_ensure_protocol (self->factory, manager, + protocol_name, NULL, &error); if (protocol == NULL) { diff --git a/src/mcd-storage.h b/src/mcd-storage.h index e4408451..b78d839a 100644 --- a/src/mcd-storage.h +++ b/src/mcd-storage.h @@ -29,7 +29,7 @@ G_BEGIN_DECLS typedef struct { GObject parent; - TpDBusDaemon *dbusd; + TpClientFactory *factory; /* owned string => owned McdStorageAccount */ GHashTable *accounts; } McdStorage; @@ -56,7 +56,7 @@ typedef struct _McdStoragePrivate McdStoragePrivate; GType mcd_storage_get_type (void); -McdStorage *mcd_storage_new (TpDBusDaemon *dbus_daemon); +McdStorage *mcd_storage_new (TpClientFactory *factory); void mcd_storage_ready (McdStorage *self); void mcd_storage_connect_signal (const gchar *signal, GCallback func, |