[glom] libglom: Remove an unused Utils::sqlbuilder_get_full_query() overload.



commit 88e84ff82bea49794acfc17f721fa1aa2526715e
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Oct 31 09:49:29 2011 +0100

    libglom: Remove an unused Utils::sqlbuilder_get_full_query() overload.
    
    	* glom/libglom/utils.[h|cc]: Nothing uses the version that takes
    	a string and parameters.

 ChangeLog             |    9 ++++++++-
 glom/libglom/utils.cc |   38 --------------------------------------
 glom/libglom/utils.h  |    6 ------
 3 files changed, 8 insertions(+), 45 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index dd78045..57ace1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
 2011-10-31  Murray Cumming  <murrayc murrayc com>
 
-	libglom: sqlbuilder_get_full_query(): Improve the result.
+	libglom: Remove an unused Utils::sqlbuilder_get_full_query() overload.
+
+	* glom/libglom/utils.[h|cc]: Nothing uses the version that takes 
+	a string and parameters.
+
+2011-10-31  Murray Cumming  <murrayc murrayc com>
+
+	libglom: Utils::sqlbuilder_get_full_query(): Improve the result.
 
 	* glom/libglom/utils.cc: Use the GdaConnection's statement_to_sql() 
 	instead of just GdaStatement's to_sql() so we a) have correct quoting,
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index e9429cb..bdea5e2 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -1041,44 +1041,6 @@ static Glib::RefPtr<Gnome::Gda::Connection> get_connection()
 }
 
 std::string Utils::sqlbuilder_get_full_query(
-    const Glib::RefPtr<Gnome::Gda::Connection>& connection,
-    const Glib::ustring& query,
-    const Glib::RefPtr<const Gnome::Gda::Set>& params)
-{
-  Glib::ustring result = "glom_query_not_parsed";
-
-  try
-  {
-    Glib::RefPtr<Gnome::Gda::SqlParser> parser = connection->create_parser();
-    if(parser)
-    {
-      Glib::RefPtr<Gnome::Gda::Statement> stmt = parser->parse_string(query);
-      if(stmt)
-      {
-        result = connection->statement_to_sql(stmt, params,
-          Gnome::Gda::STATEMENT_SQL_PARAMS_AS_VALUES | Gnome::Gda::STATEMENT_SQL_PRETTY);
-      }
-    }
-  }
-  catch(const Glib::Exception& ex)
-  {
-    std::cerr << G_STRFUNC << ": exception while parsing query: " << ex.what() << std::endl;
-  }
-  catch(const std::exception& ex)
-  {
-    std::cerr << G_STRFUNC << ": exception while parsing query: " << ex.what() << std::endl;
-  }
-
-  //Convert to something that std::cout should be able to handle.
-  const Glib::ScopedPtr<char> buf(g_convert_with_fallback(
-    result.raw().data(), result.raw().size(),
-    "ISO-8859-1", "UTF-8",
-    (char*)"?",
-    0, 0, 0));
-  return std::string(buf.get());
-}
-
-std::string Utils::sqlbuilder_get_full_query(
   const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder)
 {
   Glib::RefPtr<Gnome::Gda::Connection> connection = get_connection();
diff --git a/glom/libglom/utils.h b/glom/libglom/utils.h
index 063e0e8..f9cf8d6 100644
--- a/glom/libglom/utils.h
+++ b/glom/libglom/utils.h
@@ -141,12 +141,6 @@ type_list_values_with_second get_choice_values(const Document* document, const s
 
 /// Get the full query string suitable for use with std::cout.
 std::string sqlbuilder_get_full_query(
-  const Glib::RefPtr<Gnome::Gda::Connection>& connection,
-  const Glib::ustring& query,
-  const Glib::RefPtr<const Gnome::Gda::Set>& params);
-
-/// Get the full query string suitable for use with std::cout.
-std::string sqlbuilder_get_full_query(
   const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder);
 
 /** Guess an appropriate identifier name based on a human-readable title



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