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
1=== modified file 'libdbusmenu-glib/menuitem.c'
2--- libdbusmenu-glib/menuitem.c 2013-01-24 15:51:14 +0000
3+++ libdbusmenu-glib/menuitem.c 2013-06-12 18:35:40 +0000
4@@ -270,7 +270,7 @@
5 g_object_class_install_property (object_class, PROP_ID,
6 g_param_spec_int(PROP_ID_S, "ID for the menu item",
7 "This is a unique indentifier for the menu item.",
8- -1, 30000, -1,
9+ -1, G_MAXINT, -1,
10 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
11
12 /* Check transfer functions for GValue */
13@@ -391,7 +391,11 @@
14 case PROP_ID:
15 priv->id = g_value_get_int(value);
16 if (priv->id > menuitem_next_id) {
17- menuitem_next_id = priv->id + 1;
18+ if (priv->id == G_MAXINT) {
19+ menuitem_next_id = 1;
20+ } else {
21+ menuitem_next_id = priv->id + 1;
22+ }
23 }
24 break;
25 default:
26@@ -410,7 +414,12 @@
27 switch (id) {
28 case PROP_ID:
29 if (priv->id == -1) {
30- priv->id = menuitem_next_id++;
31+ priv->id = menuitem_next_id;
32+ if (menuitem_next_id == G_MAXINT) {
33+ menuitem_next_id = 1;
34+ } else {
35+ menuitem_next_id += 1;
36+ }
37 }
38 if (dbusmenu_menuitem_get_root(DBUSMENU_MENUITEM(obj))) {
39 g_value_set_int(value, 0);

Subscribers

People subscribed via source and target branches