[gnome-commander] Fixed problem #637501 (advrename: metatag popup menu shows wrong items)



commit e708d332d72f706fba5de0daed57097c273e451c
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sat Dec 18 23:27:58 2010 +0100

    Fixed problem #637501 (advrename: metatag popup menu shows wrong items)

 NEWS                               |    1 +
 doc/C/gnome-commander.xml          |    3 +++
 src/gnome-cmd-profile-component.cc |   11 ++++++++++-
 3 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 033f94f..3a892f1 100644
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,7 @@ gnome-commander 1.2.8.10
 
 Bug fixes:
  * Fixed problem #448941 (numeric keypad arrows don't work in the main window)
+ * Fixed problem #637501 (advrename: metatag popup menu shows wrong items)
  * Fixed problem with toggling path/basename/filename selections in copy/move dialogs
  * Updated translations: de
 
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index a818c74..a4e8acd 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -7608,6 +7608,9 @@
                             <para>Fixed problem #448941 (numeric keypad arrows don't work in the main window)</para>
                         </listitem>
                         <listitem>
+                            <para>Fixed problem #637501 (advrename: metatag popup menu shows wrong items)</para>
+                        </listitem>
+                        <listitem>
                             <para>Fixed problem with toggling path/basename/filename selections in copy/move dialogs</para>
                         </listitem>
                         <listitem>
diff --git a/src/gnome-cmd-profile-component.cc b/src/gnome-cmd-profile-component.cc
index 0611cd0..8a2ebaa 100644
--- a/src/gnome-cmd-profile-component.cc
+++ b/src/gnome-cmd-profile-component.cc
@@ -448,6 +448,8 @@ inline GtkWidget *GnomeCmdProfileComponent::Private::create_placeholder_menu(int
 
         case METATAG_MENU:
             {
+                const int BUFF_SIZE = 2048;
+                gchar *s = (gchar *) g_malloc0 (BUFF_SIZE);
                 GtkItemFactoryEntry *items = g_try_new0 (GtkItemFactoryEntry, G_N_ELEMENTS(metatags));
 
                 g_return_val_if_fail (items!=NULL, NULL);
@@ -465,12 +467,19 @@ inline GtkWidget *GnomeCmdProfileComponent::Private::create_placeholder_menu(int
                     }
                     else
                     {
-                        p->path = g_strdup_printf ("/%s/%s", gcmd_tags_get_class_name(tag), gcmd_tags_get_title(tag));
+                        strncpy (s, gcmd_tags_get_title (tag), BUFF_SIZE-1);
+
+                        for (gchar *i=s; *i; ++i)
+                            if (*i=='/')  *i = ' ';
+
+                        p->path = g_strdup_printf ("/%s/%s", gcmd_tags_get_class_name(tag), s);
                         p->callback = (GtkItemFactoryCallback) insert_num_tag;
                         p->callback_action = tag;
                     }
                 }
 
+                g_free (s);
+
                 GtkItemFactory *ifac = gtk_item_factory_new (GTK_TYPE_MENU, "<main>", NULL);
 
                 gtk_item_factory_create_items (ifac, G_N_ELEMENTS(metatags), items, this);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]