diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-06-18 12:26:59 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-06-18 12:26:59 -0500 |
commit | 6c4e291f69fca1b30b08658fea9b7dd85d3a67ee (patch) | |
tree | 540714a9a579a01a7bcb5b6bf7be046d1bc3ef60 /libdbusmenu-glib | |
parent | 9b75358ca14e1ad8a41c364195df748a1a1bbf5d (diff) | |
parent | ddbe5f1a0c8f487c1a633834b8f5df418162af92 (diff) | |
download | libdbusmenu-6c4e291f69fca1b30b08658fea9b7dd85d3a67ee.tar.gz libdbusmenu-6c4e291f69fca1b30b08658fea9b7dd85d3a67ee.tar.bz2 libdbusmenu-6c4e291f69fca1b30b08658fea9b7dd85d3a67ee.zip |
sync with trunk
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index cd9f978..0b85193 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -270,7 +270,7 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass) g_object_class_install_property (object_class, PROP_ID, g_param_spec_int(PROP_ID_S, "ID for the menu item", "This is a unique indentifier for the menu item.", - -1, 30000, -1, + -1, G_MAXINT, -1, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); /* Check transfer functions for GValue */ @@ -391,7 +391,11 @@ set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec) case PROP_ID: priv->id = g_value_get_int(value); if (priv->id > menuitem_next_id) { - menuitem_next_id = priv->id + 1; + if (priv->id == G_MAXINT) { + menuitem_next_id = 1; + } else { + menuitem_next_id = priv->id + 1; + } } break; default: @@ -410,7 +414,12 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) switch (id) { case PROP_ID: if (priv->id == -1) { - priv->id = menuitem_next_id++; + priv->id = menuitem_next_id; + if (menuitem_next_id == G_MAXINT) { + menuitem_next_id = 1; + } else { + menuitem_next_id += 1; + } } if (dbusmenu_menuitem_get_root(DBUSMENU_MENUITEM(obj))) { g_value_set_int(value, 0); |