diff options
author | Ted Gould <ted@gould.cx> | 2010-02-04 19:33:06 -0800 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-04 19:33:06 -0800 |
commit | 83b95ddc6fd3317cc4c0e4b65d42c59bfb208a84 (patch) | |
tree | 517cb84cef6ef2a2a66e0eaf866f35a00b9eba4e | |
parent | 6bed6531192b318cfcf4281662491521b95b68f6 (diff) | |
parent | 8453c34c99dea3ab0742bfb87045b880a723c4f9 (diff) | |
download | libdbusmenu-83b95ddc6fd3317cc4c0e4b65d42c59bfb208a84.tar.gz libdbusmenu-83b95ddc6fd3317cc4c0e4b65d42c59bfb208a84.tar.bz2 libdbusmenu-83b95ddc6fd3317cc4c0e4b65d42c59bfb208a84.zip |
* Upstream Merge
* Auto handle ids even for subclasses
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | libdbusmenu-glib/dbus-menu.xml | 17 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 5 |
3 files changed, 21 insertions, 8 deletions
diff --git a/debian/changelog b/debian/changelog index 4c9b347..4663ee6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libdbusmenu (0.2.2-0ubuntu1~ppa2~autoid1) UNRELEASED; urgency=low + + * Upstream Merge + * Auto handle ids even for subclasses + + -- Ted Gould <ted@ubuntu.com> Thu, 04 Feb 2010 19:32:34 -0800 + libdbusmenu (0.2.2-0ubuntu1~ppa1) lucid; urgency=low * Upstream Release 0.2.2 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; } |