[glom] Box_Data_Portal: Call show_title() from base.



commit 2823b6191c65c6dd3ef840e877c00ef7165606aa
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Mar 21 13:02:41 2016 +0100

    Box_Data_Portal: Call show_title() from base.

 glom/mode_data/box_data_calendar_related.cc |    7 -------
 glom/mode_data/box_data_list_related.cc     |    6 ------
 glom/mode_data/box_data_portal.cc           |    6 ++++++
 3 files changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index 0d91dbe..232a5c8 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -92,13 +92,6 @@ bool Box_Data_Calendar_Related::init_db_details(const Glib::ustring& parent_tabl
 
   Base_DB_Table::m_table_name = LayoutWidgetBase::m_table_name;
 
-  //TODO: This is duplicated in box_data_related_list.cc and box_data_portal.cc. Just use code from the base 
class?
-  Glib::ustring title;
-  if(show_title && portal) {
-    title = item_get_title(portal);
-  }
-  show_title_in_ui(title);
-
   if(portal)
   {
     auto document = get_document();    
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index f630ca9..bd9c56c 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -94,12 +94,6 @@ bool Box_Data_List_Related::init_db_details(const Glib::ustring& parent_table, b
 
   Base_DB_Table::m_table_name = LayoutWidgetBase::m_table_name;
 
-  Glib::ustring title;
-  if(show_title && portal) {
-    title = item_get_title(portal);
-  }
-  show_title_in_ui(title);
-
   if(portal)
   {
     m_key_field = DbUtils::get_fields_for_table_one_field(get_document(),
diff --git a/glom/mode_data/box_data_portal.cc b/glom/mode_data/box_data_portal.cc
index 470f86d..72ccf68 100644
--- a/glom/mode_data/box_data_portal.cc
+++ b/glom/mode_data/box_data_portal.cc
@@ -101,6 +101,12 @@ bool Box_Data_Portal::init_db_details(const std::shared_ptr<const LayoutItem_Por
   if(portal_stored)
     parent_table = portal_stored->get_from_table();
 
+  Glib::ustring title;
+  if(show_title && portal_stored) {
+    title = item_get_title(portal_stored);
+  }
+  show_title_in_ui(title);
+
   return init_db_details(parent_table, show_title);
 }
 


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