[packagekit] [Q] How "GetDepends" connect with "get_depends"
spng.yang at gmail.com
Wed Sep 17 03:55:17 PDT 2008
Richard Hughes wrote:
> On Wed, 2008-09-17 at 14:46 +0800, NZzi wrote:
>> i follow your words, and browse pk_transaction_run().
>> pk_transaction_set_running() will call corresponding
>> backend get_depends call, based on the "PK_ROLE_ENUM_GET_DEPENDS"
>> i follow the call-chains, i found it's pk_transaction_get_depends()
>> set the "PK_ROLE_ENUM_GET_DEPENDS" roles.
>> i compile packagekit, i found pk-interface-transaction.h, the
>> generated file has pk_transaction_get_depends and "GetDepends",
>> but i don't understand how packagekitd know that she should
>> call pk_transaction_get_depends() when received "GetDepends"
>> requests from dbus?
> This bit of code in pk-transaction-list.c:
> item->transaction = pk_transaction_new ();
> g_signal_connect_after (item->transaction, "finished",
> G_CALLBACK (pk_transaction_list_transaction_finished_cb), tlist);
> /* set the TID on the transaction */
> ret = pk_transaction_set_tid (item->transaction, item->tid);
> if (!ret)
> egg_error ("failed to set TID");
> /* put on the bus */
> dbus_g_object_type_install_info (PK_TYPE_TRANSACTION, &dbus_glib_pk_transaction_object_info);
> dbus_g_connection_register_g_object (connection, item->tid, G_OBJECT (item->transaction));
> The last two lines register the PkTransaction object on the bus so that
> it accepts the dbus method on that interface. Worthwhile to note is that
> the "tid" is also the DBUS path.
thanks for your patient reply.
after goting dbus method on that interface(PkTransaction),
how packagekit know to invoke pk_transaction_get_depends(),
when received a "GetDepends" method from dbus?
>> BTW, i browse pk-engine.c, i still don't know where packagekitd
>> received dbus messages(requests),and process, and "goto"
> If you use the default path, /org/freedesktop/PackageKit then you use
> the PkEngine interface, but if you use the path of the TID, then the
> correct PkTransaction object is used.
> PackageKit mailing list
> PackageKit at lists.freedesktop.org
More information about the PackageKit