[glom] Allow building glom on maemo when --enable-maemo is passed to configure



commit 2ce35d1155c9c7e7b11b49802caa51bb30207e64
Author: Johannes Schmid <jhs gnome org>
Date:   Thu Jul 30 11:40:30 2009 +0200

    Allow building glom on maemo when --enable-maemo is passed to configure

 ChangeLog                                          |   12 +++++
 autogen.sh                                         |    2 +-
 glom/libglom/connectionpool.cc                     |   50 +++++++++++++-------
 glom/libglom/connectionpool_backends/postgres.cc   |   50 ++++++++++++-------
 glom/libglom/data_structure/field.cc               |   24 +++++++++-
 glom/libglom/data_structure/fieldtypes.cc          |    8 +++
 glom/libglom/document/bakery/document.cc           |   28 ++++++-----
 glom/libglom/python_embed/py_glom_relatedrecord.cc |   12 ++++-
 glom/libglom/spawn_with_feedback.cc                |   16 ++++++-
 glom/libglom/utils.cc                              |   12 ++++-
 10 files changed, 155 insertions(+), 59 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4a5663d..ed1d727 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2009-07-30  Johannes Schmid <jschmid openismus com>
+
+	* autogen.sh: Use automake-1.10 explicitly
+	* glom/libglom/connectionpool.cc
+	* glom/libglom/connectionpool_backends/postgres.cc
+	* glom/libglom/data_structure/field.cc
+	* glom/libglom/data_structure/fieldtypes.cc
+	* glom/libglom/document/bakery/document.cc           |   28 ++++++-----
+	* glom/libglom/python_embed/py_glom_relatedrecord.cc |   12 ++++-
+	* glom/libglom/spawn_with_feedback.cc                |   16 ++++++-
+	* glom/libglom/utils.cc                              |   12 ++++-
+
 2009-07-28  Daniel Elstner  <danielk openismus com>
 
 	Build and run tests on make check
diff --git a/autogen.sh b/autogen.sh
index 9ea7233..86ee492 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -5,6 +5,6 @@ test -n "$srcdir" || srcdir=.
   cd "$srcdir" &&
   gnome-doc-common --copy &&
   gnome-doc-prepare --automake --copy --force &&
