[glade3] * gladeui/glade-project.c: Check project naming policy at add_object() time (bug 580745).



commit 0f372f4c1bad8701825937d95336262a115951fa
Author: Tristan Van Berkom <vantr TheBully local>
Date:   Wed Apr 29 11:25:59 2009 -0400

    	* gladeui/glade-project.c: Check project naming policy at add_object() time (bug 580745).
---
 ChangeLog               |    4 ++++
 gladeui/glade-project.c |    5 ++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3e68247..f5805bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-04-29  Tristan Van Berkom <tvb gnome org>
+
+	* gladeui/glade-project.c: Check project naming policy at add_object() time (bug 580745).
+
 2009-04-24  Juan Pablo Ugarte <juanpablougarte gmail com>
 
 	* plugins/gtk+/glade-gtk.c:
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index 1d8e73e..86c3f34 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -2139,6 +2139,9 @@ name_context_by_widget (GladeProject *project,
 	TopLevelInfo  *tinfo;
 	GladeWidget   *iter;
 	GList         *list;
+	
+	if (project->priv->naming_policy == GLADE_POLICY_PROJECT_WIDE)
+		return project->priv->toplevel_names;
 
 	iter = gwidget;
 	while (iter->parent) iter = iter->parent;
@@ -2292,7 +2295,7 @@ glade_project_available_widget_name (GladeProject *project,
 	context = name_context_by_widget (project, widget);
 	g_assert (context);
 
-	if (!widget->parent)
+	if (project->priv->naming_policy == GLADE_POLICY_PROJECT_WIDE || !widget->parent)
 		return (!glade_name_context_has_name (context, name) &&
 			!glade_name_context_has_name (project->priv->toplevel_names, name));
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]