[glom/glom-1-16] Use Gnome::Gda::SqlBuilder::Id



commit 6bf13750d959ba7318ca728991497ece667956fb
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Jun 19 19:08:43 2010 +0200

    Use Gnome::Gda::SqlBuilder::Id
    
    * glom/base_db.cc:
    * glom/libglom/python_embed/py_glom_relatedrecord.cc:
    * glom/libglom/utils.cc:
    * glom/utility_widgets/db_adddel/glom_db_treemodel.cc: Use the typedef
    instead of guint. It is very lengthy, but it is correct.

 ChangeLog                                          |   10 ++++++++++
 glom/base_db.cc                                    |    2 +-
 glom/libglom/python_embed/py_glom_relatedrecord.cc |    2 +-
 glom/libglom/utils.cc                              |    8 ++++----
 .../utility_widgets/db_adddel/glom_db_treemodel.cc |    2 +-
 5 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d77697b..86adb0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-06-19  Murray Cumming  <murrayc murrayc com>
+
+	Use Gnome::Gda::SqlBuilder::Id
+
+	* glom/base_db.cc:
+	* glom/libglom/python_embed/py_glom_relatedrecord.cc:
+	* glom/libglom/utils.cc:
+	* glom/utility_widgets/db_adddel/glom_db_treemodel.cc: Use the typedef 
+	instead of guint. It is very lengthy, but it is correct.
+
 2010-06-15  Murray Cumming  <murrayc murrayc com>
 
 	Use SqlBuilder::add_field_id() to avoid ambiguity.
diff --git a/glom/base_db.cc b/glom/base_db.cc
index f7412ea..8990d38 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -1902,7 +1902,7 @@ int Base_DB::count_rows_returned_by(const Glib::RefPtr<Gnome::Gda::SqlBuilder>&
   const guint target_id = builder->add_sub_select( sql_query->get_sql_statement() );
   builder->select_add_target_id(target_id, "glomarbitraryalias");
 
-  const guint id_function = builder->add_function("COUNT", builder->add_id("*"));
+  const Gnome::Gda::SqlBuilder::Id id_function = builder->add_function("COUNT", builder->add_id("*"));
   builder->add_field_value_id(id_function);
 
 
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index c9da021..211ab6f 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -196,7 +196,7 @@ boost::python::object PyGlomRelatedRecord::generic_aggregate(const std::string&
   Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
     Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
 
-  const guint id_function = builder->add_function(aggregate, builder->add_id(field_name)); //TODO: It would be nice to specify the table here too.
+  const Gnome::Gda::SqlBuilder::Id id_function = builder->add_function(aggregate, builder->add_id(field_name)); //TODO: It would be nice to specify the table here too.
   builder->add_field_value_id(id_function);
 
   builder->select_add_target(related_table);
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index 95328e0..fe398ff 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -336,14 +336,14 @@ void Utils::build_sql_select_add_fields_to_get(const Glib::RefPtr<Gnome::Gda::Sq
     const LayoutItem_FieldSummary* fieldsummary = dynamic_cast<const LayoutItem_FieldSummary*>(layout_item.obj());
     if(fieldsummary)
     {
-      const guint id_function = builder->add_function(
+      const Gnome::Gda::SqlBuilder::Id id_function = builder->add_function(
         fieldsummary->get_summary_type_sql(),
         builder->add_id(layout_item->get_sql_name(table_name)) ); //TODO: Just use add_field_id()?
       builder->add_field_value_id(id_function);
     }
     else
     {
-      const guint id = builder->select_add_field(layout_item->get_name(), parent);
+      const Gnome::Gda::SqlBuilder::Id id = builder->select_add_field(layout_item->get_name(), parent);
 
       //Avoid duplicate records with doubly-related fields:
       if(extra_join)
@@ -431,7 +431,7 @@ Gnome::Gda::SqlExpr Utils::build_simple_where_expression(const Glib::ustring& ta
 {
   Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
   builder->select_add_target(table_name);  //This might not be necessary.
-  const guint id = builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
+  const Gnome::Gda::SqlBuilder::Id id = builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
     builder->add_field_id(key_field->get_name(), table_name),
     builder->add_expr(key_value));
   builder->set_where(id); //This might not be necessary.
@@ -444,7 +444,7 @@ Gnome::Gda::SqlExpr Utils::build_combined_where_expression(const Gnome::Gda::Sql
   Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
     Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
 
-  const guint id = builder->add_cond(op,
+  const Gnome::Gda::SqlBuilder::Id id = builder->add_cond(op,
     builder->import_expression(a),
     builder->import_expression(b));
    builder->set_where(id);
diff --git a/glom/utility_widgets/db_adddel/glom_db_treemodel.cc b/glom/utility_widgets/db_adddel/glom_db_treemodel.cc
index f4670ed..e341fc0 100644
--- a/glom/utility_widgets/db_adddel/glom_db_treemodel.cc
+++ b/glom/utility_widgets/db_adddel/glom_db_treemodel.cc
@@ -909,7 +909,7 @@ void DbTreeModel::get_record_counts(gulong& total, gulong& found) const
       Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
         Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
 
-      const guint id_function = builder->add_function("count", builder->add_id("*")); //TODO: Is * allowed here?
+      const Gnome::Gda::SqlBuilder::Id id_function = builder->add_function("count", builder->add_id("*")); //TODO: Is * allowed here?
       builder->add_field_value_id(id_function);
 
       builder->select_add_target(m_found_set.m_table_name);



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