-  AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install
+  AUTOPOINT='intltoolize --automake --copy' ACLOCAL=aclocal-1.10 AUTOMAKE=automake-1.10 autoreconf --force --install
 ) || exit
 test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index b85008f..b5bf139 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -377,6 +377,7 @@ sharedptr<SharedConnection> ConnectionPool::connect(std::auto_ptr<ExceptionConne
         //Allow get_meta_store_data() to succeed:
         //Hopefully this (and the update_meta_store_for_table() calls) is all we need.
         //std::cout << "DEBUG: Calling update_meta_store_data_types() ..." << std::endl;
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
         try
         {
           m_refGdaConnection->update_meta_store_data_types();
@@ -386,8 +387,14 @@ sharedptr<SharedConnection> ConnectionPool::connect(std::auto_ptr<ExceptionConne
           std::cerr << "ConnectionPool::connect(): update_meta_store_data_types() failed: " << ex.what() << std::endl;
         }
         //std::cout << "DEBUG: ... update_meta_store_data_types() has finished." << std::endl;
-
+#else
+        std::auto_ptr<Glib::Error> ex;
+        m_refGdaConnection->update_meta_store_data_types(ex);
+        if (ex.get())
+          std::cerr << "ConnectionPool::connect(): update_meta_store_data_types() failed: " << ex->what() << std::endl;
+#endif
         //std::cout << "DEBUG: Calling update_meta_store_table_names() ..." << std::endl;
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
         try
         {
           //update_meta_store_table_names() has been known to throw an exception.
@@ -399,6 +406,11 @@ sharedptr<SharedConnection> ConnectionPool::connect(std::auto_ptr<ExceptionConne
           std::cerr << "ConnectionPool::connect(): update_meta_store_table_names() failed: " << ex.what() << std::endl;
         }
         //std::cout << "DEBUG: ... update_meta_store_table_names() has finished." << std::endl;
+#else
+        m_refGdaConnection->update_meta_store_table_names(m_backend->get_public_schema_name(), ex);
+        if (ex.get())
+          std::cerr << "ConnectionPool::connect(): update_meta_store_data_types() failed: " << ex->what() << std::endl;
+#endif
 
         // Connection succeeded
         // Create the fieldtypes member if it has not already been done:
@@ -695,19 +707,20 @@ bool ConnectionPool::add_column(const Glib::ustring& table_name, const sharedptr
 
   if(!m_refGdaConnection)
     return false;
-
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   std::auto_ptr<Glib::Error> error;
+#endif
   const bool result = m_backend->add_column(m_refGdaConnection, table_name, field, error);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   if(error.get()) throw *error;
-
   m_refGdaConnection->update_meta_store_table(table_name, m_backend->get_public_schema_name());
 #else
-  const bool result = m_backend->add_column(m_refGdaConnection, table_name, field, error);
-  if(result)
-    result = m_refGdaConnection->update_meta_store_table(table_name, m_backend->get_public_schema_name(), error);
+  if(error.get())
+    std::cerr << "Error: " << error->what() << std::endl; 
+  m_refGdaConnection->update_meta_store_table(table_name, m_backend->get_public_schema_name(), error);
+  if(error.get())
+    std::cerr << "Error: " << error->what() << std::endl;   
 #endif
-
   return result;
 }
 
@@ -735,16 +748,18 @@ bool ConnectionPool::drop_column(const Glib::ustring& table_name, const Glib::us
 
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   std::auto_ptr<Glib::Error> error;
+#endif
   const bool result = m_backend->drop_column(m_refGdaConnection, table_name, field_name, error);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   if(error.get()) throw *error;
-
   m_refGdaConnection->update_meta_store_table(table_name, m_backend->get_public_schema_name());
 #else
-  const bool result = m_backend->drop_column(m_refGdaConnection, table_name, field_name, error);
-  if(result)
-    result = m_refGdaConnection->update_meta_store_table(table_name, m_backend->get_public_schema_name(), error);
+  if(error.get())
+    std::cerr << "Error: " << error->what() << std::endl; 
+  m_refGdaConnection->update_meta_store_table(table_name, m_backend->get_public_schema_name(), error);
+  if(error.get())
+    std::cerr << "Error: " << error->what() << std::endl; 
 #endif
-
   return result;
 }
 
@@ -788,16 +803,17 @@ bool ConnectionPool::change_columns(const Glib::ustring& table_name, const type_
 
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   std::auto_ptr<Glib::Error> error;
+#endif
   const bool result = m_backend->change_columns(m_refGdaConnection, table_name, old_fields, new_fields, error);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   if(error.get()) throw *error;
-
   m_refGdaConnection->update_meta_store_table(table_name, m_backend->get_public_schema_name());
+
 #else
-  const bool result = m_backend->change_columns(m_refGdaConnection, table_name, old_fields, new_fields, error);
-  if(result)
-    result = m_refGdaConnection->update_meta_store_table(table_name, m_backend->get_public_schema_name(), error);
+  if(error.get())
+    std::cerr << "Error: " << error->what() << std::endl; 
+  m_refGdaConnection->update_meta_store_table(table_name, m_backend->get_public_schema_name(), error);
 #endif
-
   return result;
 }
 
diff --git a/glom/libglom/connectionpool_backends/postgres.cc b/glom/libglom/connectionpool_backends/postgres.cc
index 712af6d..90f9c73 100644
--- a/glom/libglom/connectionpool_backends/postgres.cc
+++ b/glom/libglom/connectionpool_backends/postgres.cc
@@ -81,33 +81,36 @@ Glib::RefPtr<Gnome::Gda::Connection> Postgres::attempt_connect(const Glib::ustri
   std::cout << "  DEBUG: auth_string=" << auth_string << std::endl;
 #endif
 
-  //TODO: Use CONNECTION_OPTIONS_READ_ONLY in the client-only build:
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
   {
     connection = Gnome::Gda::Connection::open_from_string("PostgreSQL", 
       cnc_string, auth_string, 
-      Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
-    
+      Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE
+#ifndef GLOM_ENABLE_CLIENT_ONLY
+      | Gnome::Gda::CONNECTION_OPTIONS_READ_ONLY
+#endif
+      );
     connection->statement_execute_non_select("SET DATESTYLE = 'ISO'");
     data_model = connection->statement_execute_select("SELECT version()");
   }
   catch(const Glib::Error& ex)
   {
 #else
-  std::auto_ptr<Glib::Error> error;
+  std::auto_ptr<Glib::Error> ex;
   connection = Gnome::Gda::Connection::open_from_string("PostgreSQL", 
-    cnc_string, auth_string, Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE, error);
+    cnc_string, auth_string,
+    Gnome::Gda::CONNECTION_OPTIONS_READ_ONLY,
+    ex);
   
-  if(!error)
-    connection->statement_execute_non_select("SET DATESTYLE = 'ISO'", error);
+  if(!ex.get())
+    connection->statement_execute_non_select("SET DATESTYLE = 'ISO'", ex);
 
-  if(!error)
-    data_model = connection->statement_execute_select("SELECT version()", error);
+  if(!ex.get())
+    data_model = connection->statement_execute_select("SELECT version()", Gnome::Gda::STATEMENT_MODEL_RANDOM_ACCESS, ex);
 
-  if(glib_error.get())
+  if(!ex.get())
   {
-    const Glib::Error& ex = *glib_error;
 #endif
 
 #ifdef GLOM_CONNECTION_DEBUG
@@ -128,9 +131,9 @@ Glib::RefPtr<Gnome::Gda::Connection> Postgres::attempt_connect(const Glib::ustri
     catch(const Glib::Error& ex)
     {}
 #else
-    temp_conn = client->open_connection_from_string("PostgreSQL", 
+    temp_conn = Gnome::Gda::Connection::open_from_string("PostgreSQL", 
       cnc_string, auth_string, 
-      Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE, glib_error);
+      Gnome::Gda::CONNECTION_OPTIONS_READ_ONLY, ex);
 #endif
 
 #ifdef GLOM_CONNECTION_DEBUG
@@ -146,7 +149,11 @@ Glib::RefPtr<Gnome::Gda::Connection> Postgres::attempt_connect(const Glib::ustri
 
   if(data_model && data_model->get_n_rows() && data_model->get_n_columns())
   {
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
     Gnome::Gda::Value value = data_model->get_value_at(0, 0);
+#else
+    Gnome::Gda::Value value = data_model->get_value_at(0, 0, ex);
+#endif
     if(value.get_value_type() == G_TYPE_STRING)
     {
       const Glib::ustring version_text = value.get_string();
@@ -393,18 +400,21 @@ bool Postgres::attempt_create_database(const Glib::ustring& database_name, const
     return false;
   }
 #else
-  std::auto_ptr<Glib::Error> error;
+  std::auto_ptr<Glib::Error> ex;
   op = Gnome::Gda::ServerOperation::prepare_create_database("PostgreSQL",
                                                             database_name,
-                                                            error);
-  if(error)
+                                                            ex);
+  if(ex.get())
     return false;
 
   //TODO: Why is this here but not in the EXCEPTIONS_ENABLED part?
-  op = cnc->create_operation(Gnome::Gda::SERVER_OPERATION_CREATE_DB, set, error);
-  if(error)
+  // jhs: Does look like a bug to me, shouldn't be there
+#if 0
+  op = cnc->create_operation(Gnome::Gda::SERVER_OPERATION_CREATE_DB, set, ex.get());
+  if(ex.get())
     return false;
 #endif
+#endif
   g_assert(op);
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
@@ -427,9 +437,11 @@ bool Postgres::attempt_create_database(const Glib::ustring& database_name, const
   op->set_value_at("/SERVER_CNX_P/ADM_PASSWORD", password, error);
 
   if(error.get() == 0)
-    op->perform_create_database("PostgreSQL");
+    op->perform_create_database("PostgreSQL", ex);
   else
     return false;
+  if (error.get())
+    return false;
 #endif //GLIBMM_EXCEPTIONS_ENABLED
 
   return true;
diff --git a/glom/libglom/data_structure/field.cc b/glom/libglom/data_structure/field.cc
index 0fea80f..fb77c09 100644
--- a/glom/libglom/data_structure/field.cc
+++ b/glom/libglom/data_structure/field.cc
@@ -253,8 +253,23 @@ Glib::ustring Field::sql(const Gnome::Gda::Value& value, const Glib::RefPtr<Gnom
 
 Glib::ustring Field::sql(const Gnome::Gda::Value& value) const
 {
-  //TODO: Handle exceptions as in BaseDB::connect().
-  sharedptr<SharedConnection> connection = ConnectionPool::get_instance()->connect();
+  sharedptr<SharedConnection> connection;
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  try
+  {
+    connection = ConnectionPool::get_instance()->connect();
+  }
+  catch (Glom::ExceptionConnection& ex)
+  {
+    //TODO: Do something more useful here
+    std::cerr << "Field::sql, connection failed: " << ex.what() << std::endl;
+  }
+#else
+  std::auto_ptr<Glom::ExceptionConnection> ex;
+  connection = ConnectionPool::get_instance()->connect(ex);
+  if (ex.get())
+    std::cerr << "Field::sql, connection failed: " << ex->what() << std::endl;
+#endif
   if(connection)
   {
     Glib::RefPtr<Gnome::Gda::Connection> gda_connection = connection->get_gda_connection();
@@ -527,7 +542,12 @@ Glib::RefPtr<Gnome::Gda::Holder> Field::get_holder(const Gnome::Gda::Value& valu
   */
 
   Glib::RefPtr<Gnome::Gda::Holder> holder = Gnome::Gda::Holder::create(gtype, real_name);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   holder->set_value_as_value(value);
+#else
+  std::auto_ptr<Glib::Error> ex;
+  holder->set_value_as_value(value, ex);
+#endif
   return holder;
 }
 
diff --git a/glom/libglom/data_structure/fieldtypes.cc b/glom/libglom/data_structure/fieldtypes.cc
index 895ac4d..ff25742 100644
--- a/glom/libglom/data_structure/fieldtypes.cc
+++ b/glom/libglom/data_structure/fieldtypes.cc
@@ -71,7 +71,11 @@ FieldTypes::FieldTypes(const Glib::RefPtr<Gnome::Gda::Connection>& gda_connectio
 
       for(int i = 0; i < rows; ++i)
       {
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
         const Gnome::Gda::Value value_name = data_model_tables->get_value_at(DATAMODEL_FIELDS_COL_NAME, i);
+#else
+        const Gnome::Gda::Value value_name = data_model_tables->get_value_at(DATAMODEL_FIELDS_COL_NAME, i, error);
+#endif
 
         //Get the types's string representation:
         Glib::ustring schema_type_string;
@@ -80,7 +84,11 @@ FieldTypes::FieldTypes(const Glib::RefPtr<Gnome::Gda::Connection>& gda_connectio
         
         if(!schema_type_string.empty())
         {
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
           Gnome::Gda::Value value_gdatype = data_model_tables->get_value_at(DATAMODEL_FIELDS_COL_GTYPE, i);
+#else
+          Gnome::Gda::Value value_gdatype = data_model_tables->get_value_at(DATAMODEL_FIELDS_COL_GTYPE, i, error);
+#endif
           if(value_gdatype.get_value_type() == G_TYPE_STRING)
           {
             Glib::ustring type_string = value_gdatype.get_string();
diff --git a/glom/libglom/document/bakery/document.cc b/glom/libglom/document/bakery/document.cc
index 3a467b5..9b80865 100644
--- a/glom/libglom/document/bakery/document.cc
+++ b/glom/libglom/document/bakery/document.cc
@@ -213,8 +213,8 @@ bool Document::read_from_disk()
     return false; //print_error(ex, input_uri_string);
   }
 #else
-  std::auto_ptr<Gio::Error> error;
-  Glib::RefPtr<FileInputStream> stream = file.read(error);
+  std::auto_ptr<Glib::Error> error;
+  stream = file->read(error);
   if(error.get() != NULL)
     return false; //print_error(ex, input_uri_string);
 #endif
@@ -234,8 +234,9 @@ bool Document::read_from_disk()
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
       bytes_read = stream->read(buffer, BYTES_TO_PROCESS);
 #else
-      bytes_read = stream->read(buffer, BYTES_TO_PROCESS, error);
-      if(error.get() != NULL) break;
+      std::auto_ptr<Glib::Error> gerror;
+      bytes_read = stream->read(buffer, BYTES_TO_PROCESS, gerror);
+      if(gerror.get() != NULL) break;
 #endif
 
       if(bytes_read == 0)
@@ -253,7 +254,7 @@ bool Document::read_from_disk()
 #else
   if(error.get() != NULL)
   {
-    Gio::Error& ex = *error.get();
+    std::cerr << "Error: " << error->what() << std::endl;
 #endif
     // If the operation was not successful, print the error and abort
     return false; //print_error(ex, input_uri_string);
@@ -292,11 +293,11 @@ bool Document::write_to_disk()
     catch(const Gio::Error& ex)
     {
 #else
-    std::auto_ptr<Gio::Error> error;
-    stream.create(error);
+    std::auto_ptr<Glib::Error> error;
+    stream = file->replace(std::string(), false, Gio::FILE_CREATE_NONE, error);
     if(error.get() != NULL)
     {
-      const Gio::Error& ex = *error.get();
+      std::cout << "Error: " << error->what() << std::endl;
 #endif
      // If the operation was not successful, print the error and abort
      return false; // print_error(ex, output_uri_string);
@@ -321,10 +322,11 @@ bool Document::write_to_disk()
     catch(const Gio::Error& ex)
     {
 #else
-    stream->write(m_strContents.data(), m_strContents.bytes(), error);
-    if(error.get() != NULL)
+    std::auto_ptr<Glib::Error> gerror;
+    stream->write(m_strContents.data(), m_strContents.bytes(), gerror);
+    if(gerror.get() != NULL)
     {
-      Gio::Error& ex = *error.get();
+      std::cerr << "Error: "<< gerror.get() << std::endl;
 #endif
       // If the operation was not successful, print the error and abort
       return false; //print_error(ex, output_uri_string);
@@ -404,8 +406,8 @@ bool Document::get_read_only() const
         return false; //We should at least be able to read the permissions, so maybe the location is invalid. I'm not sure what the best return result here is.
       }
 #else
-      std::auto_ptr<Gio::Error> error;
-      info = file.query_info(G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, Gio::FILE_QUERY_INFO_NONE, error);
+      std::auto_ptr<Glib::Error> error;
+      info = file->query_info(G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, Gio::FILE_QUERY_INFO_NONE, error);
       if(error.get() != NULL)
         return false;
 #endif
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index 87341fb..b1eb0b5 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -233,12 +233,16 @@ RelatedRecord_tp_as_mapping_getitem(PyObject *self, PyObject *item)
             Glib::RefPtr<Gnome::Gda::DataModel> datamodel = gda_connection->statement_execute_select(sql_query);
 #else
             std::auto_ptr<Glib::Error> error;
-            Glib::RefPtr<Gnome::Gda::DataModel> datamodel =  gda_connection->statement_execute_select(sql_query, error);
+            Glib::RefPtr<Gnome::Gda::DataModel> datamodel =  gda_connection->statement_execute_select(sql_query, Gnome::Gda::STATEMENT_MODEL_RANDOM_ACCESS, error);
             // Ignore error, datamodel return value is checked below
 #endif
             if(datamodel && datamodel->get_n_rows())
             {
+#ifdef GLIBMM_EXCEPTIONS_ENABLED            
               Gnome::Gda::Value value = datamodel->get_value_at(0, 0);
+#else
+              Gnome::Gda::Value value = datamodel->get_value_at(0, 0, error);
+#endif                            
               //g_warning("RelatedRecord_tp_as_mapping_getitem(): value from datamodel = %s", value.to_string().c_str());
 
               //Cache it, in case it's asked-for again.
@@ -335,14 +339,18 @@ RelatedRecord_generic_aggregate(PyGlomRelatedRecord* self, PyObject *args, PyObj
         Glib::RefPtr<Gnome::Gda::DataModel> datamodel = gda_connection->statement_execute_select(sql_query);
 #else
         std::auto_ptr<Glib::Error> error;
-        Glib::RefPtr<Gnome::Gda::DataModel> datamodel = gda_connection->execute_select_command(sql_query, error);
+        Glib::RefPtr<Gnome::Gda::DataModel> datamodel = gda_connection->statement_execute_select(sql_query, Gnome::Gda::STATEMENT_MODEL_RANDOM_ACCESS, error);
 
         // Ignore the error: The case that the command execution didn't return
         // a datamodel is handled below.
 #endif
         if(datamodel && datamodel->get_n_rows())
         {
+#ifdef GLIBMM_EXCEPTIONS_ENABLED        
           Gnome::Gda::Value value = datamodel->get_value_at(0, 0);
+#else
+          Gnome::Gda::Value value = datamodel->get_value_at(0, 0, error);
+#endif          
           //g_warning("RelatedRecord_generic_aggregate(): value from datamodel = %s", value.to_string().c_str());
 
           //Cache it, in case it's asked-for again.
diff --git a/glom/libglom/spawn_with_feedback.cc b/glom/libglom/spawn_with_feedback.cc
index d4d75b7..17f849c 100644
--- a/glom/libglom/spawn_with_feedback.cc
+++ b/glom/libglom/spawn_with_feedback.cc
@@ -168,7 +168,13 @@ private:
     channel->set_flags(Glib::IO_FLAG_NONBLOCK, error);
 #endif // !GLIBMM_EXCEPTIONS_ENABLED
 
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
     channel->set_encoding("");
+#else
+    channel->set_encoding("", error);
+    if (error.get())
+      std::cerr << "Error: " << error->what() << std::endl;
+#endif
     channel->set_buffered(false);
 
     Glib::signal_io().connect(sigc::bind(sigc::mem_fun(*this, &SpawnInfo::on_io), channel, sigc::ref(string)), channel, Glib::IO_IN);
@@ -220,8 +226,14 @@ public:
       std::vector<std::string> arguments = Glib::shell_parse_argv(command_line);
       int child_stdout;
       int child_stderr;
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
       Glib::spawn_async_with_pipes(Glib::get_current_dir(), arguments, Glib::SPAWN_DO_NOT_REAP_CHILD, sigc::slot<void>(), &pid, NULL, redirect & REDIRECT_STDOUT ? &child_stdout : NULL, redirect & REDIRECT_STDERR ? &child_stderr : NULL);
-
+#else
+      std::auto_ptr<Glib::Error> error;
+      Glib::spawn_async_with_pipes(Glib::get_current_dir(), arguments, Glib::SPAWN_DO_NOT_REAP_CHILD, sigc::slot<void>(), &pid, NULL, redirect & REDIRECT_STDOUT ? &child_stdout : NULL, redirect & REDIRECT_STDERR ? &child_stderr : NULL, error);
+      if (error.get())
+        std::cerr << "Spawn Error: " << error->what() << std::endl;
+#endif
       if(redirect & REDIRECT_STDOUT)
         redirect_to_string(child_stdout, stdout_text);
       if(redirect & REDIRECT_STDERR)
@@ -444,7 +456,7 @@ namespace
       // a row or so.
     }
 #else
-    Impl::spawn_sync(second_commands, &stdout_output, NULL, &return_status);
+    Impl::spawn_sync(second_command, &stdout_output, NULL);
 #endif
 
     if(!success_text.empty())
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index f4b1d4f..48a0b99 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -437,7 +437,7 @@ Utils::type_list_values_with_second Utils::get_choice_values(const sharedptr<con
   Glib::RefPtr<Gnome::Gda::DataModel> datamodel = connection->get_gda_connection()->statement_execute_select(sql_query);
 #else
   std::auto_ptr<Glib::Error> error;
-  Glib::RefPtr<Gnome::Gda::DataModel> datamodel = connection->get_gda_connection()->statement_execute_select(sql_query, error);
+  Glib::RefPtr<Gnome::Gda::DataModel> datamodel = connection->get_gda_connection()->statement_execute_select(sql_query, Gnome::Gda::STATEMENT_MODEL_RANDOM_ACCESS, error);
 #endif
 
   if(datamodel)
@@ -446,13 +446,20 @@ Utils::type_list_values_with_second Utils::get_choice_values(const sharedptr<con
     //std::cout << "  result: count=" << count << std::endl;
     for(guint row = 0; row < count; ++row)
     {
+
       std::pair<Gnome::Gda::Value, Gnome::Gda::Value> itempair;
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
       itempair.first = datamodel->get_value_at(0, row);
 
       if(with_second)
         itempair.second = datamodel->get_value_at(1, row);
+#else
+      itempair.first = datamodel->get_value_at(0, row, error);
 
+      if(with_second)
+        itempair.second = datamodel->get_value_at(1, row, error);
       list_values.push_back(itempair);
+#endif      
     }
   }
   else
@@ -796,8 +803,7 @@ bool Utils::file_exists(const Glib::ustring& uri)
       return false; //Something went wrong. It does not exist.
     }
 #else
-      std::auto_ptr<Gio::Error> error;
-      retrun file->query_exists(error);
+      return file->query_exists();
 #endif
   }
 }



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