Merge lp:~cyphermox/libdbusmenu/menuitem-max-id into lp:libdbusmenu/13.04

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 442
Merged at revision: 442
Proposed branch: lp:~cyphermox/libdbusmenu/menuitem-max-id
Merge into: lp:libdbusmenu/13.04
Diff against target: 39 lines (+12/-3)
1 file modified
libdbusmenu-glib/menuitem.c (+12/-3)
To merge this branch: bzr merge lp:~cyphermox/libdbusmenu/menuitem-max-id
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sebastien Bacher Approve
Review via email: mp+169032@code.launchpad.net

Commit message

Bump maximum value for menuitem ID from 30000 to MAXINT; which should help nm-applet have usable menus.

Fix is a cherry pick from revision 445 on lp:dbusmenu; from Chris Coulson.

Description of the change

Bump maximum value for menuitem ID from 30000 to MAXINT; which should help nm-applet have usable menus.

Fix is a cherry pick from revision 445 on lp:dbusmenu; from Chris Coulson.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

we want that fix in raring indeed ;-)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libdbusmenu-glib/menuitem.c'
--- libdbusmenu-glib/menuitem.c 2013-01-24 15:51:14 +0000
+++ libdbusmenu-glib/menuitem.c 2013-06-12 18:35:40 +0000
@@ -270,7 +270,7 @@
270 g_object_class_install_property (object_class, PROP_ID,270 g_object_class_install_property (object_class, PROP_ID,
271 g_param_spec_int(PROP_ID_S, "ID for the menu item",271 g_param_spec_int(PROP_ID_S, "ID for the menu item",
272 "This is a unique indentifier for the menu item.",272 "This is a unique indentifier for the menu item.",
273 -1, 30000, -1,273 -1, G_MAXINT, -1,
274 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));274 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
275275
276 /* Check transfer functions for GValue */276 /* Check transfer functions for GValue */
@@ -391,7 +391,11 @@
391 case PROP_ID:391 case PROP_ID:
392 priv->id = g_value_get_int(value);392 priv->id = g_value_get_int(value);
393 if (priv->id > menuitem_next_id) {393 if (priv->id > menuitem_next_id) {
394 menuitem_next_id = priv->id + 1;394 if (priv->id == G_MAXINT) {
395 menuitem_next_id = 1;
396 } else {
397 menuitem_next_id = priv->id + 1;
398 }
395 }399 }
396 break;400 break;
397 default:401 default:
@@ -410,7 +414,12 @@
410 switch (id) {414 switch (id) {
411 case PROP_ID:415 case PROP_ID:
412 if (priv->id == -1) {416 if (priv->id == -1) {
413 priv->id = menuitem_next_id++;417 priv->id = menuitem_next_id;
418 if (menuitem_next_id == G_MAXINT) {
419 menuitem_next_id = 1;
420 } else {
421 menuitem_next_id += 1;
422 }
414 }423 }
415 if (dbusmenu_menuitem_get_root(DBUSMENU_MENUITEM(obj))) {424 if (dbusmenu_menuitem_get_root(DBUSMENU_MENUITEM(obj))) {
416 g_value_set_int(value, 0);425 g_value_set_int(value, 0);

Subscribers

People subscribed via source and target branches