[Glade-devel] Glade3 patch for project load bug fix.



Hi

Here's a small patch which fixes a bug when loading a project on startup.
Although project->changed = FALSE, initially, it gets changed to TRUE, I think
somewhere in glade_widget_set_name() or someplace (can't remember). Anyways,
This sets it back to FALSE at the end of glade_project_open ().

And a small cleanup of code in glade-gtk.c. Unwanted "if...else" else clause.

Review
Archit Baweja

===File ~/Projects/gnome2/patches/glade3-code-cleanup-and-project-changed-fix.patch===
? 0
? autom4te-2.53.cache
? glade-3.desktop
? stamp-h1
? src/boo.glade3
? src/do.glade3
? src/dont.glade3
? src/foo.glade3
? src/foobar.glade3
? src/glade-3
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/glade3/ChangeLog,v
retrieving revision 1.180
diff -u -r1.180 ChangeLog
--- ChangeLog   6 Aug 2003 09:41:46 -0000       1.180
+++ ChangeLog   7 Aug 2003 21:40:30 -0000
@@ -1,3 +1,10 @@
+2003-08-08  Archit Baweja  <bighead users sourceforge net>
+
+       * src/glade-project.c (glade_project_open): set project->changed=FALSE.
+
+       * src/glade-widget.c (glade_widget_new_child_from_node): minor code
+       cleanup.
+
 2003-08-05  Archit Baweja  <bighead users sourceforge net>
 
        * src/glade-property.c (glade_property_set): when using custom 
Index: src/glade-project.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-project.c,v
retrieving revision 1.37
diff -u -r1.37 glade-project.c
--- src/glade-project.c 5 Aug 2003 18:39:04 -0000       1.37
+++ src/glade-project.c 7 Aug 2003 21:40:40 -0000
@@ -554,6 +554,7 @@
                project->path = g_strdup_printf ("%s", path);
                g_free (project->name);
                project->name = g_path_get_basename (project->path);
+               project->changed = FALSE;
        }
 
        return project;
Index: src/glade-widget.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-widget.c,v
retrieving revision 1.64
diff -u -r1.64 glade-widget.c
--- src/glade-widget.c  6 Aug 2003 09:41:47 -0000       1.64
+++ src/glade-widget.c  7 Aug 2003 21:40:48 -0000
@@ -1419,20 +1419,24 @@
                child_widget = glade_placeholder_new (parent);
                gtk_container_add (GTK_CONTAINER (parent->widget), child_widget);
                return TRUE;
-       } else {
-               /* Get and create the widget */
-               child_node = glade_xml_search_child_required (node, GLADE_XML_TAG_WIDGET);
-               if (!child_node)
-                       return FALSE;
+       }
 
-               child = glade_widget_new_from_node_real (child_node, project, parent);
-               if (!child)
-                       /* not enough memory... and now, how can I signal it and not make the caller believe 
that
-                        * it was a parsing problem? */
-                       return FALSE;
+       /* No placeholder, so definitely a widget. */
+       /* Get and create the widget */
+       child_node = glade_xml_search_child_required (node, GLADE_XML_TAG_WIDGET);
+       if (!child_node)
+               return FALSE;
 
-               child_widget = child->widget;
-       }
+       child = glade_widget_new_from_node_real (child_node, project, parent);
+       if (!child)
+               /*
+                * not enough memory... and now, how can I signal it
+                * and not make the caller believe that it was a parsing
+                * problem?
+                */
+               return FALSE;
+
+       child_widget = child->widget;
 
        gtk_container_add (GTK_CONTAINER (parent->widget), child_widget);
 
============================================================




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