[gnome-builder] build-manager: Add a setter for can-build
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] build-manager: Add a setter for can-build
- Date: Tue, 18 Apr 2017 21:54:32 +0000 (UTC)
commit 228bbe8be6e4d1df7447658eed4bd1092f27fcaf
Author: Matthew Leeds <mleeds redhat com>
Date: Mon Apr 17 22:08:01 2017 -0500
build-manager: Add a setter for can-build
Since update_action_enabled() needs to be called whenever can-build
changes, it makes sense to use a setter function.
https://bugzilla.gnome.org/show_bug.cgi?id=781428
libide/buildsystem/ide-build-manager.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/libide/buildsystem/ide-build-manager.c b/libide/buildsystem/ide-build-manager.c
index 742afa8..d15c7d7 100644
--- a/libide/buildsystem/ide-build-manager.c
+++ b/libide/buildsystem/ide-build-manager.c
@@ -52,6 +52,7 @@ struct _IdeBuildManager
static void initable_iface_init (GInitableIface *);
static void action_group_iface_init (GActionGroupInterface *);
+static void ide_build_manager_set_can_build (IdeBuildManager *self, gboolean can_build);
G_DEFINE_TYPE_EXTENDED (IdeBuildManager, ide_build_manager, IDE_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)
@@ -301,9 +302,8 @@ ide_build_manager_ensure_runtime_cb (GObject *object,
IDE_GOTO (failure);
}
- self->can_build = TRUE;
+ ide_build_manager_set_can_build (self, TRUE);
- g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CAN_BUILD]);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_PIPELINE]);
IDE_EXIT;
@@ -370,7 +370,7 @@ ide_build_manager_invalidate_pipeline (IdeBuildManager *self)
* We will delay the initialization until after the we have ensured the
* runtime is available (possibly installing it).
*/
- self->can_build = FALSE;
+ ide_build_manager_set_can_build (self, FALSE);
self->pipeline = g_object_new (IDE_TYPE_BUILD_PIPELINE,
"context", context,
"configuration", config,
@@ -395,7 +395,6 @@ ide_build_manager_invalidate_pipeline (IdeBuildManager *self)
ide_build_manager_ensure_runtime_cb,
g_steal_pointer (&task));
- g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CAN_BUILD]);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_HAS_DIAGNOSTICS]);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_LAST_BUILD_TIME]);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_MESSAGE]);
@@ -1417,3 +1416,14 @@ ide_build_manager_get_can_build (IdeBuildManager *self)
return self->can_build;
}
+
+static void
+ide_build_manager_set_can_build (IdeBuildManager *self,
+ gboolean can_build)
+{
+ g_return_if_fail (IDE_IS_BUILD_MANAGER (self));
+
+ self->can_build = !!can_build;
+ g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CAN_BUILD]);
+ ide_build_manager_update_action_enabled (self);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]