diff options
Diffstat (limited to 'libdbusmenu-glib')
| -rw-r--r-- | libdbusmenu-glib/dbus-menu.xml | 17 | ||||
| -rw-r--r-- | libdbusmenu-glib/menuitem.c | 5 |
2 files changed, 14 insertions, 8 deletions
diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 121725e..9af78fa 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- -A library to allow applictions to provide simple indications of +A library to allow applications to provide simple indications of information to be displayed to users of the application through the interface shell. @@ -8,7 +8,7 @@ Copyright 2009 Canonical Ltd. Authors: Ted Gould <ted@canonical.com> - Aurelien Gateau <ted@canonical.com> + Aurélien Gâteau <aurelien.gateau@canonical.com> This program is free software: you can redistribute it and/or modify it under the terms of either or both of the following licenses: @@ -37,6 +37,9 @@ License version 3 and version 2.1 along with this program. If not, see Items are represented with a unique numeric id and a dictionary of properties. + To reduce the amount of DBus traffic, a property should only be returned + if its value is not the default value. + Available properties are: <table> @@ -151,13 +154,13 @@ License version 3 and version 2.1 along with this program. If not, see XML syntax: @verbatim -<menu id="1" revision="2"> # Root container - <menu id="2" revision="2"> # First level menu, for example "File" - <menu id="3" revision="2"/> ~ Second level menu, for example "Open" - <menu id="4" revision="3"/> +<menu id="0"> # Root container + <menu id="1"> # First level menu, for example "File" + <menu id="2"/> ~ Second level menu, for example "Open" + <menu id="3"/> ... </menu> - <menu id="5" revision="2"> # Another first level menu, say "Edit" + <menu id="4"> # Another first level menu, say "Edit" ... </menu> ... diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 14bc2db..6739257 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -270,7 +270,7 @@ dbusmenu_menuitem_init (DbusmenuMenuitem *self) { DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(self); - priv->id = 0; + priv->id = -1; priv->children = NULL; priv->properties = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, _g_value_free); @@ -335,6 +335,9 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) switch (id) { case PROP_ID: + if (priv->id == -1) { + priv->id = menuitem_next_id++; + } g_value_set_int(value, priv->id); break; } |
