[Xfce4-commits] r29497 - in libxfce4menu/trunk: . libxfce4menu
Jannis Pohlmann
jannis at xfce.org
Tue Feb 17 01:24:19 CET 2009
Author: jannis
Date: 2009-02-17 00:24:18 +0000 (Tue, 17 Feb 2009)
New Revision: 29497
Modified:
libxfce4menu/trunk/ChangeLog
libxfce4menu/trunk/NEWS
libxfce4menu/trunk/libxfce4menu/xfce-menu.c
Log:
* NEWS: Update NEWS.
* libxfce4menu/xfce-menu.c: Add directory of .menu files and all
directory dirs to the monitor when directory monitoring is enabled.
This fixes the menu not being regenerated when e.g. the file
xfce-applicatons.menu is altered. Reported by Radomir Dopieralski.
Modified: libxfce4menu/trunk/ChangeLog
===================================================================
--- libxfce4menu/trunk/ChangeLog 2009-02-16 20:52:08 UTC (rev 29496)
+++ libxfce4menu/trunk/ChangeLog 2009-02-17 00:24:18 UTC (rev 29497)
@@ -1,3 +1,11 @@
+2009-02-17 Jannis Pohlmann <jannis at xfce.org>
+
+ * NEWS: Update NEWS.
+ * libxfce4menu/xfce-menu.c: Add directory of .menu files and all
+ directory dirs to the monitor when directory monitoring is enabled.
+ This fixes the menu not being regenerated when e.g. the file
+ xfce-applicatons.menu is altered. Reported by Radomir Dopieralski.
+
2009-02-04 Jannis Pohlmann <jannis at xfce.org>
* NEWS: Update NEWS.
Modified: libxfce4menu/trunk/NEWS
===================================================================
--- libxfce4menu/trunk/NEWS 2009-02-16 20:52:08 UTC (rev 29496)
+++ libxfce4menu/trunk/NEWS 2009-02-17 00:24:18 UTC (rev 29497)
@@ -2,6 +2,8 @@
========
- Add hint about no invariant sections to COPYING.
- Fix crash when reading invalid menu files (bug #4879).
+- Monitor the directories of .menu files and all directory dirs. Otherwise
+ the menu is not regenerated when they are altered.
4.5.99.1
========
Modified: libxfce4menu/trunk/libxfce4menu/xfce-menu.c
===================================================================
--- libxfce4menu/trunk/libxfce4menu/xfce-menu.c 2009-02-16 20:52:08 UTC (rev 29496)
+++ libxfce4menu/trunk/libxfce4menu/xfce-menu.c 2009-02-17 00:24:18 UTC (rev 29497)
@@ -3140,6 +3140,7 @@
xfce_menu_monitor_start (XfceMenu *menu)
{
GSList *iter;
+ gchar *dirname;
g_return_if_fail (XFCE_IS_MENU (menu));
@@ -3153,9 +3154,21 @@
/* Monitor the application directories */
if (G_LIKELY (xfce_menu_monitor_has_flags (XFCE_MENU_MONITOR_DIRECTORIES)))
- for (iter = menu->priv->app_dirs; iter != NULL; iter = g_slist_next (iter))
- xfce_menu_monitor_add_directory (menu, (const gchar *)iter->data);
+ {
+ if (G_LIKELY (menu->priv->filename != NULL))
+ {
+ dirname = g_path_get_dirname (menu->priv->filename);
+ xfce_menu_monitor_add_directory (menu, dirname);
+ g_free (dirname);
+ }
+ for (iter = menu->priv->directory_dirs; iter != NULL; iter = g_slist_next (iter))
+ xfce_menu_monitor_add_directory (menu, (const gchar *)iter->data);
+
+ for (iter = menu->priv->app_dirs; iter != NULL; iter = g_slist_next (iter))
+ xfce_menu_monitor_add_directory (menu, (const gchar *)iter->data);
+ }
+
/* Monitor items in the menu pool */
if (G_LIKELY (xfce_menu_monitor_has_flags (XFCE_MENU_MONITOR_DESKTOP_FILES)))
xfce_menu_item_pool_foreach (menu->priv->pool, (GHFunc) item_monitor_start, menu);
More information about the Xfce4-commits
mailing list