[gnome-builder] layout: handle removal of stacks with views
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] layout: handle removal of stacks with views
- Date: Wed, 19 Jul 2017 11:02:39 +0000 (UTC)
commit e51b903690c829541441a4bbae88ed032922a8e6
Author: Christian Hergert <chergert redhat com>
Date: Thu Jun 29 23:18:15 2017 -0700
layout: handle removal of stacks with views
These should always have a size of 0 due to the current design, but we
should also ensure the item is removed from the array.
libide/layout/ide-layout-grid.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libide/layout/ide-layout-grid.c b/libide/layout/ide-layout-grid.c
index a5f2e27..89a4626 100644
--- a/libide/layout/ide-layout-grid.c
+++ b/libide/layout/ide-layout-grid.c
@@ -875,10 +875,25 @@ void
_ide_layout_grid_stack_removed (IdeLayoutGrid *self,
IdeLayoutStack *stack)
{
+ IdeLayoutGridPrivate *priv = ide_layout_grid_get_instance_private (self);
+ guint position = 0;
+
g_return_if_fail (IDE_IS_LAYOUT_GRID (self));
g_return_if_fail (IDE_IS_LAYOUT_STACK (stack));
g_signal_handlers_disconnect_by_func (stack,
G_CALLBACK (ide_layout_grid_stack_items_changed),
self);
+
+ for (guint i = 0; i < priv->stack_info->len; i++)
+ {
+ const StackInfo info = g_array_index (priv->stack_info, StackInfo, i);
+
+ if (info.stack == stack)
+ {
+ g_array_remove_index (priv->stack_info, i);
+ g_list_model_items_changed (G_LIST_MODEL (self), position, info.len, 0);
+ break;
+ }
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]