[glom] libglom: LayoutGroup: Remove deprecated remove_field() and has_field().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] libglom: LayoutGroup: Remove deprecated remove_field() and has_field().
- Date: Mon, 12 Mar 2012 10:37:47 +0000 (UTC)
commit 3954fef50dd91199e425f266e76e8ed819bedec2
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Mar 12 10:45:32 2012 +0100
libglom: LayoutGroup: Remove deprecated remove_field() and has_field().
* glom/libglom/data_structure/layout/layoutgroup.[h|cc]: Remove
deprecated method overloads.
ChangeLog | 7 ++
glom/libglom/data_structure/layout/layoutgroup.cc | 92 ---------------------
glom/libglom/data_structure/layout/layoutgroup.h | 24 ------
3 files changed, 7 insertions(+), 116 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fee7f5e..9448dd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-12 Murray Cumming <murrayc murrayc com>
+
+ libglom: LayoutGroup: Remove deprecated remove_field() and has_field().
+
+ * glom/libglom/data_structure/layout/layoutgroup.[h|cc]: Remove
+ deprecated method overloads.
+
1.21.6:
2012-03-05 Murray Cumming <murrayc murrayc com>
diff --git a/glom/libglom/data_structure/layout/layoutgroup.cc b/glom/libglom/data_structure/layout/layoutgroup.cc
index de0c286..184fb82 100644
--- a/glom/libglom/data_structure/layout/layoutgroup.cc
+++ b/glom/libglom/data_structure/layout/layoutgroup.cc
@@ -85,32 +85,6 @@ LayoutGroup& LayoutGroup::operator=(const LayoutGroup& src)
return *this;
}
-bool LayoutGroup::has_field(const Glib::ustring& field_name) const
-{
- for(type_list_items::const_iterator iter = m_list_items.begin(); iter != m_list_items.end(); ++iter)
- {
- sharedptr<LayoutItem> item = *iter;
- sharedptr<LayoutItem_Field> field_item = sharedptr<LayoutItem_Field>::cast_dynamic(item);
- if(field_item)
- {
- if(field_item->get_name() == field_name)
- return true;
- }
- else
- {
- //Recurse into the child groups:
- sharedptr<LayoutGroup> group_item = sharedptr<LayoutGroup>::cast_dynamic(item);
- if(group_item)
- {
- if(group_item->has_field(field_name))
- return true;
- }
- }
- }
-
- return false;
-}
-
bool LayoutGroup::has_field(const Glib::ustring& parent_table_name, const Glib::ustring& table_name, const Glib::ustring& field_name) const
{
for(type_list_items::const_iterator iter = m_list_items.begin(); iter != m_list_items.end(); ++iter)
@@ -301,72 +275,6 @@ void LayoutGroup::remove_relationship(const sharedptr<const Relationship>& relat
}
}
-void LayoutGroup::remove_field(const Glib::ustring& field_name)
-{
- //Look at each item:
- LayoutGroup::type_list_items::iterator iterItem = m_list_items.begin();
- while(iterItem != m_list_items.end())
- {
- sharedptr<LayoutItem> item = *iterItem;
- sharedptr<LayoutItem_Field> field_item = sharedptr<LayoutItem_Field>::cast_dynamic(item);
- if(field_item)
- {
- if(!(field_item->get_has_relationship_name())) //If it's not a related table.
- {
- if(field_item->get_name() == field_name)
- {
- m_list_items.erase(iterItem);
- iterItem = m_list_items.begin(); //Start again, because we changed the container.AddDel
- continue;
- }
- }
- }
- else
- {
- sharedptr<LayoutItem_Portal> sub_portal = sharedptr<LayoutItem_Portal>::cast_dynamic(item);
- if(!sub_portal) //It could only be a related field in a portal - use remove_field(table, field) for that.
- {
- sharedptr<LayoutGroup> sub_group = sharedptr<LayoutGroup>::cast_dynamic(item);
- if(sub_group)
- sub_group->remove_field(field_name);
- }
- }
-
- ++iterItem;
- }
-}
-
-void LayoutGroup::remove_field(const Glib::ustring& table_name, const Glib::ustring& field_name)
-{
- //Look at each item:
- LayoutGroup::type_list_items::iterator iterItem = m_list_items.begin();
- while(iterItem != m_list_items.end())
- {
- sharedptr<LayoutItem> item = *iterItem;
- sharedptr<LayoutItem_Field> field_item = sharedptr<LayoutItem_Field>::cast_dynamic(item);
- if(field_item)
- {
- if(field_item->get_table_used(Glib::ustring()) == table_name)
- {
- if(field_item->get_name() == field_name)
- {
- m_list_items.erase(iterItem);
- iterItem = m_list_items.begin(); //Start again, because we changed the container.AddDel
- continue;
- }
- }
- }
- else
- {
- sharedptr<LayoutGroup> sub_group = sharedptr<LayoutGroup>::cast_dynamic(item);
- if(sub_group)
- sub_group->remove_field(table_name, field_name);
- }
-
- ++iterItem;
- }
-}
-
void LayoutGroup::remove_field(const Glib::ustring& parent_table_name, const Glib::ustring& table_name, const Glib::ustring& field_name)
{
//Look at each item:
diff --git a/glom/libglom/data_structure/layout/layoutgroup.h b/glom/libglom/data_structure/layout/layoutgroup.h
index 10f3f61..7288905 100644
--- a/glom/libglom/data_structure/layout/layoutgroup.h
+++ b/glom/libglom/data_structure/layout/layoutgroup.h
@@ -39,15 +39,6 @@ public:
virtual ~LayoutGroup();
virtual LayoutItem* clone() const;
-
- //TODO: Remove this now-unused method overload.
- /** Discover whether the layout group contains the specified related field,
- * @param field_name The name of the field to search for.
- * @result True if the field is in the layout group (or its child groups).
- *
- * @deprecated Use has_field(parent_table_name, table_name, field_name) instead.
- */
- bool has_field(const Glib::ustring& field_name) const;
/** Discover whether the layout group contains the specified field (from the current table).
* @param parent_table_name The table to which this layout belongs.
@@ -78,21 +69,6 @@ public:
* @param item The item to remove.
*/
void remove_item(const sharedptr<LayoutItem>& item);
-
- /** Remove any instance of the field (from the current table) from the layout.
- * @deprecated Use remove_field(parent_table_name, table_name, field_name) instead.
- */
- virtual void remove_field(const Glib::ustring& field_name);
-
- //TODO: Remove this unused method overload, and remove virtual from all these method overloads.
- /** Remove any instance of the related field from the layout.
- *
- * @param table_name The table to which the field, specified by @a field_name, belongs.
- * @param field_name The name of the field to search for.
- *
- * @deprecated Use remove_field(parent_table_name, table_name, field_name) instead.
- */
- virtual void remove_field(const Glib::ustring& table_name, const Glib::ustring& field_name);
/** Remove any instance of the field from the layout.
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]