[glade3] 2010-03-24 Tristan Van Berkom <tvb gnome org>



commit d491e8ddc4e9afcf5e1fa7711d40bf8b1df06afa
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed Mar 24 14:33:55 2010 -0400

    2010-03-24  Tristan Van Berkom <tvb gnome org>
    
    	* gladeui/glade-signal.[ch]: Broke api of glade_signal_write(), this api should never
    	  be called outside of the Glade core so its a soft api break.
    
    	* gladeui/glade-widget.c: Call glade_signal_write() with the current project format, fixes bug 600031.

 ChangeLog              |    7 +++++++
 gladeui/glade-signal.c |   12 ++++++++----
 gladeui/glade-signal.h |    7 ++++---
 gladeui/glade-widget.c |    8 ++++++--
 4 files changed, 25 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 45c72b6..de50100 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-24  Tristan Van Berkom <tvb gnome org>
+
+	* gladeui/glade-signal.[ch]: Broke api of glade_signal_write(), this api should never
+	  be called outside of the Glade core so its a soft api break.
+
+	* gladeui/glade-widget.c: Call glade_signal_write() with the current project format, fixes bug 600031.
+
 2010-03-20  Javier Jardón <jjardon gnome org>
 
 	* gladeui/glade-builtins.c: Use g_timeout_add_seconds() instead of g_timeout_add()
diff --git a/gladeui/glade-signal.c b/gladeui/glade-signal.c
index d5d4985..fa46689 100644
--- a/gladeui/glade-signal.c
+++ b/gladeui/glade-signal.c
@@ -120,15 +120,17 @@ glade_signal_clone (const GladeSignal *signal)
 /**
  * glade_signal_write:
  * @signal: The #GladeSignal
+ * @fmt: The #GladeProjectFormat to write the signal for
  * @context: A #GladeXmlContext
  * @node: A #GladeXmlNode
  *
  * Writes @signal to @node
  */
 void
-glade_signal_write (GladeSignal     *signal,
-		    GladeXmlContext *context,
-		    GladeXmlNode    *node)
+glade_signal_write (GladeSignal       *signal,
+		    GladeProjectFormat fmt,
+		    GladeXmlContext   *context,
+		    GladeXmlNode      *node)
 {
 	GladeXmlNode *signal_node;
 	gchar        *name;
@@ -138,7 +140,9 @@ glade_signal_write (GladeSignal     *signal,
 	 */
 
 	name = g_strdup (signal->name);
-	glade_util_replace (name, '-', '_');
+
+	if (fmt == GLADE_PROJECT_FORMAT_LIBGLADE)
+		glade_util_replace (name, '-', '_');
 
 	/* Now dump the node values... */
 	signal_node = glade_xml_node_new (context, GLADE_XML_TAG_SIGNAL);
diff --git a/gladeui/glade-signal.h b/gladeui/glade-signal.h
index 1bb8871..4b15c5b 100644
--- a/gladeui/glade-signal.h
+++ b/gladeui/glade-signal.h
@@ -31,9 +31,10 @@ void         glade_signal_free  (GladeSignal *signal);
 gboolean     glade_signal_equal (GladeSignal *sig1, GladeSignal *sig2);
 
 GladeSignal *glade_signal_read  (GladeXmlNode *node);
-void         glade_signal_write (GladeSignal     *signal,
-				 GladeXmlContext *context,
-				 GladeXmlNode    *node);
+void         glade_signal_write (GladeSignal        *signal,
+				 GladeProjectFormat  fmt,
+				 GladeXmlContext    *context,
+				 GladeXmlNode       *node);
 
 G_END_DECLS
 
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index d3af5d4..dd52762 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -3838,8 +3838,9 @@ glade_widget_write_placeholder (GladeWidget     *parent,
 }
 
 typedef struct {
-	GladeXmlContext *context;
-	GladeXmlNode    *node;
+	GladeXmlContext    *context;
+	GladeXmlNode       *node;
+	GladeProjectFormat  fmt;
 } WriteSignalsInfo;
 
 static void
@@ -3857,6 +3858,7 @@ glade_widget_adaptor_write_signals (gpointer key,
 	{
 		GladeSignal *signal = g_ptr_array_index (signals, i);
 		glade_signal_write (signal,
+				    info->fmt,
 				    info->context,
 				    info->node);
 	}
@@ -3871,6 +3873,8 @@ glade_widget_write_signals (GladeWidget     *widget,
 
 	info.context = context;
 	info.node = node;
+	info.fmt = glade_project_get_format (widget->project);
+
 	g_hash_table_foreach (widget->signals,
 			      glade_widget_adaptor_write_signals,
 			      &info);



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