Commit 02193461 authored by Gaël Bonithon's avatar Gaël Bonithon

Expand field codes

parent 2d0a328b
Pipeline #876 passed with stages
in 2 minutes and 20 seconds
......@@ -100,7 +100,7 @@ dnl Check for i18n support
XDT_I18N([@LINGUAS@])
dnl Check for required packages
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.12.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.15.1])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.15.1])
XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.22.0])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.42.0])
......
......@@ -47,6 +47,7 @@
#endif
#include <glib/gprintf.h>
#include <gio/gio.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4ui/libxfce4ui.h>
......@@ -271,7 +272,7 @@ xfsm_launch_desktop_files_on_run_hook (gboolean start_at_spi,
const gchar *try_exec;
const gchar *type;
XfsmRunHook run_hook_from_file;
const gchar *exec;
gchar *exec;
gboolean startup_notify;
gboolean terminal;
gboolean skip;
......@@ -284,6 +285,7 @@ xfsm_launch_desktop_files_on_run_hook (gboolean start_at_spi,
gint n, m;
gchar *filename;
const gchar *pattern;
gchar *uri;
/* pattern for only at-spi desktop files or everything */
if (start_at_spi)
......@@ -384,8 +386,18 @@ xfsm_launch_desktop_files_on_run_hook (gboolean start_at_spi,
xfsm_verbose ("TryExec set and xfsm_check_valid_exec failed, skipping\n");
}
/* expand the field codes */
filename = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, files[n]);
uri = g_filename_to_uri (filename, NULL, NULL);
g_free (filename);
exec = xfce_expand_field_codes (xfce_rc_read_entry (rc, "Exec", NULL),
xfce_rc_read_entry (rc, "Icon", NULL),
xfce_rc_read_entry (rc, "Name", NULL),
uri,
FALSE);
g_free (uri);
/* execute the item */
exec = xfce_rc_read_entry (rc, "Exec", NULL);
if (G_LIKELY (!skip && exec != NULL))
{
/* query launch parameters */
......@@ -413,6 +425,7 @@ xfsm_launch_desktop_files_on_run_hook (gboolean start_at_spi,
/* cleanup */
xfce_rc_close (rc);
g_free (exec);
}
g_strfreev (files);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment