[gtk/wip/baedert/for-master] stack: Only compare page names if the new page has one
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master] stack: Only compare page names if the new page has one
- Date: Sat, 1 Aug 2020 13:35:21 +0000 (UTC)
commit 2f65459fcc6f415af5472ceb67486212b8121b57
Author: Timm Bäder <mail baedert org>
Date: Sat Aug 1 15:26:53 2020 +0200
stack: Only compare page names if the new page has one
gtk/gtkstack.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 51a39bfd1f..364def9be5 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -1348,14 +1348,17 @@ gtk_stack_add_page (GtkStack *stack,
g_return_if_fail (child_info->widget != NULL);
- for (l = priv->children; l != NULL; l = l->next)
+ if (child_info->name)
{
- GtkStackPage *info = l->data;
- if (info->name &&
- g_strcmp0 (info->name, child_info->name) == 0)
+ for (l = priv->children; l != NULL; l = l->next)
{
- g_warning ("While adding page: duplicate child name in GtkStack: %s", child_info->name);
- break;
+ GtkStackPage *info = l->data;
+ if (info->name &&
+ g_strcmp0 (info->name, child_info->name) == 0)
+ {
+ g_warning ("While adding page: duplicate child name in GtkStack: %s", child_info->name);
+ break;
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]