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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-358-g65a541a)



The branch, master has been updated
       via  65a541a1f302454a8e9e7a7119a59323bb982912 (commit)
       via  721114eccc913dbbbd5e1d0700b87662aac316fc (commit)
       via  22d5b2abcd1aa5c098566ee5b292c6d7215b9b8e (commit)
       via  0deb0abc3d82a8127c9566d886858811c1dcc717 (commit)
      from  beeb987b7d7858bbc4956f8f2d9a5fd4a894a158 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gattrib/include/prototype.h   |    2 +-
 gattrib/lib/gattrib-menus.xml |   10 +++++-----
 gattrib/src/s_table.c         |    2 ++
 gattrib/src/s_toplevel.c      |   35 ++++++++++++++++++++++++++++++-----
 gattrib/src/x_gtksheet.c      |    4 ++++
 gattrib/src/x_window.c        |   19 +++++++++++++------
 6 files changed, 55 insertions(+), 17 deletions(-)


=================
 Commit Messages
=================

commit 65a541a1f302454a8e9e7a7119a59323bb982912
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 10 22:53:39 2008 +0000

    gattrib: Fix crash when removing attributes from multiple files.
    
    We were iterating over a list which could have objects removed from it.
    Since this is dangerous, iterate over a copy of the list. Since
    attributes come later in the object list than the objects they are
    attached to, iterating the list backwards means we don't
    encounter objects we've already free'd.
    
    We also need to set TOPLEVEL->page_current to the page we're working on,
    since within the loop, this variable is used to find which linked list
    to remove the objects from.

:100644 100644 e597215... d53107b... M	gattrib/include/prototype.h
:100644 100644 c79207e... 8cbeb21... M	gattrib/src/s_toplevel.c

commit 721114eccc913dbbbd5e1d0700b87662aac316fc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 10 21:49:22 2008 +0000

    gattrib: Remove non-useful "Pins" sheet
    
    The sheet is read-only, since there is no way to change pin attributes
    on the schematic. (And gattrib refuses to load symbol files).

:100644 100644 368cc92... 2012d3b... M	gattrib/src/s_table.c
:100644 100644 f0ead69... 96712d0... M	gattrib/src/x_gtksheet.c
:100644 100644 dc92b1d... 68a7223... M	gattrib/src/x_window.c

commit 22d5b2abcd1aa5c098566ee5b292c6d7215b9b8e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 10 21:42:29 2008 +0000

    gattrib: Remove non-functional "Nets" sheet

:100644 100644 275fa62... f0ead69... M	gattrib/src/x_gtksheet.c
:100644 100644 6c90e61... dc92b1d... M	gattrib/src/x_window.c

commit 0deb0abc3d82a8127c9566d886858811c1dcc717
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 10 21:21:13 2008 +0000

    gattrib: Remove menu entries for unimplemented features
    
    Popping up a dialog for unimplemented features stops the user being
    able to identify what parts of the program are supposed to work.

:100644 100644 1526cb3... d40cf8d... M	gattrib/lib/gattrib-menus.xml
:100644 100644 3734326... 6c90e61... M	gattrib/src/x_window.c

=========
 Changes
=========

commit 65a541a1f302454a8e9e7a7119a59323bb982912
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 10 22:53:39 2008 +0000

    gattrib: Fix crash when removing attributes from multiple files.
    
    We were iterating over a list which could have objects removed from it.
    Since this is dangerous, iterate over a copy of the list. Since
    attributes come later in the object list than the objects they are
    attached to, iterating the list backwards means we don't
    encounter objects we've already free'd.
    
    We also need to set TOPLEVEL->page_current to the page we're working on,
    since within the loop, this variable is used to find which linked list
    to remove the objects from.

diff --git a/gattrib/include/prototype.h b/gattrib/include/prototype.h
index e597215..d53107b 100644
--- a/gattrib/include/prototype.h
+++ b/gattrib/include/prototype.h
@@ -90,7 +90,7 @@ void s_toplevel_gtksheet_to_toplevel();
 void s_toplevel_add_new_attrib(gchar *new_attrib_name);
 void s_toplevel_delete_attrib_col();
 void s_toplevel_select_object();
