GNOME Bugzilla – Bug 641720
Misleading definition for local_command_line() in GApplication.
Last modified: 2011-11-30 03:10:52 UTC
In the the GApplication documentation page (http://library.gnome.org/devel/gio/unstable/GApplication.html), there are 2 different descriptions for the local_command_line() function. The first is on the top, and explains: "local_command_line ():invoked (locally) when the process has been invoked via commandline execution. The virtual function has the chance to inspect (and possibly replace) the list of command line arguments. See g_application_run() for more information." The second one is part of the g_application_run() function description, where it says: "[...] First, the local_command_line() virtual function is invoked. This function always runs on the local instance. If that function returns FALSE then the application is registered and the "command-line" signal is emitted in the primary instance (which may or may not be this instance) [...]". In the source code (http://git.gnome.org/browse/glib/tree/gio/gapplication.c#n1192), local_command_line() is _always_ invoked though, and then the behaviour is determined in the function, so the first definition might be wrong.
Maybe this is the updated link for the source code in _application_run(): http://git.gnome.org/browse/glib/tree/gio/gapplication.c#n1272 So, the issue is that local_command_line() is not _only_ invoked when "when the process has been invoked via commandline execution"? But from the point of view of the application code, is there any way to know or care whether the local instance was started via the command line or via some menu, for instance?
This language is meant to deal with the fact that, in the future, applications may be started via dbus activation. From the viewpoint of GApplication currently *all* starts are "from the commandline" (ie: via exec()). Some clarification might be good there...
The following fix has been pushed: 3aa0fc4 Clarify local_command_line docs
Created attachment 202416 [details] [review] Clarify local_command_line docs