summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorDaniel Boles <dboles.src@gmail.com>2018-04-17 20:03:07 +0100
committerDaniel Boles <dboles.src@gmail.com>2018-04-17 20:53:48 +0100
commitd13e78831b26b4962a9e86f75c2073a5b6adf356 (patch)
treee2261c81885d2606174577de41414d5f9f9996aa /gtk
parent4fae962a0384213a9b88cc2afdd27adae468088d (diff)
downloadgtk+-d13e78831b26b4962a9e86f75c2073a5b6adf356.tar.gz
Menu|Item: Fix FIXME re non-const interned strings
These are members of the private struct, so it hurts no one to fix this.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkmenu.c3
-rw-r--r--gtk/gtkmenuitem.c4
-rw-r--r--gtk/gtkmenuitemprivate.h2
-rw-r--r--gtk/gtkmenuprivate.h2
4 files changed, 5 insertions, 6 deletions
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 57ee7910b2..1978f49b44 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -2388,8 +2388,7 @@ gtk_menu_set_accel_path (GtkMenu *menu,
if (accel_path)
g_return_if_fail (accel_path[0] == '<' && strchr (accel_path, '/')); /* simplistic check */
- /* FIXME: accel_path should be defined as const gchar* */
- priv->accel_path = (gchar*)g_intern_string (accel_path);
+ priv->accel_path = g_intern_string (accel_path);
if (priv->accel_path)
_gtk_menu_refresh_accel_paths (menu, FALSE);
}
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index d827bb276d..06867ab088 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -1693,7 +1693,7 @@ _gtk_menu_item_refresh_accel_path (GtkMenuItem *menu_item,
if (postfix)
{
new_path = g_strconcat (prefix, "/", postfix, NULL);
- path = priv->accel_path = (char*)g_intern_string (new_path);
+ path = priv->accel_path = g_intern_string (new_path);
g_free (new_path);
}
}
@@ -1745,7 +1745,7 @@ gtk_menu_item_set_accel_path (GtkMenuItem *menu_item,
widget = GTK_WIDGET (menu_item);
/* store new path */
- priv->accel_path = (char*)g_intern_string (accel_path);
+ priv->accel_path = g_intern_string (accel_path);
/* forget accelerators associated with old path */
gtk_widget_set_accel_path (widget, NULL, NULL);
diff --git a/gtk/gtkmenuitemprivate.h b/gtk/gtkmenuitemprivate.h
index 66407f64e9..0008c1f187 100644
--- a/gtk/gtkmenuitemprivate.h
+++ b/gtk/gtkmenuitemprivate.h
@@ -34,7 +34,7 @@ struct _GtkMenuItemPrivate
guint timer;
- gchar *accel_path;
+ const char *accel_path;
GtkActionHelper *action_helper;
diff --git a/gtk/gtkmenuprivate.h b/gtk/gtkmenuprivate.h
index e34f1131f8..3ef3525a88 100644
--- a/gtk/gtkmenuprivate.h
+++ b/gtk/gtkmenuprivate.h
@@ -45,7 +45,7 @@ struct _GtkMenuPrivate
GtkWidget *old_active_menu_item;
GtkAccelGroup *accel_group;
- gchar *accel_path;
+ const char *accel_path;
GtkMenuPositionFunc position_func;
gpointer position_func_data;