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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-161-g0726171)



The branch, master has been updated
       via  0726171f20b716c9de69d0ae843b338d78ac22ad (commit)
       via  3f6f9afbb9eb6770520f785e094169d9f2b164dc (commit)
       via  e350d47b39bd358f55949e787511eab54b0048be (commit)
      from  b4ed5e92d203c7449b7d33e924a41b093e1de930 (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
=========

 libgeda/src/s_page.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)


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

commit 0726171f20b716c9de69d0ae843b338d78ac22ad
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Sep 7 23:37:45 2008 +0100

    Add comment in s_page_delete() regarding toplevel->page_current
    
    The page being deleted still has to be made current because of
    assumptions made in s_delete_object()

:100644 100644 61d8a7e... f151b51... M	libgeda/src/s_page.c

commit 3f6f9afbb9eb6770520f785e094169d9f2b164dc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Sep 7 23:37:45 2008 +0100

    Re-add wanted portions of #95923f7de815ec58819eaf94ab9332d51a28fbb9
    
    Simplify prototype of s_tile_remove_object().
    
    Don't pass TOPLEVEL and PAGE arguments which aren't needed.

:100644 100644 582a242... 14c037f... M	libgeda/include/prototype.h
:100644 100644 856d758... 8ce1fd5... M	libgeda/src/s_basic.c
:100644 100644 8ecd86a... 61d8a7e... M	libgeda/src/s_page.c
:100644 100644 af8670e... c6e350d... M	libgeda/src/s_tile.c

commit e350d47b39bd358f55949e787511eab54b0048be
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Sep 7 23:37:45 2008 +0100

    Revert commit #95923f7de815ec58819eaf94ab9332d51a28fbb9
    
    This commit, "Simplify prototype of s_tile_remove_object()."
    removed code to make a page being deleted the current page.
    
    This change introduced a crash when closing gschem with multiple
    pages open. We shouldn't really need a page to be current to delete
    it's objects, but this is an underlying bug which should be fixed
    before this part of the patch is re-applied.

:100644 100644 14c037f... 582a242... M	libgeda/include/prototype.h
:100644 100644 8ce1fd5... 856d758... M	libgeda/src/s_basic.c
:100644 100644 df5e487... 8ecd86a... M	libgeda/src/s_page.c
:100644 100644 c6e350d... af8670e... M	libgeda/src/s_tile.c

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

commit 0726171f20b716c9de69d0ae843b338d78ac22ad
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Sep 7 23:37:45 2008 +0100

    Add comment in s_page_delete() regarding toplevel->page_current
    
    The page being deleted still has to be made current because of
    assumptions made in s_delete_object()

diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index 61d8a7e..f151b51 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -140,6 +140,14 @@ void s_page_delete (TOPLEVEL *toplevel, PAGE *page)
   gchar *backup_filename;
   gchar *real_filename;
 
+  /* We need to temporarily make the page being deleted current because
+   * various functions called below (some indirectly) assume they are
+   * deleting objects from the current page.
+   *
+   * These functions are known to include:
+   *   s_delete_object ()
+   */
+
   /* save page_current and switch to page */
   if (page == toplevel->page_current) {
     tmp = NULL;

commit 3f6f9afbb9eb6770520f785e094169d9f2b164dc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Sep 7 23:37:45 2008 +0100

    Re-add wanted portions of #95923f7de815ec58819eaf94ab9332d51a28fbb9
    
    Simplify prototype of s_tile_remove_object().
    
    Don't pass TOPLEVEL and PAGE arguments which aren't needed.

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 582a242..14c037f 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -460,7 +460,7 @@ void s_stretch_destroy_all(STRETCH *head);
 /* s_tile.c */
 void s_tile_init(TOPLEVEL *toplevel, PAGE *p_current);
 void s_tile_add_line_object(TOPLEVEL *toplevel, OBJECT *object);
-void s_tile_remove_object(TOPLEVEL *toplevel, PAGE *page, OBJECT *object);
+void s_tile_remove_object(OBJECT *object);
 void s_tile_update_object(TOPLEVEL *toplevel, OBJECT *object);
 GList *s_tile_get_objectlists(TOPLEVEL *toplevel, int world_x1, int world_y1, int world_x2, int world_y2);
 void s_tile_print(TOPLEVEL *toplevel);
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 856d758..8ce1fd5 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -331,9 +331,7 @@ s_delete_object(TOPLEVEL *toplevel, OBJECT *o_current)
       g_free(o_current->line);
 
       /* yes this object might be in the tile system */
-      s_tile_remove_object(toplevel,
-                           toplevel->page_current,
-                           o_current);
+      s_tile_remove_object(o_current);
     }
     o_current->line = NULL;
 
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index 8ecd86a..61d8a7e 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -140,9 +140,6 @@ void s_page_delete (TOPLEVEL *toplevel, PAGE *page)
   gchar *backup_filename;
   gchar *real_filename;
 
