[gnome-builder/wip/project-selector: 63/67] project-selector: take child directory name into account



commit 29f2d7ce2de7749c8c40d3039e230b59585cd9ed
Author: Christian Hergert <christian hergert me>
Date:   Fri Apr 3 20:11:50 2015 -0700

    project-selector: take child directory name into account

 src/dialogs/gb-new-project-dialog.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/dialogs/gb-new-project-dialog.c b/src/dialogs/gb-new-project-dialog.c
index ade1183..1adc7b2 100644
--- a/src/dialogs/gb-new-project-dialog.c
+++ b/src/dialogs/gb-new-project-dialog.c
@@ -255,8 +255,10 @@ gb_new_project_dialog_begin_clone (GbNewProjectDialog *self)
 {
   g_autoptr(GTask) task = NULL;
   g_autoptr(GFile) location = NULL;
+  g_autoptr(GFile) child = NULL;
   CloneRequest *req;
   const gchar *uri;
+  const gchar *child_name;
 
   g_assert (GB_IS_NEW_PROJECT_DIALOG (self));
 
@@ -264,8 +266,19 @@ gb_new_project_dialog_begin_clone (GbNewProjectDialog *self)
   gtk_widget_set_sensitive (GTK_WIDGET (self->create_button), FALSE);
 
   uri = gtk_entry_get_text (self->clone_uri_entry);
+  child_name = gtk_entry_get_text (self->clone_location_entry);
   location = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (self->clone_location_button));
-  req = clone_request_new (uri, location);
+
+  if (child_name != NULL)
+    {
+      child = g_file_get_child (location, child_name);
+      req = clone_request_new (uri, child);
+    }
+  else
+    {
+      req = clone_request_new (uri, location);
+    }
+
   task = g_task_new (self, NULL, gb_new_project_dialog__clone_cb, self);
   g_task_set_task_data (task, req, clone_request_free);
   g_task_run_in_thread (task, gb_new_project_dialog__clone_worker);


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