diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2012-07-23 15:01:46 +0200 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2012-07-31 11:59:37 +0200 |
commit | d5b392afc30cef82ec325a7e3af86a3ee181607e (patch) | |
tree | 99c015ae98dc7acd1d6338be9c084a30f369b923 /common | |
parent | 3b5991d2e3dd9cd0f9ed5d2fedef31b89207b228 (diff) | |
download | gvfs-d5b392afc30cef82ec325a7e3af86a3ee181607e.tar.gz |
gdbus: Reword GVariant arguments
and kill the iters.
Diffstat (limited to 'common')
-rw-r--r-- | common/gmountsource.c | 4 | ||||
-rw-r--r-- | common/gmountsource.h | 2 | ||||
-rw-r--r-- | common/gmountspec.c | 10 | ||||
-rw-r--r-- | common/gmountspec.h | 2 | ||||
-rw-r--r-- | common/gmounttracker.c | 8 | ||||
-rw-r--r-- | common/gmounttracker.h | 2 | ||||
-rw-r--r-- | common/gvfsdaemonprotocol.c | 48 | ||||
-rw-r--r-- | common/gvfsdaemonprotocol.h | 8 |
8 files changed, 42 insertions, 42 deletions
diff --git a/common/gmountsource.c b/common/gmountsource.c index a7692ae9..915f646d 100644 --- a/common/gmountsource.c +++ b/common/gmountsource.c @@ -104,11 +104,11 @@ g_mount_source_to_dbus (GMountSource *source) } GMountSource * -g_mount_source_from_dbus (GVariant *iter) +g_mount_source_from_dbus (GVariant *value) { const gchar *obj_path, *dbus_id; - g_variant_get (iter, "(&s&o)", + g_variant_get (value, "(&s&o)", &dbus_id, &obj_path); diff --git a/common/gmountsource.h b/common/gmountsource.h index ce93cb3b..d2a9eaec 100644 --- a/common/gmountsource.h +++ b/common/gmountsource.h @@ -55,7 +55,7 @@ GMountSource *g_mount_source_new (const char const char *obj_path); GMountSource *g_mount_source_new_dummy (void); GVariant *g_mount_source_to_dbus (GMountSource *source); -GMountSource *g_mount_source_from_dbus (GVariant *iter); +GMountSource *g_mount_source_from_dbus (GVariant *value); gboolean g_mount_source_ask_password (GMountSource *mount_source, const char *message, const char *initial_user, diff --git a/common/gmountspec.c b/common/gmountspec.c index e8a6cce3..35dd6915 100644 --- a/common/gmountspec.c +++ b/common/gmountspec.c @@ -225,16 +225,16 @@ g_mount_spec_unref (GMountSpec *spec) } GMountSpec * -g_mount_spec_from_dbus (GVariant *iter) +g_mount_spec_from_dbus (GVariant *value) { GMountSpec *spec; const gchar *key; const gchar *mount_prefix; GVariantIter *iter_mount_spec_items; - GVariant *value; + GVariant *v; mount_prefix = NULL; - g_variant_get (iter, "(^&aya{sv})", + g_variant_get (value, "(^&aya{sv})", &mount_prefix, &iter_mount_spec_items); @@ -244,9 +244,9 @@ g_mount_spec_from_dbus (GVariant *iter) if (mount_prefix && mount_prefix[0]) spec->mount_prefix = g_strdup (mount_prefix); - while (g_variant_iter_loop (iter_mount_spec_items, "{&sv}", &key, &value)) + while (g_variant_iter_loop (iter_mount_spec_items, "{&sv}", &key, &v)) { - add_item (spec, key, g_variant_dup_bytestring (value, NULL)); + add_item (spec, key, g_variant_dup_bytestring (v, NULL)); } /* Sort on key */ diff --git a/common/gmountspec.h b/common/gmountspec.h index da903e1b..143c0946 100644 --- a/common/gmountspec.h +++ b/common/gmountspec.h @@ -47,7 +47,7 @@ GMountSpec *g_mount_spec_ref (GMountSpec *spec); void g_mount_spec_unref (GMountSpec *spec); GMountSpec *g_mount_spec_get_unique_for (GMountSpec *spec); GMountSpec *g_mount_spec_copy (GMountSpec *spec); -GMountSpec *g_mount_spec_from_dbus (GVariant *iter); +GMountSpec *g_mount_spec_from_dbus (GVariant *value); GVariant *g_mount_spec_to_dbus (GMountSpec *spec); GVariant *g_mount_spec_to_dbus_with_path (GMountSpec *spec, const char *path); diff --git a/common/gmounttracker.c b/common/gmounttracker.c index 1aea340c..2a435b82 100644 --- a/common/gmounttracker.c +++ b/common/gmounttracker.c @@ -172,7 +172,7 @@ g_mount_info_apply_prefix (GMountInfo *info, } GMountInfo * -g_mount_info_from_dbus (GVariant *iter) +g_mount_info_from_dbus (GVariant *value) { GMountInfo *info; GMountSpec *mount_spec; @@ -190,7 +190,7 @@ g_mount_info_from_dbus (GVariant *iter) GVariant *iter_mount_spec; GError *error; - g_variant_get (iter, "(&s&o&s&s&s&s&sb^&ay@(aya{sv})^&ay)", + g_variant_get (value, "(&s&o&s&s&s&s&sb^&ay@(aya{sv})^&ay)", &dbus_id, &obj_path, &display_name, @@ -406,13 +406,13 @@ g_mount_tracker_remove_mount (GMountTracker *tracker, static void list_mounts_reply (GMountTracker *tracker, - GVariant *iter_mounts) + GVariant *mounts) { GMountInfo *info; GVariantIter iter; GVariant *child; - g_variant_iter_init (&iter, iter_mounts); + g_variant_iter_init (&iter, mounts); while ((child = g_variant_iter_next_value (&iter))) { info = g_mount_info_from_dbus (child); diff --git a/common/gmounttracker.h b/common/gmounttracker.h index 894bddb3..0b60c2cf 100644 --- a/common/gmounttracker.h +++ b/common/gmounttracker.h @@ -76,7 +76,7 @@ const char *g_mount_info_resolve_path (GMountInfo *info, void g_mount_info_apply_prefix (GMountInfo *info, char **path); -GMountInfo * g_mount_info_from_dbus (GVariant *iter); +GMountInfo * g_mount_info_from_dbus (GVariant *value); GMountTracker *g_mount_tracker_new (GDBusConnection *connection); GList * g_mount_tracker_list_mounts (GMountTracker *tracker); diff --git a/common/gvfsdaemonprotocol.c b/common/gvfsdaemonprotocol.c index c73aac7d..6526de85 100644 --- a/common/gvfsdaemonprotocol.c +++ b/common/gvfsdaemonprotocol.c @@ -218,11 +218,11 @@ _g_dbus_append_file_info (GFileInfo *info) } gboolean -_g_dbus_get_file_attribute (GVariant *iter, +_g_dbus_get_file_attribute (GVariant *value, gchar **attribute, GFileAttributeStatus *status, GFileAttributeType *type, - GDbusAttributeValue *value) + GDbusAttributeValue *attr_value) { gboolean res; char *str; @@ -230,7 +230,7 @@ _g_dbus_get_file_attribute (GVariant *iter, GObject *obj; GVariant *v; - g_variant_get (iter, "(suv)", + g_variant_get (value, "(suv)", attribute, status, &v); @@ -239,19 +239,19 @@ _g_dbus_get_file_attribute (GVariant *iter, if (g_variant_is_of_type (v, G_VARIANT_TYPE_STRING)) { *type = G_FILE_ATTRIBUTE_TYPE_STRING; - g_variant_get (v, "s", &value->ptr); + g_variant_get (v, "s", &attr_value->ptr); } else if (g_variant_is_of_type (v, G_VARIANT_TYPE_BYTESTRING)) { *type = G_FILE_ATTRIBUTE_TYPE_BYTE_STRING; - g_variant_get (v, "^ay", &value->ptr); + g_variant_get (v, "^ay", &attr_value->ptr); } else if (g_variant_is_of_type (v, G_VARIANT_TYPE_STRING_ARRAY)) { *type = G_FILE_ATTRIBUTE_TYPE_STRINGV; - g_variant_get (v, "^as", &value->ptr); + g_variant_get (v, "^as", &attr_value->ptr); } else if (g_variant_is_of_type (v, G_VARIANT_TYPE_BYTE)) @@ -262,31 +262,31 @@ _g_dbus_get_file_attribute (GVariant *iter, if (g_variant_is_of_type (v, G_VARIANT_TYPE_BOOLEAN)) { *type = G_FILE_ATTRIBUTE_TYPE_BOOLEAN; - g_variant_get (v, "b", &value->boolean); + g_variant_get (v, "b", &attr_value->boolean); } else if (g_variant_is_of_type (v, G_VARIANT_TYPE_UINT32)) { *type = G_FILE_ATTRIBUTE_TYPE_UINT32; - g_variant_get (v, "u", &value->uint32); + g_variant_get (v, "u", &attr_value->uint32); } else if (g_variant_is_of_type (v, G_VARIANT_TYPE_INT32)) { *type = G_FILE_ATTRIBUTE_TYPE_INT32; - g_variant_get (v, "i", &value->ptr); + g_variant_get (v, "i", &attr_value->ptr); } else if (g_variant_is_of_type (v, G_VARIANT_TYPE_UINT64)) { *type = G_FILE_ATTRIBUTE_TYPE_UINT64; - g_variant_get (v, "t", &value->uint64); + g_variant_get (v, "t", &attr_value->uint64); } else if (g_variant_is_of_type (v, G_VARIANT_TYPE_INT64)) { *type = G_FILE_ATTRIBUTE_TYPE_INT64; - g_variant_get (v, "x", &value->ptr); + g_variant_get (v, "x", &attr_value->ptr); } else if (g_variant_is_container (v)) @@ -317,7 +317,7 @@ _g_dbus_get_file_attribute (GVariant *iter, if (obj_type != 0) g_warning ("Unsupported object type in file attribute"); } - value->ptr = obj; + attr_value->ptr = obj; } else res = FALSE; @@ -328,31 +328,31 @@ _g_dbus_get_file_attribute (GVariant *iter, } GFileInfo * -_g_dbus_get_file_info (GVariant *iter, +_g_dbus_get_file_info (GVariant *value, GError **error) { GFileInfo *info; gchar *attribute; GFileAttributeType type; GFileAttributeStatus status; - GDbusAttributeValue value; - GVariantIter i; + GDbusAttributeValue attr_value; + GVariantIter iter; GVariant *child; info = g_file_info_new (); - g_variant_iter_init (&i, iter); - while ((child = g_variant_iter_next_value (&i))) + g_variant_iter_init (&iter, value); + while ((child = g_variant_iter_next_value (&iter))) { - if (!_g_dbus_get_file_attribute (child, &attribute, &status, &type, &value)) + if (!_g_dbus_get_file_attribute (child, &attribute, &status, &type, &attr_value)) goto error; - g_file_info_set_attribute (info, attribute, type, _g_dbus_attribute_as_pointer (type, &value)); + g_file_info_set_attribute (info, attribute, type, _g_dbus_attribute_as_pointer (type, &attr_value)); if (status) g_file_info_set_attribute_status (info, attribute, status); g_free (attribute); - _g_dbus_attribute_value_destroy (type, &value); + _g_dbus_attribute_value_destroy (type, &attr_value); g_variant_unref (child); } @@ -367,18 +367,18 @@ _g_dbus_get_file_info (GVariant *iter, } GFileAttributeInfoList * -_g_dbus_get_attribute_info_list (GVariant *iter, +_g_dbus_get_attribute_info_list (GVariant *value, GError **error) { GFileAttributeInfoList *list; - GVariantIter i; + GVariantIter iter; const char *name; guint32 type, flags; list = g_file_attribute_info_list_new (); - g_variant_iter_init (&i, iter); - while (g_variant_iter_next (&i, "(&suu)", &name, &type, &flags)) + g_variant_iter_init (&iter, value); + while (g_variant_iter_next (&iter, "(&suu)", &name, &type, &flags)) g_file_attribute_info_list_add (list, name, type, flags); return list; diff --git a/common/gvfsdaemonprotocol.h b/common/gvfsdaemonprotocol.h index 96054fae..7b25f14a 100644 --- a/common/gvfsdaemonprotocol.h +++ b/common/gvfsdaemonprotocol.h @@ -85,15 +85,15 @@ GVariant * _g_dbus_append_file_attribute (const char *at GFileAttributeType type, gpointer value_p); GVariant * _g_dbus_append_file_info (GFileInfo *file_info); -gboolean _g_dbus_get_file_attribute (GVariant *iter, +gboolean _g_dbus_get_file_attribute (GVariant *value, gchar **attribute, GFileAttributeStatus *status, GFileAttributeType *type, - GDbusAttributeValue *value); -GFileInfo *_g_dbus_get_file_info (GVariant *iter, + GDbusAttributeValue *attr_value); +GFileInfo *_g_dbus_get_file_info (GVariant *value, GError **error); -GFileAttributeInfoList *_g_dbus_get_attribute_info_list (GVariant *iter, +GFileAttributeInfoList *_g_dbus_get_attribute_info_list (GVariant *value, GError **error); GVariant * _g_dbus_append_attribute_info_list (GFileAttributeInfoList *list); |