[gnome-builder] vcs: use GVariant for clone options



commit 88969a51150f0d6b3d07f14d57cd21842146dd55
Author: Christian Hergert <chergert redhat com>
Date:   Wed Apr 10 00:21:59 2019 -0700

    vcs: use GVariant for clone options

 src/libide/greeter/ide-clone-surface.c | 8 +++-----
 src/libide/vcs/ide-vcs-cloner.c        | 6 ++++--
 src/libide/vcs/ide-vcs-cloner.h        | 4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/libide/greeter/ide-clone-surface.c b/src/libide/greeter/ide-clone-surface.c
index 9e7bccaa8..6e378bc99 100644
--- a/src/libide/greeter/ide-clone-surface.c
+++ b/src/libide/greeter/ide-clone-surface.c
@@ -550,10 +550,10 @@ ide_clone_surface_clone (IdeCloneSurface *self)
   path = g_file_peek_path (self->destination);
 
   if (!ide_str_empty0 (author) && !g_str_equal (g_get_real_name (), author))
-    g_variant_dict_insert (&dict, "author-name", "s", author);
+    g_variant_dict_insert (&dict, "user.name", "s", author);
 
   if (!ide_str_empty0 (email))
-    g_variant_dict_insert (&dict, "author-email", "s", email);
+    g_variant_dict_insert (&dict, "user.email", "s", email);
 
   g_debug ("Cloning repository using addin: %s", module_name);
 
@@ -573,7 +573,7 @@ ide_clone_surface_clone (IdeCloneSurface *self)
   ide_vcs_cloner_clone_async (addin,
                               uri,
                               path,
-                              &dict,
+                              g_variant_dict_end (&dict),
                               notif,
                               cancellable,
                               ide_clone_surface_clone_cb,
@@ -589,6 +589,4 @@ ide_clone_surface_clone (IdeCloneSurface *self)
 
   g_object_bind_property (notif, "progress", self->uri_entry, "progress-fraction", G_BINDING_SYNC_CREATE);
   g_object_bind_property (notif, "body", self->status_message, "label", G_BINDING_SYNC_CREATE);
-
-  g_variant_dict_clear (&dict);
 }
diff --git a/src/libide/vcs/ide-vcs-cloner.c b/src/libide/vcs/ide-vcs-cloner.c
index 88d20cc2f..cf6d76c84 100644
--- a/src/libide/vcs/ide-vcs-cloner.c
+++ b/src/libide/vcs/ide-vcs-cloner.c
@@ -67,7 +67,7 @@ ide_vcs_cloner_validate_uri (IdeVcsCloner  *self,
  * @self: an #IdeVcsCloner
  * @uri: a string containing the URI
  * @destination: a string containing the destination path
- * @options: a #GVariantDict containing any user supplied options
+ * @options: a #GVariant containing any user supplied options
  * @cancellable: (nullable): a #GCancellable
  * @progress: (nullable): a location for an #IdeNotification, or %NULL
  * @callback: a #GAsyncReadyCallback to execute upon completion
@@ -79,7 +79,7 @@ void
 ide_vcs_cloner_clone_async (IdeVcsCloner         *self,
                             const gchar          *uri,
                             const gchar          *destination,
-                            GVariantDict         *options,
+                            GVariant             *options,
                             IdeNotification      *progress,
                             GCancellable         *cancellable,
                             GAsyncReadyCallback   callback,
@@ -88,6 +88,8 @@ ide_vcs_cloner_clone_async (IdeVcsCloner         *self,
   g_return_if_fail (IDE_IS_VCS_CLONER (self));
   g_return_if_fail (uri != NULL);
   g_return_if_fail (destination != NULL);
+  g_return_if_fail (options != NULL);
+  g_return_if_fail (g_variant_is_of_type (options, G_VARIANT_TYPE_VARDICT));
   g_return_if_fail (!progress || IDE_IS_NOTIFICATION (progress));
   g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
 
diff --git a/src/libide/vcs/ide-vcs-cloner.h b/src/libide/vcs/ide-vcs-cloner.h
index c8d1765d0..adf1d35f2 100644
--- a/src/libide/vcs/ide-vcs-cloner.h
+++ b/src/libide/vcs/ide-vcs-cloner.h
@@ -40,7 +40,7 @@ struct _IdeVcsClonerInterface
   void      (*clone_async)  (IdeVcsCloner         *self,
                              const gchar          *uri,
                              const gchar          *destination,
-                             GVariantDict         *options,
+                             GVariant             *options,
                              IdeNotification      *progress,
                              GCancellable         *cancellable,
                              GAsyncReadyCallback   callback,
@@ -56,7 +56,7 @@ IDE_AVAILABLE_IN_3_32
 void      ide_vcs_cloner_clone_async  (IdeVcsCloner         *self,
                                        const gchar          *uri,
                                        const gchar          *destination,
-                                       GVariantDict         *options,
+                                       GVariant             *options,
                                        IdeNotification      *progress,
                                        GCancellable         *cancellable,
                                        GAsyncReadyCallback   callback,


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