-void s_toplevel_sheetdata_to_toplevel(GList *obj_list);
+void s_toplevel_sheetdata_to_toplevel(PAGE *page);
 
 STRING_LIST *s_toplevel_get_component_attribs_in_sheet(char *refdes);
 void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current, 
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index c79207e..8cbeb21 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -153,9 +153,10 @@ s_toplevel_gtksheet_to_toplevel()
         iter = g_list_next( iter ) ) {
 
     p_current = (PAGE *)iter->data;
+    pr_current->page_current = p_current;
     /* only traverse pages which are toplevel */
     if (p_current->page_control == 0) {
-      s_toplevel_sheetdata_to_toplevel (p_current->object_list);    /* adds all objects from page */
+      s_toplevel_sheetdata_to_toplevel (p_current);    /* adds all objects from page */
     }
   }
 
@@ -390,8 +391,9 @@ void s_toplevel_select_object()
  * 3.  Finally find and update pin attribs.
  *------------------------------------------------------------------*/
 void
-s_toplevel_sheetdata_to_toplevel (GList *obj_list)
+s_toplevel_sheetdata_to_toplevel (PAGE *page)
 {
+  GList *copy_list;
   GList *o_iter, *prim_iter;
   char *temp_uref;
   STRING_LIST *new_comp_attrib_pair_list;
@@ -401,9 +403,23 @@ s_toplevel_sheetdata_to_toplevel (GList *obj_list)
 #ifdef DEBUG
   printf("-----  In s_toplevel_sheetdata_to_toplevel, handling components\n");
 #endif
-  for (o_iter = obj_list; o_iter != NULL; o_iter = g_list_next (o_iter)) {
+
+  /* Work from a copy list, as objects can be deleted
+   * from the list during iteration over the list.
+   */
+  copy_list = g_list_copy (page->object_list);
+
+  /* Iterate backwards since attributes are attached after their
+   * parent objects in the list. Attributes can get deleted during
+   * the iteration.
+   */
+  for (o_iter = g_list_last (copy_list);
+       o_iter != NULL;
+       o_iter = g_list_previous (o_iter)) {
     OBJECT *o_current = o_iter->data;
 
+    printf ("Current object is %p\n", o_current);
+
     /* ------- Object is a component.  Handle component attributes. ------- */
     if (o_current->type == OBJ_COMPLEX) {    /* Note that OBJ_COMPLEX = component + attribs */
 
@@ -439,6 +455,7 @@ s_toplevel_sheetdata_to_toplevel (GList *obj_list)
 
   }
 
+  g_list_free (copy_list);
 
 #if 0
   /* -----  Next deal with all nets on the page.  ----- */
@@ -452,7 +469,13 @@ s_toplevel_sheetdata_to_toplevel (GList *obj_list)
 #ifdef DEBUG
 	printf("-----  In s_toplevel_sheetdata_to_toplevel, handling pins\n");
 #endif
-  for (o_iter = obj_list; o_iter != NULL; o_iter = g_list_next (o_iter)) {
+
+  /* Work from a copy list in case objects are
+   * deleted from the list during its iteration.
+   */
+  copy_list = g_list_copy (page->object_list);
+
+  for (o_iter = copy_list; o_iter != NULL; o_iter = g_list_next (o_iter)) {
     OBJECT *o_current = o_iter->data;
 
     /* ------- Object is a complex.  Handle pins by looking ------ */
@@ -485,7 +508,9 @@ s_toplevel_sheetdata_to_toplevel (GList *obj_list)
       g_free(temp_uref);
     }
   }
-      
+
+  g_list_free (copy_list);
+
   return;
 }
 

commit 721114eccc913dbbbd5e1d0700b87662aac316fc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 10 21:49:22 2008 +0000

    gattrib: Remove non-useful "Pins" sheet
    
    The sheet is read-only, since there is no way to change pin attributes
    on the schematic. (And gattrib refuses to load symbol files).

diff --git a/gattrib/src/s_table.c b/gattrib/src/s_table.c
index 368cc92..2012d3b 100644
--- a/gattrib/src/s_table.c
+++ b/gattrib/src/s_table.c
@@ -594,6 +594,7 @@ void s_table_gtksheet_to_all_tables() {
 		       num_rows, num_cols);
 #endif
 
+#ifdef UNIMPLEMENTED_FEATURES
   /* Finally, handle component pin sheet */
   num_rows = sheet_head->pin_count;
   num_cols = sheet_head->pin_attrib_count;
@@ -606,6 +607,7 @@ void s_table_gtksheet_to_all_tables() {
   s_table_gtksheet_to_table(local_gtk_sheet, master_row_list, 
 		       master_col_list, local_table,
 		       num_rows, num_cols);
+#endif
 
   return;
 }
diff --git a/gattrib/src/x_gtksheet.c b/gattrib/src/x_gtksheet.c
index f0ead69..96712d0 100644
--- a/gattrib/src/x_gtksheet.c
+++ b/gattrib/src/x_gtksheet.c
@@ -100,6 +100,7 @@ x_gtksheet_init()
 #endif
   
 
+#ifdef UNIMPLEMENTED_FEATURES
   /* -----  Pins  ----- */
   if ((sheet_head->pin_count > 0) && (sheet_head->pin_attrib_count >0)) {
     sheets[2] = (GtkSheet *) gtk_sheet_new(sheet_head->pin_count, sheet_head->pin_attrib_count, "Pins");
@@ -108,6 +109,7 @@ x_gtksheet_init()
     sheets[2] = (GtkSheet *) gtk_sheet_new(1, 1, "Pins");
     gtk_sheet_set_locked(GTK_SHEET(sheets[2]), TRUE);    /* disallow editing of attribs for now */
   }
+#endif
 
 
 
diff --git a/gattrib/src/x_window.c b/gattrib/src/x_window.c
index dc92b1d..68a7223 100644
--- a/gattrib/src/x_window.c
+++ b/gattrib/src/x_window.c
@@ -335,13 +335,15 @@ x_window_add_items()
   }  
 #endif
 
+#ifdef UNIMPLEMENTED_FEATURES
   if (sheet_head->pin_count > 0 ) {
     x_gtksheet_add_row_labels(GTK_SHEET(sheets[2]), 
 			      sheet_head->pin_count, sheet_head->master_pin_list_head);
     x_gtksheet_add_col_labels(GTK_SHEET(sheets[2]), 
 			      sheet_head->pin_attrib_count, sheet_head->master_pin_attrib_list_head);
   }
-  
+#endif
+
   /* ------ Comp sheet: put values in the individual cells ------- */
   num_rows = sheet_head->comp_count;
   num_cols = sheet_head->comp_attrib_count;
@@ -376,6 +378,7 @@ x_window_add_items()
   }
 #endif
 
