[Bug 38142] proxy factories

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jun 10 11:58:40 CEST 2011


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

--- Comment #2 from Xavier Claessens <xclaesse at gmail.com> 2011-06-10 02:58:40 PDT ---
Forgot that we'll also need to add methods like

tp_proxy_set_factory(TpProxy *proxy, TpSimpleClientFactory *factory);

that will be called by the factory when creating a new proxy subclass
(TpConnection, TpChannel, etc). Like that TpAccount would use that factory to
create its TpConnection object, and prepare it.


With my proposal, a typical app would do (supposing my contact-list branch is
merged and uses factories)

factory = tp_user_factory_dup_singleton();
tp_user_factory_add_account_manager_features (factory,
[TP_ACCOUNT_MANAGER_FEATURE_ACCOUNT]);
tp_user_factory_add_account_features (factory,
[TP_ACCOUNT_FEATURE_CONNECTION]);
tp_user_factory_add_connection_features (factory,
[TP_CONNECTION_FEATURE_CONTACT_LIST]);
tp_user_factory_add_contact_features (factory, [TP_CONTACT_FEATURE_ALIAS]);


manager = tp_user_factory_create_account_manager(factory);
manager_features = tp_user_factory_dup_account_manager_features(factory,
manager);
tp_proxy_prepare_async (manager, manager_features, callback);


void callback(manager)
{
  /* everything is ready as described by the factory, so we can iterate on
manager's accounts, connection, contacts, all with sync APIs and no other
callback */
}

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