[packagekit] [Q] How "GetDepends" connect with "get_depends"

NZzi spng.yang at gmail.com
Wed Sep 17 06:24:46 PDT 2008


Richard Hughes wrote:
> On Wed, 2008-09-17 at 18:55 +0800, NZzi wrote:
>>> 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.
> 
> No problem, this was all new to me once.
> 
>> after goting dbus method on that interface(PkTransaction),
>> how packagekit know to invoke pk_transaction_get_depends(),
>> when received a "GetDepends" method from dbus?
> 
> That last little step is done by dbus-glib, and I honestly don't know
> how the internals works.
> 
> All I know is that if I call dbus_g_connection_register_g_object after
> feeding it a .xml introspection file (look at Makefile.am) it converts a
> dbus MethodNameLikeThis to a a function_name_like_this.


yes, i read the Makefile.am and xml files. i have two questions left:

1
you wrote the xml files(pk-transaction-files.xml), which is
not generated by tools, right?

2
if the method name is "GetDepends", then your corresponding
functions name must get_depends(), right? and the prefix of
"pk_transaction_get_depends()" is added by:

$(LIBTOOL) --mode=execute dbus-binding-tool --prefix=pk_transaction ...

after you name like this, dbus-glib will add connection
between "GetDepends" and "pk_transaction_get_depends()"
automatically, right?


> 
> If you checkout the dbus-glib source code I'm sure it'll be interesting
> reading -- I've never played much with the internals and so can't help
> you much more, sorry.
> 
> Richard.
> 
> 
> _______________________________________________
> PackageKit mailing list
> PackageKit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/packagekit
> 




More information about the PackageKit mailing list