After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 641720 - Misleading definition for local_command_line() in GApplication.
Misleading definition for local_command_line() in GApplication.
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gapplication
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-02-07 13:15 UTC by Patricia Santana Cruz
Modified: 2011-11-30 03:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Clarify local_command_line docs (1.36 KB, patch)
2011-11-30 03:10 UTC, Matthias Clasen
committed Details | Review

Description Patricia Santana Cruz 2011-02-07 13:15:30 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.
Comment 1 Murray Cumming 2011-11-15 08:14:07 UTC
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?
Comment 2 Allison Karlitskaya (desrt) 2011-11-15 14:21:50 UTC
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...
Comment 3 Matthias Clasen 2011-11-30 03:10:49 UTC
The following fix has been pushed:
3aa0fc4 Clarify local_command_line docs
Comment 4 Matthias Clasen 2011-11-30 03:10:52 UTC
Created attachment 202416 [details] [review]
Clarify local_command_line docs