[libdazzle] menus: fix item remove from menu button sections
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] menus: fix item remove from menu button sections
- Date: Fri, 1 Sep 2017 21:17:49 +0000 (UTC)
commit 581f886034241ff61437301527cbaf85a81058c2
Author: Christian Hergert <chergert redhat com>
Date: Fri Sep 1 14:17:00 2017 -0700
menus: fix item remove from menu button sections
src/menus/dzl-menu-button-section.c | 5 +++--
src/menus/dzl-menu-button.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/menus/dzl-menu-button-section.c b/src/menus/dzl-menu-button-section.c
index a46a2e6..e72deca 100644
--- a/src/menus/dzl-menu-button-section.c
+++ b/src/menus/dzl-menu-button-section.c
@@ -106,11 +106,12 @@ dzl_menu_button_section_items_changed (DzlMenuButtonSection *self,
for (guint i = 0; i < removed; i++)
{
- GtkWidget *child = dzl_box_get_nth_child (self->items_box, i);
+ GtkWidget *child = dzl_box_get_nth_child (self->items_box, position);
+
gtk_widget_destroy (child);
}
- for (guint i = position; i < position + added; i++)
+ for (guint i = position; i < (position + added); i++)
{
DzlMenuButtonItem *item;
g_autoptr(GVariant) target = NULL;
diff --git a/src/menus/dzl-menu-button.c b/src/menus/dzl-menu-button.c
index 1d7bd81..f1c2ac3 100644
--- a/src/menus/dzl-menu-button.c
+++ b/src/menus/dzl-menu-button.c
@@ -128,7 +128,7 @@ dzl_menu_button_items_changed (DzlMenuButton *self,
gtk_widget_destroy (child);
}
- for (guint i = position; i < position + added; i++)
+ for (guint i = position; i < (position + added); i++)
{
g_autofree gchar *label = NULL;
g_autoptr(GMenuModel) linked_model = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]