export application command line arguments to DBUS
Will Thompson
will.thompson at collabora.co.uk
Mon Oct 25 04:59:20 PDT 2010
On 25/10/10 12:52, Giacomo wrote:
> Hi and thanks,
>
> 2010/10/25 Will Thompson<will.thompson at collabora.co.uk>:
>
>> On 25/10/10 09:23, Giacomo wrote:
>>
>>> I would like to export to DBus my application command line arguments.
>>> In this way a client app of the
>>> DBus server can retrieve the arguments of another app (App1) via the
>>> DBus session bus, instead of querying
>>> the application App1 direclty.
>>>
>>>
>> The bus doesn't actually know anything about services' objects. When you
>> ‘register’ an object in your application, you're just telling your D-Bus
>> client library about it, not the bus. D-Bus introspection is just another
>> interface, so when you're introspect App1 you are querying it directly.
>>
>> Why don't you want to do that? :)
>>
> I have an application browser that launches app1 if app1 is not yet running..
> Two apps are considered the same if they have the same executable name
> and the same
> command line arguments.
>
> Suppose that app1 is running, but it is busy. The used wants to launch
> app1 again through the
> browser.
>
> The browser knows through DBus that app1 is running, but must query
> app1 its arguments, to
> test whether app1 is to be considered already running.
> The browser will not be able to determine the application arguments
> until app1 responds.
>
> For this reason I would like to have the arguments available without
> querying the app1.
>
For a slightly different approach to this problem, see GApplication,
which has just been merged to glib:
http://git.gnome.org/browse/glib/tree/gio/gapplication.c
--
Will
More information about the dbus
mailing list