-  /* we need to play with page_current because s_delete_list_fromstart() */
-  /* make use of it (see s_tile_remove_object) */
-
   /* save page_current and switch to page */
   if (page == toplevel->page_current) {
     tmp = NULL;
diff --git a/libgeda/src/s_tile.c b/libgeda/src/s_tile.c
index af8670e..c6e350d 100644
--- a/libgeda/src/s_tile.c
+++ b/libgeda/src/s_tile.c
@@ -281,11 +281,8 @@ void s_tile_add_line_object (TOPLEVEL *toplevel, OBJECT *object)
  *  \brief
  *  \par Function Description
  *
- *  \bug
- *  this is still wrong, p_current needs to be the page the object is on
- *  doesn't work if the current page isn't where the object lives
  */
-void s_tile_remove_object(TOPLEVEL *toplevel, PAGE *page, OBJECT *object)
+void s_tile_remove_object(OBJECT *object)
 {
   GList *tl_current;
 
@@ -310,7 +307,7 @@ void s_tile_remove_object(TOPLEVEL *toplevel, PAGE *page, OBJECT *object)
  */
 void s_tile_update_object(TOPLEVEL * toplevel, OBJECT * object)
 {
-  s_tile_remove_object(toplevel, toplevel->page_current, object);
+  s_tile_remove_object(object);
   s_tile_add_line_object(toplevel, object);
 }
 

commit e350d47b39bd358f55949e787511eab54b0048be
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Sep 7 23:37:45 2008 +0100

    Revert commit #95923f7de815ec58819eaf94ab9332d51a28fbb9
    
    This commit, "Simplify prototype of s_tile_remove_object()."
    removed code to make a page being deleted the current page.
    
    This change introduced a crash when closing gschem with multiple
    pages open. We shouldn't really need a page to be current to delete
    it's objects, but this is an underlying bug which should be fixed
    before this part of the patch is re-applied.

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 14c037f..582a242 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -460,7 +460,7 @@ void s_stretch_destroy_all(STRETCH *head);
 /* s_tile.c */
 void s_tile_init(TOPLEVEL *toplevel, PAGE *p_current);
 void s_tile_add_line_object(TOPLEVEL *toplevel, OBJECT *object);
-void s_tile_remove_object(OBJECT *object);
+void s_tile_remove_object(TOPLEVEL *toplevel, PAGE *page, OBJECT *object);
 void s_tile_update_object(TOPLEVEL *toplevel, OBJECT *object);
 GList *s_tile_get_objectlists(TOPLEVEL *toplevel, int world_x1, int world_y1, int world_x2, int world_y2);
 void s_tile_print(TOPLEVEL *toplevel);
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 8ce1fd5..856d758 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -331,7 +331,9 @@ s_delete_object(TOPLEVEL *toplevel, OBJECT *o_current)
       g_free(o_current->line);
 
       /* yes this object might be in the tile system */
-      s_tile_remove_object(o_current);
+      s_tile_remove_object(toplevel,
+                           toplevel->page_current,
+                           o_current);
     }
     o_current->line = NULL;
 
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index df5e487..8ecd86a 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -136,9 +136,21 @@ PAGE *s_page_new (TOPLEVEL *toplevel, const gchar *filename)
  */
 void s_page_delete (TOPLEVEL *toplevel, PAGE *page)
 {
+  PAGE *tmp;
   gchar *backup_filename;
   gchar *real_filename;
 
+  /* we need to play with page_current because s_delete_list_fromstart() */
+  /* make use of it (see s_tile_remove_object) */
+
+  /* save page_current and switch to page */
+  if (page == toplevel->page_current) {
+    tmp = NULL;
+  } else {
+    tmp = toplevel->page_current;
+    s_page_goto (toplevel, page);
+  }
+
   /* Get the real filename and file permissions */
   real_filename = follow_symlinks (page->page_filename, NULL);
   
@@ -195,10 +207,15 @@ void s_page_delete (TOPLEVEL *toplevel, PAGE *page)
 
   g_free (page);
 
-  if (toplevel->page_current == page) {
-    /* page was page_current, page_current must be updated */
+  /* restore page_current */
+  if (tmp != NULL) {
+    s_page_goto (toplevel, tmp);
+  } else {
+    /* page was page_current */
     toplevel->page_current = NULL;
+    /* page_current must be updated by calling function */
   }
+
 }
 
 
diff --git a/libgeda/src/s_tile.c b/libgeda/src/s_tile.c
index c6e350d..af8670e 100644
--- a/libgeda/src/s_tile.c
+++ b/libgeda/src/s_tile.c
@@ -281,8 +281,11 @@ void s_tile_add_line_object (TOPLEVEL *toplevel, OBJECT *object)
  *  \brief
  *  \par Function Description
  *
+ *  \bug
+ *  this is still wrong, p_current needs to be the page the object is on
+ *  doesn't work if the current page isn't where the object lives
  */
-void s_tile_remove_object(OBJECT *object)
+void s_tile_remove_object(TOPLEVEL *toplevel, PAGE *page, OBJECT *object)
 {
   GList *tl_current;
 
@@ -307,7 +310,7 @@ void s_tile_remove_object(OBJECT *object)
  */
 void s_tile_update_object(TOPLEVEL * toplevel, OBJECT * object)
 {
-  s_tile_remove_object(object);
+  s_tile_remove_object(toplevel, toplevel->page_current, object);
   s_tile_add_line_object(toplevel, object);
 }
 




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