[gvfs/gdbus-core] gdbus: Reword GVariant arguments



commit e65a8a4d8d6bd70c7f631c6bcd62fbf565fcfca1
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Mon Jul 23 15:01:46 2012 +0200

    gdbus: Reword GVariant arguments
    
    and kill the iters.

 common/gmountsource.c       |    4 +-
 common/gmountsource.h       |    2 +-
 common/gmountspec.c         |   10 ++++----
 common/gmountspec.h         |    2 +-
 common/gmounttracker.c      |    8 +++---
 common/gmounttracker.h      |    2 +-
 common/gvfsdaemonprotocol.c |   48 +++++++++++++++++++++---------------------
 common/gvfsdaemonprotocol.h |    8 +++---
 8 files changed, 42 insertions(+), 42 deletions(-)
---
diff --git a/common/gmountsource.c b/common/gmountsource.c
index dac6077..312e3a3 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 a3002a0..e31b87c 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 60c93d3..b37639a 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 06d11aa..fc87d46 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 241fb22..25baad4 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 581d906..1e64123 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 7291626..2024463 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 96054fa..7b25f14 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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]