[glom] DbUtils::layout_field_should_have_navigation(): Const correction.



commit 7fd96621a5f84cb6801e529f84091b902559455d
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Nov 19 12:11:31 2013 +0100

    DbUtils::layout_field_should_have_navigation(): Const correction.

 glom/libglom/db_utils.cc                |    2 +-
 glom/libglom/db_utils.h                 |    2 +-
 glom/mode_data/box_data_details.cc      |    2 +-
 glom/mode_data/datawidget/datawidget.cc |    2 +-
 tests/test_document_load.cc             |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index 0f85d75..f45925d 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -1868,7 +1868,7 @@ void layout_item_fill_field_details(const Document* document, const Glib::ustrin
   layout_item->set_full_field_details( document->get_field(table_name, layout_item->get_name()) );
 }
 
-bool layout_field_should_have_navigation(const Glib::ustring& table_name, const sharedptr<const 
LayoutItem_Field>& layout_item, const Document* document, sharedptr<Relationship>& 
field_used_in_relationship_to_one)
+bool layout_field_should_have_navigation(const Glib::ustring& table_name, const sharedptr<const 
LayoutItem_Field>& layout_item, const Document* document, sharedptr<const Relationship>& 
field_used_in_relationship_to_one)
 {
   //Initialize output parameter:
   field_used_in_relationship_to_one = sharedptr<Relationship>();
diff --git a/glom/libglom/db_utils.h b/glom/libglom/db_utils.h
index f3b5fab..47d241c 100644
--- a/glom/libglom/db_utils.h
+++ b/glom/libglom/db_utils.h
@@ -156,7 +156,7 @@ void layout_item_fill_field_details(const Document* document, const Glib::ustrin
  * @param layout_item A field on a layout. This must have full field details.
  * @param field_used_in_relationship_to_one A relationship, if the field identifies a single record, so a 
Find button would also make sense, to choose the ID, in editing mode.
  */
-bool layout_field_should_have_navigation(const Glib::ustring& table_name, const sharedptr<const 
LayoutItem_Field>& layout_item, const Document* document, sharedptr<Relationship>& 
field_used_in_relationship_to_one);
+bool layout_field_should_have_navigation(const Glib::ustring& table_name, const sharedptr<const 
LayoutItem_Field>& layout_item, const Document* document, sharedptr<const Relationship>& 
field_used_in_relationship_to_one);
 
 /** Discover a database name that is not yet used.
  * This assumes that all other connection details are correctly set.
diff --git a/glom/mode_data/box_data_details.cc b/glom/mode_data/box_data_details.cc
index 43b2a1e..00c207a 100644
--- a/glom/mode_data/box_data_details.cc
+++ b/glom/mode_data/box_data_details.cc
@@ -653,7 +653,7 @@ void Box_Data_Details::on_flowtable_field_open_details_requested(const sharedptr
   //unconst_field->set_full_field_details(
   //  document->get_field(field->get_table_used(table_name), field->get_name()) ); //Otherwise 
get_primary_key() returns false always.
       
-  sharedptr<Relationship> field_used_in_relationship_to_one;
+  sharedptr<const Relationship> field_used_in_relationship_to_one;
   const bool has_open_button = 
     DbUtils::layout_field_should_have_navigation(m_table_name, layout_field, get_document(), 
     field_used_in_relationship_to_one);
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index ca1255a..5eef647 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -186,7 +186,7 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
     field->set_full_field_details(
       document->get_field(field->get_table_used(table_name), field->get_name()) ); //Otherwise 
get_primary_key() returns false always.
 
-    sharedptr<Relationship> field_used_in_relationship_to_one;
+    sharedptr<const Relationship> field_used_in_relationship_to_one;
     const bool add_open_button = 
        DbUtils::layout_field_should_have_navigation(table_name, field, document, 
          field_used_in_relationship_to_one);
diff --git a/tests/test_document_load.cc b/tests/test_document_load.cc
index e507df0..f4ce3f6 100644
--- a/tests/test_document_load.cc
+++ b/tests/test_document_load.cc
@@ -85,7 +85,7 @@ static bool needs_navigation(Glom::Document& document, const Glib::ustring& tabl
   layout_item->set_full_field_details(
     document.get_field(table_name, field_name));
 
-  Glom::sharedptr<Glom::Relationship> field_used_in_relationship_to_one;
+  Glom::sharedptr<const Glom::Relationship> field_used_in_relationship_to_one;
   return Glom::DbUtils::layout_field_should_have_navigation(table_name, 
     layout_item, &document, field_used_in_relationship_to_one);
 }


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