+#ifdef UNIMPLEMENTED_FEATURES
   /* ------ Pin sheet: put pin attribs in the individual cells ------- */
   num_rows = sheet_head->pin_count;
   num_cols = sheet_head->pin_attrib_count;
@@ -390,6 +393,7 @@ x_window_add_items()
       }
     }
   }
+#endif
 
   gtk_widget_show_all( GTK_WIDGET(window) );
 }

commit 22d5b2abcd1aa5c098566ee5b292c6d7215b9b8e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 10 21:42:29 2008 +0000

    gattrib: Remove non-functional "Nets" sheet

diff --git a/gattrib/src/x_gtksheet.c b/gattrib/src/x_gtksheet.c
index 275fa62..f0ead69 100644
--- a/gattrib/src/x_gtksheet.c
+++ b/gattrib/src/x_gtksheet.c
@@ -84,6 +84,7 @@ x_gtksheet_init()
   }
   
 
+#ifdef UNIMPLEMENTED_FEATURES
   /* -----  Nets  ----- */
   if ((sheet_head->net_count > 0) && (sheet_head->net_attrib_count >0)) {
     sheets[1] = (GtkSheet *) gtk_sheet_new(sheet_head->net_count, sheet_head->net_attrib_count, "Nets");
@@ -96,6 +97,7 @@ x_gtksheet_init()
     gtk_sheet_column_button_justify(sheets[1], 0, GTK_JUSTIFY_LEFT);
     gtk_sheet_set_locked(GTK_SHEET(sheets[1]), TRUE);   /* disallow editing of attribs for now */
   }
+#endif
   
 
   /* -----  Pins  ----- */
diff --git a/gattrib/src/x_window.c b/gattrib/src/x_window.c
index 6c90e61..dc92b1d 100644
--- a/gattrib/src/x_window.c
+++ b/gattrib/src/x_window.c
@@ -322,6 +322,7 @@ x_window_add_items()
 			      sheet_head->comp_attrib_count, sheet_head->master_comp_attrib_list_head);
   }
 
