[gnome-commander/gcmd-1-2-8] Fixed problem #637501 (advrename: metatag popup menu shows wrong items)
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/gcmd-1-2-8] Fixed problem #637501 (advrename: metatag popup menu shows wrong items)
- Date: Sat, 18 Dec 2010 22:30:59 +0000 (UTC)
commit 05a0c6c470e18c7a0424caf1a77c30a74212b5dd
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 d3cd5b9..4f141a4 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,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 10b6107..10cac79 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6071,6 +6071,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 b40077c..94a73da 100644
--- a/src/gnome-cmd-profile-component.cc
+++ b/src/gnome-cmd-profile-component.cc
@@ -438,6 +438,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);
@@ -455,12 +457,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]