diff options
author | Ted Gould <ted@canonical.com> | 2009-05-15 15:07:01 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-05-15 15:07:01 -0500 |
commit | 56fad3ec6db3ef3cb589446a11a45d06da339dd9 (patch) | |
tree | 0a368758e52f9cd13c1b3bc3164bb4daab98fe30 /libdbusmenu-glib | |
parent | e95af4b8e1facef6fe42346ecc73ef14cb92b640 (diff) | |
download | libdbusmenu-56fad3ec6db3ef3cb589446a11a45d06da339dd9.tar.gz libdbusmenu-56fad3ec6db3ef3cb589446a11a45d06da339dd9.tar.bz2 libdbusmenu-56fad3ec6db3ef3cb589446a11a45d06da339dd9.zip |
Starting to flesh out more of this DBus stuff
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/server.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 3e2fd78..6336ffd 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -35,7 +35,7 @@ License version 3 and version 2.1 along with this program. If not, see /* DBus Prototypes */ static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error); -static gboolean _dbusmenu_server_get_properties (void); +static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, gpointer dict, GError ** error); static gboolean _dbusmenu_server_call (DbusmenuServer * server, guint id, GError ** error); #include "dbusmenu-server.h" @@ -357,13 +357,39 @@ error_quark (void) static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error) { + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); + DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); + + if (mi == NULL) { + if (error != NULL) { + g_set_error(error, + error_quark(), + INVALID_MENUITEM_ID, + "The ID supplied %d does not refer to a menu item we have", + id); + } + return FALSE; + } return TRUE; } static gboolean -_dbusmenu_server_get_properties (void) +_dbusmenu_server_get_properties (DbusmenuServer * server, guint id, gpointer dict, GError ** error) { + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); + DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); + + if (mi == NULL) { + if (error != NULL) { + g_set_error(error, + error_quark(), + INVALID_MENUITEM_ID, + "The ID supplied %d does not refer to a menu item we have", + id); + } + return FALSE; + } return TRUE; } |