[gnome-builder] vcs: require IdeObject base class
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] vcs: require IdeObject base class
- Date: Wed, 10 Apr 2019 07:36:31 +0000 (UTC)
commit cae52928cda794f1ff8d2c51554ee4a59a79bfd8
Author: Christian Hergert <chergert redhat com>
Date: Wed Apr 10 00:21:13 2019 -0700
vcs: require IdeObject base class
These will increasingly need access to the object-tree, so change their
base class to require it going forward.
src/libide/vcs/ide-vcs-cloner.c | 2 +-
src/libide/vcs/ide-vcs-cloner.h | 2 +-
src/libide/vcs/ide-vcs-config.c | 2 +-
src/libide/vcs/ide-vcs-config.h | 2 +-
src/libide/vcs/ide-vcs-initializer.c | 2 +-
src/libide/vcs/ide-vcs-initializer.h | 2 +-
src/plugins/create-project/gbp-create-project-surface.c | 12 +++++++++++-
7 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/src/libide/vcs/ide-vcs-cloner.c b/src/libide/vcs/ide-vcs-cloner.c
index cdd16519e..88d20cc2f 100644
--- a/src/libide/vcs/ide-vcs-cloner.c
+++ b/src/libide/vcs/ide-vcs-cloner.c
@@ -26,7 +26,7 @@
#include "ide-vcs-cloner.h"
-G_DEFINE_INTERFACE (IdeVcsCloner, ide_vcs_cloner, G_TYPE_OBJECT)
+G_DEFINE_INTERFACE (IdeVcsCloner, ide_vcs_cloner, IDE_TYPE_OBJECT)
static void
ide_vcs_cloner_default_init (IdeVcsClonerInterface *iface)
diff --git a/src/libide/vcs/ide-vcs-cloner.h b/src/libide/vcs/ide-vcs-cloner.h
index 3a9dc5499..c8d1765d0 100644
--- a/src/libide/vcs/ide-vcs-cloner.h
+++ b/src/libide/vcs/ide-vcs-cloner.h
@@ -27,7 +27,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_VCS_CLONER (ide_vcs_cloner_get_type())
IDE_AVAILABLE_IN_3_32
-G_DECLARE_INTERFACE (IdeVcsCloner, ide_vcs_cloner, IDE, VCS_CLONER, GObject)
+G_DECLARE_INTERFACE (IdeVcsCloner, ide_vcs_cloner, IDE, VCS_CLONER, IdeObject)
struct _IdeVcsClonerInterface
{
diff --git a/src/libide/vcs/ide-vcs-config.c b/src/libide/vcs/ide-vcs-config.c
index 8b6c4780a..e0ddf81f4 100644
--- a/src/libide/vcs/ide-vcs-config.c
+++ b/src/libide/vcs/ide-vcs-config.c
@@ -25,7 +25,7 @@
#include "ide-vcs-config.h"
#include "ide-vcs-enums.h"
-G_DEFINE_INTERFACE (IdeVcsConfig, ide_vcs_config, G_TYPE_OBJECT)
+G_DEFINE_INTERFACE (IdeVcsConfig, ide_vcs_config, IDE_TYPE_OBJECT)
static void
ide_vcs_config_default_init (IdeVcsConfigInterface *iface)
diff --git a/src/libide/vcs/ide-vcs-config.h b/src/libide/vcs/ide-vcs-config.h
index 457639791..a8c488275 100644
--- a/src/libide/vcs/ide-vcs-config.h
+++ b/src/libide/vcs/ide-vcs-config.h
@@ -31,7 +31,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_VCS_CONFIG (ide_vcs_config_get_type())
IDE_AVAILABLE_IN_3_32
-G_DECLARE_INTERFACE (IdeVcsConfig, ide_vcs_config, IDE, VCS_CONFIG, GObject)
+G_DECLARE_INTERFACE (IdeVcsConfig, ide_vcs_config, IDE, VCS_CONFIG, IdeObject)
typedef enum
{
diff --git a/src/libide/vcs/ide-vcs-initializer.c b/src/libide/vcs/ide-vcs-initializer.c
index 9742b845f..9eb3f1f67 100644
--- a/src/libide/vcs/ide-vcs-initializer.c
+++ b/src/libide/vcs/ide-vcs-initializer.c
@@ -24,7 +24,7 @@
#include "ide-vcs-initializer.h"
-G_DEFINE_INTERFACE (IdeVcsInitializer, ide_vcs_initializer, G_TYPE_OBJECT)
+G_DEFINE_INTERFACE (IdeVcsInitializer, ide_vcs_initializer, IDE_TYPE_OBJECT)
static void
ide_vcs_initializer_default_init (IdeVcsInitializerInterface *iface)
diff --git a/src/libide/vcs/ide-vcs-initializer.h b/src/libide/vcs/ide-vcs-initializer.h
index d5fb26810..dfd6baeb7 100644
--- a/src/libide/vcs/ide-vcs-initializer.h
+++ b/src/libide/vcs/ide-vcs-initializer.h
@@ -31,7 +31,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_VCS_INITIALIZER (ide_vcs_initializer_get_type ())
IDE_AVAILABLE_IN_3_32
-G_DECLARE_INTERFACE (IdeVcsInitializer, ide_vcs_initializer, IDE, VCS_INITIALIZER, GObject)
+G_DECLARE_INTERFACE (IdeVcsInitializer, ide_vcs_initializer, IDE, VCS_INITIALIZER, IdeObject)
struct _IdeVcsInitializerInterface
{
diff --git a/src/plugins/create-project/gbp-create-project-surface.c
b/src/plugins/create-project/gbp-create-project-surface.c
index 99f02cc98..8bce5b013 100644
--- a/src/plugins/create-project/gbp-create-project-surface.c
+++ b/src/plugins/create-project/gbp-create-project-surface.c
@@ -636,7 +636,7 @@ init_vcs_cb (GObject *object,
if (!ide_vcs_initializer_initialize_finish (vcs, result, &error))
{
ide_task_return_error (task, g_steal_pointer (&error));
- return;
+ goto cleanup;
}
self = ide_task_get_source_object (task);
@@ -652,6 +652,9 @@ init_vcs_cb (GObject *object,
ide_greeter_workspace_open_project (IDE_GREETER_WORKSPACE (workspace), project_info);
ide_task_return_boolean (task, TRUE);
+
+cleanup:
+ ide_object_destroy (IDE_OBJECT (vcs));
}
static void
@@ -666,6 +669,7 @@ extract_cb (GObject *object,
GbpCreateProjectSurface *self;
PeasPluginInfo *plugin_info;
PeasEngine *engine;
+ IdeContext *context;
GFile *project_file;
/* To keep the UI simple, we only support git from
@@ -713,8 +717,10 @@ extract_cb (GObject *object,
if (plugin_info == NULL)
IDE_GOTO (failure);
+ context = ide_widget_get_context (GTK_WIDGET (self));
vcs = (IdeVcsInitializer *)peas_engine_create_extension (engine, plugin_info,
IDE_TYPE_VCS_INITIALIZER,
+ "parent", context,
NULL);
if (vcs == NULL)
IDE_GOTO (failure);
@@ -834,8 +840,12 @@ gbp_create_project_surface_create_async (GbpCreateProjectSurface *self,
if (plugin_info != NULL)
{
+ IdeContext *context;
+
+ context = ide_widget_get_context (GTK_WIDGET (self));
vcs_conf = (IdeVcsConfig *)peas_engine_create_extension (engine, plugin_info,
IDE_TYPE_VCS_CONFIG,
+ "parent", context,
NULL);
if (vcs_conf != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]