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 555486 - No way to recover command line from GAppInfo
No way to recover command line from GAppInfo
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 555487
 
 
Reported: 2008-10-08 01:07 UTC by Hans Petter Jansson
Modified: 2008-11-28 23:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hans Petter Jansson 2008-10-08 01:07:41 UTC
When you use g_app_info_create_from_commandline(), there is no way to recover the command line using the getters, at least not for the GDesktopAppInfo implementation.

g_app_info_get_executable () returns the name of the executable (usually the basename of the first component of the command line) without any options.

This makes the Nautilus "Open With" dialog inconsistent. You can create a new handler using a command line, but when you get back to the dialog and click the command you created, the entry box will only contain the executable, not the whole command line - although launching the command works fine, since the arguments are stored in the background.

This could be solved by either making the get_executable () method return the whole command line (not a good option as apps may be relying on the old behavior), or adding a new method, get_commandline ().
Comment 1 Matthias Clasen 2008-10-09 02:30:30 UTC
I guess g_app_info_get_commandline would be an ok addition.
Comment 2 Matthias Clasen 2008-11-28 23:16:54 UTC
        * gio.symbols:
        * gappinfo.[hc]: Add g_app_info_get_commandline. Requested
        by Hans Petter Jansson.

        * gdesktopappinfo.c: And implement it here.