[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 248/473: Fix unable to use custom commands with parameters. Closes #38.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:56:58 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 2c56f1934a390367804e7301f57a6b9f62381212
Author: Graeme Gott <graeme at gottcode.org>
Date:   Tue Nov 19 16:13:08 2013 -0500

    Fix unable to use custom commands with parameters. Closes #38.
---
 panel-plugin/command.cpp |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/command.cpp b/panel-plugin/command.cpp
index 33e5743..ad18a22 100644
--- a/panel-plugin/command.cpp
+++ b/panel-plugin/command.cpp
@@ -169,9 +169,18 @@ void Command::check()
 {
 	if (m_status == WHISKERMENU_COMMAND_UNCHECKED)
 	{
-		gchar* path = g_find_program_in_path(m_command);
-		m_status = path ? WHISKERMENU_COMMAND_VALID : WHISKERMENU_COMMAND_INVALID;
-		g_free(path);
+		gchar** argv;
+		if (g_shell_parse_argv(m_command, NULL, &argv, NULL))
+		{
+			gchar* path = g_find_program_in_path(argv[0]);
+			m_status = path ? WHISKERMENU_COMMAND_VALID : WHISKERMENU_COMMAND_INVALID;
+			g_free(path);
+			g_strfreev(argv);
+		}
+		else
+		{
+			m_status = WHISKERMENU_COMMAND_INVALID;
+		}
 	}
 
 	if (m_button)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list