+#ifdef UNIMPLEMENTED_FEATURES
   /* This is not ready.  I need to implement net attributes */
   if (sheet_head->net_count > 0 ) {
     x_gtksheet_add_row_labels(GTK_SHEET(sheets[1]), 
@@ -332,7 +333,7 @@ x_window_add_items()
     x_gtksheet_add_row_labels(GTK_SHEET(sheets[1]), 1, NULL);
     x_gtksheet_add_col_labels(GTK_SHEET(sheets[1]), 1, NULL);
   }  
-
+#endif
 
   if (sheet_head->pin_count > 0 ) {
     x_gtksheet_add_row_labels(GTK_SHEET(sheets[2]), 
@@ -357,6 +358,7 @@ x_window_add_items()
     }
   }
 
+#ifdef UNIMPLEMENTED_FEATURES
   /* ------ Net sheet: put values in the individual cells ------- */
   num_rows = sheet_head->net_count;
   num_cols = sheet_head->net_attrib_count;
@@ -372,6 +374,7 @@ x_window_add_items()
       }
     }
   }
+#endif
 
   /* ------ Pin sheet: put pin attribs in the individual cells ------- */
   num_rows = sheet_head->pin_count;

commit 0deb0abc3d82a8127c9566d886858811c1dcc717
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Dec 10 21:21:13 2008 +0000

    gattrib: Remove menu entries for unimplemented features
    
    Popping up a dialog for unimplemented features stops the user being
    able to identify what parts of the program are supposed to work.

diff --git a/gattrib/lib/gattrib-menus.xml b/gattrib/lib/gattrib-menus.xml
index 1526cb3..d40cf8d 100644
--- a/gattrib/lib/gattrib-menus.xml
+++ b/gattrib/lib/gattrib-menus.xml
@@ -5,17 +5,17 @@
       <menuitem action="file-save" />
       <menuitem action="file-export-csv" />
       <separator/>
-      <menuitem action="file-print" />
-      <separator/>
+      <!-- < menuitem action="file-print" / > -->
+      <!-- < separator / > -->
       <menuitem action="file-quit" />
     </menu>
 
     <menu action="edit">
       <menuitem action="edit-add-attrib" />
       <menuitem action="edit-delete-attrib" />
-      <menuitem action="edit-find-attrib" />
-      <menuitem action="edit-search-replace-attrib-value" />
-      <menuitem action="edit-search-for-refdes" />
+      <!-- < menuitem action="edit-find-attrib" / > -->
+      <!-- < menuitem action="edit-search-replace-attrib-value" / > -->
+      <!-- < menuitem action="edit-search-for-refdes" / > -->
     </menu>
 
     <menu action="visibility">
diff --git a/gattrib/src/x_window.c b/gattrib/src/x_window.c
index 3734326..6c90e61 100644
--- a/gattrib/src/x_window.c
+++ b/gattrib/src/x_window.c
@@ -195,16 +195,16 @@ static const GtkActionEntry actions[] = {
   { "file-open", GTK_STOCK_OPEN, "Open", "<Control>O", "", menu_file_open},
   { "file-save", GTK_STOCK_SAVE, "Save", "<Control>S", "", menu_file_save},
   { "file-export-csv", NULL, "Export CSV", "", "", menu_file_export_csv},
-  { "file-print", GTK_STOCK_PRINT, "Print", "<Control>P", "", x_dialog_unimplemented_feature},
+  /* { "file-print", GTK_STOCK_PRINT, "Print", "<Control>P", "", x_dialog_unimplemented_feature}, */
   { "file-quit", GTK_STOCK_QUIT, "Quit", "<Control>Q", "", G_CALLBACK(gattrib_really_quit)},
 
   /* Edit menu */
   { "edit", NULL, "_Edit"},
   { "edit-add-attrib", NULL, "Add new attrib column", "", "", menu_edit_newattrib},
   { "edit-delete-attrib", NULL, "Delete attrib column", "", "", menu_edit_delattrib},
-  { "edit-find-attrib", GTK_STOCK_FIND, "Find attrib value", "<Control>F", "", x_dialog_unimplemented_feature},
-  { "edit-search-replace-attrib-value", NULL, "Search and replace attrib value", "", "", x_dialog_unimplemented_feature},
-  { "edit-search-for-refdes", NULL, "Search for refdes", "", "", x_dialog_unimplemented_feature},
+  /* { "edit-find-attrib", GTK_STOCK_FIND, "Find attrib value", "<Control>F", "", x_dialog_unimplemented_feature}, */
+  /* { "edit-search-replace-attrib-value", NULL, "Search and replace attrib value", "", "", x_dialog_unimplemented_feature}, */
+  /* { "edit-search-for-refdes", NULL, "Search for refdes", "", "", x_dialog_unimplemented_feature}, */
 
   /* Visibility menu */
   { "visibility", NULL, "_Visibility"},




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs