[Bug 49372] deprecate tp_account/connection/channel_new

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon May 21 12:15:24 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=49372

--- Comment #3 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-05-21 03:15:24 PDT ---
The commits should ideally reference this bug number (git rebase --interactive
and use reword - I usually follow Debian's DEP-3 and use "Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=49372" as a footer in the same way
as Signed-off-by).

In "Deprecate tp_account_parse_object_path()" you seem to have incorporated the
switch from tp_account_ensure_connection to
tp_simple_client_factory_ensure_connection, which should ideally have been in
the following commit. (Not a merge blocker, obviously.)

> +_TP_DEPRECATED_IN_UNRELEASED
> TpConnection *tp_account_ensure_connection (TpAccount *account,

Shouldn't this be _TP_DEPRECATED_IN_UNRELEASED_FOR
(tp_simple_client_factory_ensure_connection)?

In the Automatic factory:
> - * @dbus: a #TpDBusDaemon
> + * @dbus: (allow-none): a #TpDBusDaemon, or %NULL

Should document the equivalence to tp_dbus_daemon_dup() like you did for the
Simple version.

In tests/lib:
> + factory = (TpSimpleClientFactory *) tp_automatic_client_factory_new (dbus);

For regression tests I think we should be using the Simple version unless
there's a specific reason not to. (Perhaps have a nullable parameter?)

(In reply to comment #0)
> TpAccount, TpConnection and TpChannel (+subclasses) are created through the
> factory now, to ensure uniqueness.
> 
> I think their _new() constructors should be deprecated

Doesn't this mean that it's impossible (or unnecessarily hard - they have to
use g_object_new and remember which properties are mandatory) for library users
to implement their own factories without calling deprecated methods? That seems
undesirable.

I agree that the documentation of those functions should say something like:

    This function does not ensure that duplicate objects are not created,
    and should only be used when implementing #TpSimpleClientFactory
    subclasses.

    In normal client code, you should construct new #TpChannel objects from a
    #TpSimpleClientFactory object, or from an instance of a subclass like
    #TpAutomaticClientFactory, using the
    tp_simple_client_factory_ensure_channel() method.

(Adapt as necessary for non-Channel classes.)

Deprecating tp_channel_new() is fine, though, since there's a better
alternative.

-- 
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