Add some more info for desktop app info
Small gotchas that can easily be avoided.
This commit is contained in:
parent
8291530abf
commit
69745041f8
@ -144,7 +144,7 @@
|
|||||||
GAppLaunchContext *context;
|
GAppLaunchContext *context;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
info = g_desktop_app_info_new ("epiphany.desktop");
|
info = (GAppInfo *) g_desktop_app_info_new ("epiphany.desktop");
|
||||||
context = gdk_display_get_app_launch_context (display);
|
context = gdk_display_get_app_launch_context (display);
|
||||||
g_app_info_launch (info, NULL, context, &error);
|
g_app_info_launch (info, NULL, context, &error);
|
||||||
|
|
||||||
@ -157,6 +157,10 @@
|
|||||||
g_object_unref (info);
|
g_object_unref (info);
|
||||||
g_object_unref (context);
|
g_object_unref (context);
|
||||||
</programlisting></informalexample>
|
</programlisting></informalexample>
|
||||||
|
Remember that you have to include
|
||||||
|
<filename>gio/gdesktopappinfo.h</filename>
|
||||||
|
and use the <filename>gio-unix-2.0</filename> pkg-config file
|
||||||
|
when using g_desktop_app_info_new().
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>If you are launching a custom commandline, you can
|
<listitem>If you are launching a custom commandline, you can
|
||||||
still use g_app_info_launch() with a GAppInfo that is constructed
|
still use g_app_info_launch() with a GAppInfo that is constructed
|
||||||
|
Loading…
Reference in New Issue
Block a user