GDBus: Don't take a GError for g_dbus_proxy_get_cached_property_names()

We stopped doing this for get_cached_property() so no reason to do it
here.

Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
David Zeuthen 2010-05-13 17:10:15 -04:00
parent 3ca28ef718
commit 0e2c708bb2
3 changed files with 11 additions and 23 deletions

View File

@ -445,6 +445,10 @@ static void
g_dbus_proxy_init (GDBusProxy *proxy)
{
proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, G_TYPE_DBUS_PROXY, GDBusProxyPrivate);
proxy->priv->properties = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
(GDestroyNotify) g_variant_unref);
}
/* ---------------------------------------------------------------------------------------------------- */
@ -452,18 +456,16 @@ g_dbus_proxy_init (GDBusProxy *proxy)
/**
* g_dbus_proxy_get_cached_property_names:
* @proxy: A #GDBusProxy.
* @error: Return location for error or %NULL.
*
* Gets the names of all cached properties on @proxy.
*
* Returns: A %NULL-terminated array of strings or %NULL if @error is set. Free with
* g_strfreev().
* Returns: A %NULL-terminated array of strings or %NULL if @proxy has
* no cached properties. Free the returned array with g_strfreev().
*
* Since: 2.26
*/
gchar **
g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy,
GError **error)
g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy)
{
gchar **names;
GPtrArray *p;
@ -471,18 +473,10 @@ g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy,
const gchar *key;
g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
names = NULL;
if (proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_FAILED,
_("Properties are not available (proxy created with G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES)"));
if (g_hash_table_size (proxy->priv->properties) == 0)
goto out;
}
p = g_ptr_array_new ();
@ -790,11 +784,6 @@ process_get_all_reply (GDBusProxy *proxy,
goto out;
}
proxy->priv->properties = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
(GDestroyNotify) g_variant_unref);
g_variant_iter_init (&iter, g_variant_get_child_value (result, 0));
while ((item = g_variant_iter_next_value (&iter)) != NULL)
{

View File

@ -127,8 +127,7 @@ GVariant *g_dbus_proxy_get_cached_property (GDBusProxy *pr
void g_dbus_proxy_set_cached_property (GDBusProxy *proxy,
const gchar *property_name,
GVariant *value);
gchar **g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy,
GError **error);
gchar **g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy);
void g_dbus_proxy_call (GDBusProxy *proxy,
const gchar *method_name,
GVariant *parameters,

View File

@ -26,7 +26,7 @@ print_properties (GDBusProxy *proxy)
g_print (" properties:\n");
property_names = g_dbus_proxy_get_cached_property_names (proxy, NULL);
property_names = g_dbus_proxy_get_cached_property_names (proxy);
for (n = 0; property_names != NULL && property_names[n] != NULL; n++)
{
const gchar *key = property_names[n];