[glade] GladeWidget: Use glade_widget_has_name()
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] GladeWidget: Use glade_widget_has_name()
- Date: Thu, 28 Jan 2016 11:50:03 +0000 (UTC)
commit 07d0bf3b42ce0bb621c53d3b50778b7eb6c2f369
Author: Tristan Van Berkom <tristan upstairslabs com>
Date: Thu Jan 28 12:38:44 2016 +0100
GladeWidget: Use glade_widget_has_name()
In some places, instead of strncmp() directly
gladeui/glade-widget.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 1388f4c..80bc95a 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -4342,7 +4342,7 @@ glade_widget_write (GladeWidget *widget,
/* Conditionally omit the ID in the output if the name is 'unset'
*/
- if (strncmp (widget->priv->name, GLADE_UNNAMED_PREFIX, strlen (GLADE_UNNAMED_PREFIX)) != 0)
+ if (glade_widget_has_name (widget))
glade_xml_node_set_property_string (widget_node,
GLADE_XML_TAG_ID, widget->priv->name);
}
@@ -5055,8 +5055,7 @@ void
glade_widget_ensure_name (GladeWidget *widget,
GladeProject *project)
{
- if (!widget->priv->name ||
- strncmp (widget->priv->name, GLADE_UNNAMED_PREFIX, strlen (GLADE_UNNAMED_PREFIX)) == 0)
+ if (!glade_widget_has_name (widget))
{
gchar *new_name = glade_project_new_widget_name (project, NULL,
glade_widget_adaptor_get_generic_name
(widget->priv->adaptor));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]