summaryrefslogtreecommitdiff
path: root/gtk/gtkaction.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2008-06-07 20:40:20 +0000
committerChristian Persch <chpe@src.gnome.org>2008-06-07 20:40:20 +0000
commitdcc94280362d27cb980bfb8e5a3b1db40874a027 (patch)
tree5605939127d36993c90f7e3840b039521d5b4981 /gtk/gtkaction.c
parente2642ac9d2d4652e7583ff8962896c6b9dd3ac5f (diff)
downloadgtk+-dcc94280362d27cb980bfb8e5a3b1db40874a027.tar.gz
Bug 535608 – do not string-copy accel paths in the menu code
Don't store the accel path as a string in gtkmenu/gtkmenuitem. The accel path will be interned anyway, so keeping a string copy around is just a waste of memory. Improve the documentation to mention this. svn path=/trunk/; revision=20331
Diffstat (limited to 'gtk/gtkaction.c')
-rw-r--r--gtk/gtkaction.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c
index 22fb10812c..f7d3a7ad34 100644
--- a/gtk/gtkaction.c
+++ b/gtk/gtkaction.c
@@ -119,9 +119,7 @@ G_DEFINE_TYPE_WITH_CODE (GtkAction, gtk_action, G_TYPE_OBJECT,
gtk_action_buildable_init))
-static GQuark accel_path_id = 0;
static GQuark quark_gtk_action_proxy = 0;
-static const gchar accel_path_key[] = "GtkAction::accel_path";
static const gchar gtk_action_proxy_key[] = "gtk-action";
static void gtk_action_finalize (GObject *object);
@@ -176,7 +174,6 @@ gtk_action_class_init (GtkActionClass *klass)
{
GObjectClass *gobject_class;
- accel_path_id = g_quark_from_static_string (accel_path_key);
quark_gtk_action_proxy = g_quark_from_static_string (gtk_action_proxy_key);
gobject_class = G_OBJECT_CLASS (klass);
@@ -1662,6 +1659,10 @@ gtk_action_set_action_group (GtkAction *action,
* with the action will have this accel path, so that their
* accelerators are consistent.
*
+ * Note that @accel_path string will be stored in a #GQuark. Therefore, if you
+ * pass a static string, you can save some memory by interning it first with
+ * g_intern_static_string().
+ *
* Since: 2.4
*/
void