[Pkg-xfce-devel] Bug#382902: xfdesktop4: menu editor saves file without closing menu tag

David Riley dave at undef.org.uk
Mon Aug 14 02:48:34 UTC 2006

Package: xfdesktop4
Severity: normal

When editing the menu using xfce4-menueditor, if the last item in the menu
is a non-empty menu, then when the file is saved, the closing </menu> tag
is missing from the last menu in the file:

|     <menu name="Debian Menu" icon="/usr/share/pixmaps/debian-logo.png">
|         <include type="file" src="menudefs.hook"/>
| </xfdesktop-menu>

The following patch fixes the problem:

--- xfdesktop4-	2006-04-16 15:47:39.000000000 +0100
+++ xfdesktop4-	2006-08-14 03:07:01.000000000 +0100
@@ -29,6 +29,7 @@
   FILE *file_menu;
   gint last_depth;
+  ENTRY_TYPE last_type;
 static gboolean
@@ -138,9 +139,9 @@
   state->last_depth = gtk_tree_path_get_depth (path);
+  if (gtk_tree_path_get_depth (path) == 1) state->last_type = type;
   g_free (space);
   g_free (name);
   g_free (command);
@@ -174,6 +175,14 @@
     if (model)
       gtk_tree_model_foreach (model, &save_treeview_foreach_func, &state);
+    if (state.last_type == MENU) {
+        /* Add last closing menu tag. */
+        gchar *space2 = NULL;
+        space2 = g_strnfill(1, '\t');
+        fprintf (state.file_menu, "%s</menu>\n", space2);
+        g_free (space2);
+    }
     fprintf (file_menu, "</xfdesktop-menu>\n");
     fclose (file_menu);

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages xfdesktop4 depends on:
ii  libatk1.0-0               1.12.1-1       The ATK accessibility toolkit
ii  libc6                     2.3.6-15       GNU C Library: Shared libraries
ii  libcairo2                 1.2.0-3        The Cairo 2D vector graphics libra
ii  libexo-0.3-0     Library with extensions for Xfce
ii  libfontconfig1            2.3.2-7        generic font configuration library
ii  libfreetype6              2.2.1-2        FreeType 2 font engine, shared lib
ii  libglib2.0-0              2.10.3-3       The GLib library of C routines
ii  libgtk2.0-0               2.8.18-1       The GTK+ graphical user interface 
ii  libice6                   1:1.0.0-3      X11 Inter-Client Exchange library
ii  libpango1.0-0             1.12.3-1+b1    Layout and rendering of internatio
ii  libpng12-0                1.2.8rel-5.2   PNG library - runtime
ii  libsm6                    1:1.0.0-4      X11 Session Management library
ii  libthunar-vfs-1-2         0.3.0beta1-3   VFS abstraction used in thunar
ii  libx11-6                  2:1.0.0-7      X11 client-side library
ii  libxcursor1           X cursor management library
ii  libxext6                  1:1.0.0-4      X11 miscellaneous extension librar
ii  libxfce4mcs-client3     Client library for Xfce4 configure
ii  libxfce4util2        Utility functions library for Xfce
ii  libxfcegui4-4        Basic GUI C functions for Xfce4
ii  libxfixes3                1:    X11 miscellaneous 'fixes' extensio
ii  libxi6                    1:1.0.0-5      X11 Input extension library
ii  libxinerama1              1:1.0.1-4      X11 Xinerama extension library
ii  libxrandr2                2:    X11 RandR extension library
ii  libxrender1               1:    X Rendering Extension client libra
ii  procps                    1:3.2.7-2      /proc file system utilities
ii  xfce4-mcs-manager     Settings manager for Xfce4
ii  xfce4-panel          The Xfce4 desktop environment pane
ii  xfce4-utils          Various tools for Xfce
ii  zlib1g                    1:1.2.3-13     compression library - runtime

xfdesktop4 recommends no packages.

-- no debconf information

More information about the Pkg-xfce-devel mailing list