[Bug 55108] New: GVariant-based tp_protocol_new, and test coverage
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Sep 19 17:24:19 CEST 2012
https://bugs.freedesktop.org/show_bug.cgi?id=55108
Bug #: 55108
Summary: GVariant-based tp_protocol_new, and test coverage
Classification: Unclassified
Product: Telepathy
Version: unspecified
Platform: Other
OS/Version: All
Status: NEW
Severity: enhancement
Priority: medium
Component: tp-glib
AssignedTo: telepathy-bugs at lists.freedesktop.org
ReportedBy: simon.mcvittie at collabora.co.uk
QAContact: telepathy-bugs at lists.freedesktop.org
Blocks: 30422
+++ This bug was initially created as a clone of Bug #30422 +++
tp_protocol_new() takes a dbus-glib GHashTable. We should have a version that
takes a G_VARIANT_TYPE_VARDICT, taking ownership if it is floating.
The implementation is pretty easy, but there's no regression test, so I haven't
verified that this actually works or anything. We need a regression test for
tp_protocol_new() with non-NULL immutable_properties first.
/**
* tp_protocol_new_vardict:
* @dbus: proxy for the D-Bus daemon; may not be %NULL
* @cm_name: the connection manager name (such as "gabble")
* @protocol_name: the protocol name (such as "jabber")
* @immutable_properties: the immutable D-Bus properties for this protocol
* @error: used to indicate the error if %NULL is returned
*
* Create a new protocol proxy.
*
* If @immutable_properties is a floating reference, this function will
* take ownership of it, much like g_variant_ref_sink(). See documentation of
* that function for details.
*
* Returns: a new protocol proxy, or %NULL on invalid arguments
*
* Since: 0.UNRELEASED
*/
TpProtocol *
tp_protocol_new_vardict (TpDBusDaemon *dbus,
const gchar *cm_name,
const gchar *protocol_name,
GVariant *immutable_properties,
GError **error)
{
GHashTable *hash;
TpProtocol *ret;
g_return_val_if_fail (g_variant_is_of_type (immutable_properties,
G_VARIANT_TYPE_VARDICT), NULL);
g_variant_ref_sink (immutable_properties);
hash = _tp_asv_from_vardict (immutable_properties);
ret = tp_protocol_new (dbus, cm_name, protocol_name, hash, error);
g_hash_table_unref (hash);
g_variant_unref (immutable_properties);
return ret;
}
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list