[glom/gtktoolpallete] Cope with FlowTable misbehaviour when it is managed.



commit e686898fb4693ca927ce1c5e98f5bda4f4a589ff
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Dec 30 15:36:51 2009 +0100

    Cope with FlowTable misbehaviour when it is managed.

 glom/mode_data/flowtablewithfields.cc      |    6 ++++++
 glom/utility_widgets/test_flowtable_dnd.cc |    4 +++-
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 2955286..9b2e4af 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -1001,6 +1001,12 @@ void FlowTableWithFields::forget_views()
     if(pSub)
     {
       remove_view(*iter);
+
+      //Remove these from their parents because they don't support auto-removal when their parents are destroyed:
+      //See https://bugzilla.gnome.org/show_bug.cgi?id=605728
+      pSub->reference();
+      pSub->unparent();
+      delete pSub;
     }
   }
   m_sub_flow_tables.clear();
diff --git a/glom/utility_widgets/test_flowtable_dnd.cc b/glom/utility_widgets/test_flowtable_dnd.cc
index 2c9114c..2cc3f03 100644
--- a/glom/utility_widgets/test_flowtable_dnd.cc
+++ b/glom/utility_widgets/test_flowtable_dnd.cc
@@ -71,8 +71,10 @@ main(int argc, char* argv[])
   button11.show(); button12.show();
   
   window.add(flowtable);
-  flowtable.set_design_mode();
+  flowtable.set_design_mode(true);
   flowtable.show();
+  flowtable.set_design_mode(false);
+  flowtable.set_design_mode(true);
 
 //  Glom::DragWindow drag_window;
 //  drag_window.show();



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