[glom] Remove some unused member variables.



commit d31b5242cfe07e023e0327bc5930aa04c06c06f7
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Mar 12 13:57:48 2012 +0100

    Remove some unused member variables.
    
    * glom/mode_data/box_data_list.[h|cc]:
    * glom/mode_data/box_data_manyrecords.[h|cc]:
    Remove m_has_one_or_more_records.
    * glom/mode_data/box_data_list_related.cc:
    Adapted.

 ChangeLog                               |   10 ++++++++++
 glom/mode_data/box_data_list.cc         |    3 +--
 glom/mode_data/box_data_list.h          |    1 -
 glom/mode_data/box_data_list_related.cc |    9 ---------
 glom/mode_data/box_data_manyrecords.cc  |    3 +--
 glom/mode_data/box_data_manyrecords.h   |    2 --
 6 files changed, 12 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f3f3651..b25fc28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2012-03-12  Murray Cumming  <murrayc murrayc com>
 
+	Remove some unused member variables.
+
+	* glom/mode_data/box_data_list.[h|cc]:
+	* glom/mode_data/box_data_manyrecords.[h|cc]:
+	Remove m_has_one_or_more_records.
+	* glom/mode_data/box_data_list_related.cc:
+	Adapted.
+
+2012-03-12  Murray Cumming  <murrayc murrayc com>
+
 	Document: Move XML utilities into a new file.
 
 	* glom/libglom/document/document.[h|cc]: Move the static
diff --git a/glom/mode_data/box_data_list.cc b/glom/mode_data/box_data_list.cc
index 308be3f..a9b0f1e 100644
--- a/glom/mode_data/box_data_list.cc
+++ b/glom/mode_data/box_data_list.cc
@@ -33,8 +33,7 @@ namespace Glom
 {
 
 Box_Data_List::Box_Data_List()
-: m_has_one_or_more_records(false),
-  m_read_only(false)
+:  m_read_only(false)
 {
   m_layout_name = "list";
 
diff --git a/glom/mode_data/box_data_list.h b/glom/mode_data/box_data_list.h
index ab7987a..d807052 100644
--- a/glom/mode_data/box_data_list.h
+++ b/glom/mode_data/box_data_list.h
@@ -110,7 +110,6 @@ protected:
   //Member widgets:
   mutable DbAddDel_WithButtons m_AddDel; //mutable because its get_ methods aren't const.
 
-  bool m_has_one_or_more_records;
   bool m_read_only;
 };
 
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index 2bd0eeb..46922f5 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -156,15 +156,6 @@ bool Box_Data_List_Related::fill_from_database()
   {
     result = Box_Data_Portal::fill_from_database();
 
-
-    //Is there already one record here?
-    if(m_has_one_or_more_records) //This was set by Box_Data_Portal::fill_from_database().
-    {
-      //Is the to_field unique? If so, there can not be more than one.
-      if(m_key_field && m_key_field->get_unique_key()) //automatically true if it is a primary key
-        allow_add = false;
-    }
-
     //TODO: Disable add if the from_field already has a value and the to_field is auto-incrementing because
     //- we cannot override the auto-increment in the to_field.
     //- we cannot change the value in the from_field to the new auto_increment value in the to_field.
diff --git a/glom/mode_data/box_data_manyrecords.cc b/glom/mode_data/box_data_manyrecords.cc
index bee4042..d19bbc5 100644
--- a/glom/mode_data/box_data_manyrecords.cc
+++ b/glom/mode_data/box_data_manyrecords.cc
@@ -34,8 +34,7 @@ namespace Glom
 {
 
 Box_Data_ManyRecords::Box_Data_ManyRecords()
-: m_has_one_or_more_records(false),
-  m_read_only(false)
+: m_read_only(false)
 {
   //We do not actually use this,
   //so it is a bug if this appears in the .glom file:
diff --git a/glom/mode_data/box_data_manyrecords.h b/glom/mode_data/box_data_manyrecords.h
index b67e236..2c6b63c 100644
--- a/glom/mode_data/box_data_manyrecords.h
+++ b/glom/mode_data/box_data_manyrecords.h
@@ -63,8 +63,6 @@ protected:
   virtual void print_layout();
   virtual void print_layout_group(xmlpp::Element* node_parent, const sharedptr<const LayoutGroup>& group);
 
-  //TODO: remove?
-  bool m_has_one_or_more_records;
   bool m_read_only;
 
 



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