Author: jannis
Date: 2007-01-15 12:25:19 +0000 (Mon, 15 Jan 2007)
New Revision: 24477
Modified:
libfrap/trunk/libfrap/menu/ChangeLog
libfrap/trunk/libfrap/menu/frap-menu-item.c
Log:
* frap-menu-item.c: Free TryExec argument list. Remove old code. Don't
copy the Exec string unnecessarily. Close the XfceRc file properly
at the end of the function.
Modified: libfrap/trunk/libfrap/menu/ChangeLog
===================================================================
--- libfrap/trunk/libfrap/menu/ChangeLog 2007-01-15 11:37:03 UTC (rev
24476)
+++ libfrap/trunk/libfrap/menu/ChangeLog 2007-01-15 12:25:19 UTC (rev
24477)
@@ -1,5 +1,11 @@
-2006-01-14 Jannis Pohlmann <[EMAIL PROTECTED]>
+2007-01-15 Jannis Pohlmann <[EMAIL PROTECTED]>
+ * frap-menu-item.c: Free TryExec argument list. Remove old code. Don't
+ copy the Exec string unnecessarily. Close the XfceRc file properly
+ at the end of the function.
+
+2007-01-14 Jannis Pohlmann <[EMAIL PROTECTED]>
+
* frap-menu.{c,h}: Add frap_menu_get_items() method as a convenience
wrapper around frap_menu_item_pool_foreach. Thanks to Benny again.
Modified: libfrap/trunk/libfrap/menu/frap-menu-item.c
===================================================================
--- libfrap/trunk/libfrap/menu/frap-menu-item.c 2007-01-15 11:37:03 UTC (rev
24476)
+++ libfrap/trunk/libfrap/menu/frap-menu-item.c 2007-01-15 12:25:19 UTC (rev
24477)
@@ -451,6 +451,9 @@
g_free (command);
}
+ /* Free TryExec arguments */
+ g_strfreev (mt);
+
/* If the program is not present, we just ignore it */
if (G_UNLIKELY (!present))
{
@@ -462,15 +465,6 @@
/* Validate Name and Exec fields */
if (G_LIKELY (exec != NULL && name != NULL && g_utf8_validate (name, -1,
NULL)))
{
-#if 0
- /* Append %f to the exec command if the application hasn't set anything
else */
- if (strstr (exec, "%f") == NULL && strstr (exec, "%F") == NULL && strstr
(exec, "%u") == NULL && strstr (exec, "%U") == NULL)
- command = g_strconcat (exec, " %f", NULL);
- else
- command = g_strdup (exec);
-#endif
- command = g_strdup (exec);
-
/* Determine other application properties */
terminal = xfce_rc_read_bool_entry (rc, "Terminal", FALSE);
hidden = xfce_rc_read_bool_entry (rc, "Hidden", FALSE) ||
xfce_rc_read_bool_entry (rc, "NoDisplay", FALSE);
@@ -479,7 +473,7 @@
/* Allocate a new menu item instance */
item = g_object_new (FRAP_TYPE_MENU_ITEM,
"filename", filename,
- "command", command,
+ "command", exec,
"name", name,
"icon-name", icon,
"requires-terminal", terminal,
@@ -503,11 +497,11 @@
/* Assign categories list to the menu item */
frap_menu_item_set_categories (item, categories);
}
-
- /* Free the command */
- g_free (command);
}
+ /* Close file handle */
+ xfce_rc_close (rc);
+
return item;
}
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits