[glom] Change lots of g_warnings() to std::cerr.



commit 63ef26ed1e134a301d7698a62b33873ed879009f
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Feb 23 11:52:30 2012 +0100

    Change lots of g_warnings() to std::cerr.

 ChangeLog                                          |    4 ++++
 glom/appwindow.cc                                  |   14 +++++++-------
 glom/base_db.cc                                    |   16 ++++++++--------
 glom/base_db_table_data.cc                         |    4 ++--
 glom/box_reports.cc                                |    4 +++-
 glom/dialog_connection.cc                          |    4 +++-
 glom/frame_glom.cc                                 |    4 ++--
 glom/libglom/connectionpool.cc                     |    4 ++--
 glom/libglom/data_structure/field.cc               |   10 +++++-----
 glom/libglom/data_structure/fieldtypes.cc          |    6 +++---
 glom/libglom/data_structure/glomconversions.cc     |    2 +-
 .../data_structure/layout/fieldformatting.cc       |    2 +-
 .../data_structure/layout/layoutitem_field.cc      |    2 +-
 .../data_structure/layout/usesrelationship.cc      |    2 +-
 glom/libglom/document/bakery/document_xml.cc       |    2 +-
 glom/libglom/document/document.cc                  |   16 ++++++++--------
 glom/libglom/python_embed/py_glom_relatedrecord.cc |    6 +++---
 glom/mode_data/box_data_calendar_related.cc        |    2 +-
 glom/mode_data/box_data_details.cc                 |    2 +-
 glom/mode_data/box_data_list_related.cc            |    2 +-
 glom/mode_data/datawidget/datawidget.cc            |    2 +-
 glom/mode_data/datawidget/treemodel_db.cc          |   14 +++++++-------
 glom/mode_data/db_adddel/db_adddel.cc              |    4 ++--
 glom/mode_data/flowtablewithfields.cc              |    6 +++---
 glom/mode_design/dialog_initial_password.cc        |    2 +-
 glom/mode_design/fields/box_db_table_definition.cc |    4 ++--
 glom/mode_design/layout/dialog_choose_field.cc     |    6 ++++--
 .../layout_item_dialogs/combo_summarytype.cc       |    4 +++-
 .../mode_design/print_layouts/box_print_layouts.cc |    4 +++-
 glom/navigation/box_tables.cc                      |    2 +-
 glom/utility_widgets/adddel/adddel.cc              |    6 +++---
 glom/utils_ui.cc                                   |    4 ++--
 32 files changed, 90 insertions(+), 76 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7c60f2c..d0d089e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-02-23  Murray Cumming  <murrayc murrayc com>
 
+	Change lots of g_warnings() to std::cerr.
+
+2012-02-23  Murray Cumming  <murrayc murrayc com>
+
 	FieldTypes: Add defaults.
 
 	* glom/libglom/data_structure/fieldtypes.[h|cc]: Fallback to a hard-coded map of
diff --git a/glom/appwindow.cc b/glom/appwindow.cc
index ef02e70..b11c95a 100644
--- a/glom/appwindow.cc
+++ b/glom/appwindow.cc
@@ -1645,7 +1645,7 @@ bool AppWindow::recreate_database_from_example(bool& user_cancelled)
     if(!error.get())
     {
 #endif // GLIBMM_EXCEPTIONS_ENABLED
-      g_warning("AppWindow::recreate_database_from_example(): Failed because database exists already.");
+      std::cerr << G_STRFUNC << ": Failed because database exists already." << std::endl;
 
       return false; //Connection to the database succeeded, because no exception was thrown. so the database exists already.
 #ifndef GLIBMM_EXCEPTIONS_ENABLED
@@ -1666,7 +1666,7 @@ bool AppWindow::recreate_database_from_example(bool& user_cancelled)
       if(ex.get_failure_type() == ExceptionConnection::FAILURE_NO_SERVER)
       {
         user_cancelled = true; //Eventually, the user will cancel after retrying.
-        g_warning("AppWindow::recreate_database_from_example(): Failed because connection to server failed, without specifying a database.");
+        std::cerr << G_STRFUNC << ": Failed because connection to server failed, without specifying a database." << std::endl;
         return false;
       }
 #ifndef GLIBMM_EXCEPTIONS_ENABLED
@@ -1718,7 +1718,7 @@ bool AppWindow::recreate_database_from_example(bool& user_cancelled)
   {
     const std::exception& ex = *error.get();
 #endif // GLIBMM_EXCEPTIONS_ENABLED
-    g_warning("AppWindow::recreate_database_from_example(): Failed to connect to the newly-created database.");
+    std::cerr << G_STRFUNC << ": Failed to connect to the newly-created database." << std::endl;
     return false;
   }
 
@@ -1749,7 +1749,7 @@ bool AppWindow::recreate_database_from_example(bool& user_cancelled)
     pulse_progress_message();
     if(!table_creation_succeeded)
     {
-      g_warning("AppWindow::recreate_database_from_example(): CREATE TABLE failed with the newly-created database.");
+      std::cerr << G_STRFUNC << ": CREATE TABLE failed with the newly-created database." << std::endl;
       return false;
     }
   }
@@ -1776,7 +1776,7 @@ bool AppWindow::recreate_database_from_example(bool& user_cancelled)
 
       if(!table_insert_succeeded)
       {
-        g_warning("AppWindow::recreate_database_from_example(): INSERT of example data failed with the newly-created database.");
+        std::cerr << G_STRFUNC << ": INSERT of example data failed with the newly-created database." << std::endl;
         return false;
       }
     //}
@@ -1824,7 +1824,7 @@ bool AppWindow::recreate_database_from_backup(const Glib::ustring& backup_uri, b
     if(!error.get())
     {
 #endif // GLIBMM_EXCEPTIONS_ENABLED
-      g_warning("AppWindow::recreate_database_from_example(): Failed because database exists already.");
+      std::cerr << G_STRFUNC << ": Failed because database exists already." << std::endl;
 
       return false; //Connection to the database succeeded, because no exception was thrown. so the database exists already.
 #ifndef GLIBMM_EXCEPTIONS_ENABLED
@@ -1845,7 +1845,7 @@ bool AppWindow::recreate_database_from_backup(const Glib::ustring& backup_uri, b
       if(ex.get_failure_type() == ExceptionConnection::FAILURE_NO_SERVER)
       {
         user_cancelled = true; //Eventually, the user will cancel after retrying.
-        g_warning("AppWindow::recreate_database_from_example(): Failed because connection to server failed, without specifying a database.");
+        std::cerr << G_STRFUNC << ": Failed because connection to server failed, without specifying a database." << std::endl;
         return false;
       }
 #ifndef GLIBMM_EXCEPTIONS_ENABLED
diff --git a/glom/base_db.cc b/glom/base_db.cc
index 238d450..9b4f32c 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -169,7 +169,7 @@ AppState::userlevels Base_DB::get_userlevel() const
   }
   else
   {
-    g_warning("Base_DB::get_userlevel(): document not found.");
+    std::cerr << G_STRFUNC << ": document not found." << std::endl;
     return AppState::USERLEVEL_OPERATOR;
   }
 }
@@ -687,7 +687,7 @@ void Base_DB::get_table_fields_to_show_for_sequence_add_group(const Glib::ustrin
 
   if(vecFields.empty())
   {
-    //g_warning("Box_Data::get_table_fields_to_show_for_sequence_add_group(): Returning empty list.");
+    //std::cerr << G_STRFUNC << ": Returning empty list." << std::endl;
   }
 }
 
@@ -769,7 +769,7 @@ Base_DB::type_vecConstLayoutFields Base_DB::get_table_fields_to_show_for_sequenc
 
   if(result.empty())
   {
-    //g_warning("Box_Data::get_table_fields_to_show_for_sequence_add_group(): Returning empty list.");
+    //std::cerr << G_STRFUNC << ": Returning empty list." << std::endl;
   }
 
   return result;
@@ -823,7 +823,7 @@ void Base_DB::calculate_field_in_all_records(const Glib::ustring& table_name, co
 void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
 {
   const Glib::ustring field_name = field_in_record.m_field->get_name();
-  //g_warning("Box_Data::calculate_field(): field_name=%s", field_name.c_str());
+  //std::cerr << G_STRFUNC << ": field_name=" << field_name << std::endl;
 
   //Do we already have this in our list?
   type_field_calcs::iterator iterFind = m_FieldsCalculationInProgress.find(field_name);
@@ -842,18 +842,18 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
   //Use the previously-calculated value if possible:
   if(refCalcProgress.m_calc_in_progress)
   {
-    //g_warning("  Box_Data::calculate_field(): Circular calculation detected. field_name=%s", field_name.c_str());
+    //std::cerr << G_STRFUNC << ": Circular calculation detected. field_name=" << field_name << std::endl;
     //refCalcProgress.m_value = Conversions::get_empty_value(field->get_glom_type()); //Give up.
   }
   else if(refCalcProgress.m_calc_finished)
   {
-    //g_warning("  Box_Data::calculate_field(): Already calculated.");
+    //std::cerr << G_STRFUNC << ": Already calculated." << std::endl;
 
     //Don't bother calculating it again. The correct value is already in the database and layout.
   }
   else
   {
-    //g_warning("  Box_Data::calculate_field(): setting calc_in_progress: field_name=%s", field_name.c_str());
+    //std::cerr << G_STRFUNC << ": setting calc_in_progress: field_name=" << field_name << std::endl;
 
     refCalcProgress.m_calc_in_progress = true; //Let the recursive calls to calculate_field() check this.
 
@@ -1107,7 +1107,7 @@ bool Base_DB::set_field_value_in_database(const LayoutFieldInRecord& layoutfield
     //Prevent circular calculations during the recursive do_calculations:
     {
       //Recalculate any calculated fields that depend on this calculated field.
-      //g_warning("Box_Data::set_field_value_in_database(): calling do_calculations");
+      //std::cerr << G_STRFUNC << ": calling do_calculations" << std::endl;
 
       do_calculations(layoutfield_in_record, !use_current_calculations);
     }
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index a0ba65c..9e7b74c 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -336,7 +336,7 @@ bool Base_DB_Table_Data::add_related_record_for_field(const sharedptr<const Layo
         sharedptr<Field> parent_primary_key_field = get_field_primary_key();
         if(!parent_primary_key_field)
         {
-          g_warning("Base_DB_Table_Data::add_related_record_for_field(): get_field_primary_key() failed. table = %s", get_table_name().c_str());
+          std::cerr << G_STRFUNC << ": get_field_primary_key() failed. table = " << get_table_name() << std::endl;
           return false;
         }
         else
@@ -344,7 +344,7 @@ bool Base_DB_Table_Data::add_related_record_for_field(const sharedptr<const Layo
           const Gnome::Gda::Value parent_primary_key_value = get_primary_key_value_selected();
           if(parent_primary_key_value.is_null())
           {
-            g_warning("Base_DB_Table_Data::add_related_record_for_field(): get_primary_key_value_selected() failed. table = %s", get_table_name().c_str());
+            std::cerr << G_STRFUNC << ": get_primary_key_value_selected() failed. table = " << get_table_name() << std::endl;
             return false;
           }
           else
diff --git a/glom/box_reports.cc b/glom/box_reports.cc
index 8cffb5e..cf15493 100644
--- a/glom/box_reports.cc
+++ b/glom/box_reports.cc
@@ -26,6 +26,8 @@
 #include <gtkmm/messagedialog.h>
 #include <glibmm/i18n.h>
 
+#include <iostream>
+
 namespace Glom
 {
 
@@ -113,7 +115,7 @@ bool Box_Reports::fill_from_database()
     }
    }
   else
-    g_warning("Box_Reports::fill_from_database(): document is null");
+    std::cerr << G_STRFUNC << ": document is null" << std::endl;
 
   //TODO:
 
diff --git a/glom/dialog_connection.cc b/glom/dialog_connection.cc
index 89bd102..7e30d7a 100644
--- a/glom/dialog_connection.cc
+++ b/glom/dialog_connection.cc
@@ -29,6 +29,8 @@
 #include <libglom/connectionpool_backends/postgres_self.h>
 #endif //#ifdef GLOM_ENABLE_POSTGRESQL
 
+#include <iostream>
+
 namespace Glom
 {
 
@@ -170,7 +172,7 @@ void Dialog_Connection::load_from_document()
     set_database_name(document->get_connection_database());
   }
   else
-    g_warning("Dialog_Connection::load_from_document(): no document");
+    std::cerr << G_STRFUNC << ": no document" << std::endl;
 
 }
 
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index 0c7b719..bc99d56 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -2039,7 +2039,7 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
     }
     catch(const ExceptionConnection& ex)
     {
-      //g_warning("Frame_Glom::connection_request_password_and_choose_new_database_name(): caught exception.");
+      //std::cerr << G_STRFUNC << ": caught exception." << std::endl;
 
       if(ex.get_failure_type() == ExceptionConnection::FAILURE_NO_SERVER)
       {
@@ -2107,7 +2107,7 @@ void Frame_Glom::cleanup_connection()
 
 bool Frame_Glom::handle_request_password_connection_error(bool asked_for_password, const ExceptionConnection& ex, bool& database_not_found)
 {
-  g_warning("Frame_Glom::connection_request_password_and_attempt(): caught exception.");
+  std::cerr << G_STRFUNC << ": caught exception." << std::endl;
 
   //Initialize input parameter:
   database_not_found = false;
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index cc29f1b..eaa2834 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -383,7 +383,7 @@ sharedptr<SharedConnection> ConnectionPool::connect()
   }
   else
   {
-    //g_warning("ConnectionPool::connect(): not ready to connect.");
+    //std::cerr << G_STRFUNC << ": not ready to connect." << std::endl;
   }
 
   return sharedptr<SharedConnection>(0);
@@ -545,7 +545,7 @@ void ConnectionPool::on_sharedconnection_finished()
   {
     //There should be no copies of the m_refConnection, so the Gnome::Gda::Connection destructor should
     //run when we clear this last RefPtr of it, but we will explicitly close it just in case.
-    //g_warning("ConnectionPool::on_sharedconnection_finished(): closing GdaConnection");
+    //std::cerr << G_STRFUNC << ": closing GdaConnection" << std::endl;
     m_refGdaConnection->close();
 
     m_refGdaConnection.reset();
diff --git a/glom/libglom/data_structure/field.cc b/glom/libglom/data_structure/field.cc
index af23c7d..2fcb199 100644
--- a/glom/libglom/data_structure/field.cc
+++ b/glom/libglom/data_structure/field.cc
@@ -194,7 +194,7 @@ void Field::set_field_info(const Glib::RefPtr<Gnome::Gda::Column>& fieldinfo)
 
     if(!value.is_null() && value.get_value_type() != cur_type)
     {
-      g_warning("Field::set_field_info: New field's default value type (%s) does not match field type (%s). Resetting default value.", g_type_name(value.get_value_type()), g_type_name(get_gda_type_for_glom_type(get_glom_type())));
+      std::cerr << G_STRFUNC << ": New field's default value type (" << g_type_name(value.get_value_type()) << " does not match field type (" << g_type_name(get_gda_type_for_glom_type(get_glom_type())) << "). Resetting default value." << std::endl;
       m_field_info->set_default_value(Gnome::Gda::Value());
     }
   }
@@ -228,7 +228,7 @@ bool Field::get_is_lookup() const
 
 Glib::ustring Field::sql(const Gnome::Gda::Value& value, const Glib::RefPtr<Gnome::Gda::Connection>& connection) const
 {
-  //g_warning("Field::sql: glom_type=%d", get_glom_type());
+  //std::cout << ": glom_type=" << get_glom_type() << std::endl;
 
   if(value.is_null() && (get_glom_type() == TYPE_TEXT))
   {
@@ -531,7 +531,7 @@ void Field::set_default_value(const Gnome::Gda::Value& value)
   if(value.is_null() || value.get_value_type() == cur_type)
     m_field_info->set_default_value(value);
   else
-    g_warning("Field::set_default_value: Cannot set incompatible default value: Default value has type %s, but field has type %s", g_type_name(value.get_value_type()), g_type_name(get_gda_type_for_glom_type(get_glom_type())));
+    std::cerr << G_STRFUNC << ": Cannot set incompatible default value: Default value has type " << g_type_name(value.get_value_type()) << ", but field has type " << g_type_name(get_gda_type_for_glom_type(get_glom_type())) << std::endl;
 }
 
 Glib::ustring Field::get_sql_type() const
@@ -562,7 +562,7 @@ Glib::ustring Field::get_sql_type() const
 
     if(strType == "unknowntype")
     {
-      g_warning("Field::get_sql_type(): returning unknowntype for field name=%s , glom_type=%d, gda_type=%d", get_name().c_str(), get_glom_type(), (int)m_field_info->get_g_type());
+      std::cerr << G_STRFUNC << ": returning unknowntype for field name=" << get_name() << ", glom_type=" << get_glom_type() << ", gda_type=" << (int)m_field_info->get_g_type() << std::endl;
     }
 
     return strType;
@@ -648,7 +648,7 @@ GType Field::get_gda_type_for_glom_type(Field::glom_field_type glom_type)
 
   if(ideal_gda_type == G_TYPE_NONE)
   {
-    g_warning("Field::get_gda_type_for_glom_type(): Returning G_TYPE_NONE for glom_type=%d", glom_type);
+    std::cerr << G_STRFUNC << ": Returning G_TYPE_NONE for glom_type=" << glom_type << std::endl;
   }
 
   //std::cout << "debug: " << G_STRFUNC << ": returning: " << g_type_name(ideal_gda_type) << std::endl;
diff --git a/glom/libglom/data_structure/fieldtypes.cc b/glom/libglom/data_structure/fieldtypes.cc
index 8b3c981..1466cc0 100644
--- a/glom/libglom/data_structure/fieldtypes.cc
+++ b/glom/libglom/data_structure/fieldtypes.cc
@@ -206,12 +206,12 @@ Glib::ustring FieldTypes::get_string_name_for_gdavaluetype(GType field_type) con
     if(iterFallback != m_mapFallbackTypes.end())
       return get_string_name_for_gdavaluetype(iterFallback->second);
 
-    g_warning("FieldTypes::get_string_name_for_gdavaluetype(): returning unknowntype for field_type=%ld (%s)", static_cast<long>(field_type), g_type_name(field_type));
+    std::cerr << G_STRFUNC << ": returning unknowntype for field_type=" << field_type << " (" << g_type_name(field_type) << ")" << std::endl;
 
-    g_warning("  possible types are: ");
+    std::cerr << "  possible types are: " << std::endl;
     for(type_mapGdaTypesToSchemaStrings::const_iterator iter = m_mapGdaTypesToSchemaStrings.begin(); iter != m_mapGdaTypesToSchemaStrings.end(); ++iter)
     {
-      g_warning("    gdatype=%ld (%s), sqltype=%s", static_cast<long>(iter->first), g_type_name(iter->first), iter->second.c_str());
+      std::cerr << "    gdatype=" << iter->first << " (" << g_type_name(iter->first) << "), sqltype=" << iter->second << std::endl;
     }
     
     return "unknowntype";
diff --git a/glom/libglom/data_structure/glomconversions.cc b/glom/libglom/data_structure/glomconversions.cc
index 5af74e1..824a0f5 100644
--- a/glom/libglom/data_structure/glomconversions.cc
+++ b/glom/libglom/data_structure/glomconversions.cc
@@ -257,7 +257,7 @@ Glib::ustring Conversions::format_tm(const tm& tm_data, const std::locale& local
   while((bufsize *= 2) <= 65536);
 
   // This error is quite unlikely (unless strftime is buggy).
-  g_warning("Conversions::format_time(): maximum size of strftime buffer exceeded, giving up");
+  std::cerr << G_STRFUNC << ": maximum size of strftime buffer exceeded. Giving up." << std::endl;
 
   return Glib::ustring();
   */
diff --git a/glom/libglom/data_structure/layout/fieldformatting.cc b/glom/libglom/data_structure/layout/fieldformatting.cc
index 7696e8b..ae6f358 100644
--- a/glom/libglom/data_structure/layout/fieldformatting.cc
+++ b/glom/libglom/data_structure/layout/fieldformatting.cc
@@ -111,7 +111,7 @@ FieldFormatting& FieldFormatting::operator=(const FieldFormatting& src)
   m_text_color_background = src.m_text_color_background;
   m_horizontal_alignment = src.m_horizontal_alignment;
 
-//g_warning("FieldFormatting::operator=: m_choices_related_relationship=%s, src.m_choices_related_relationship=%s", m_choices_related_relationship->c_str(), src.m_choices_related_relationship->c_str());
+  //std::cerr << G_STRFUNC << ": m_choices_related_relationship=" << m_choices_related_relationship << ", src.m_choices_related_relationship=" << src.m_choices_related_relationship << std::endl;
   return *this;
 }
 
diff --git a/glom/libglom/data_structure/layout/layoutitem_field.cc b/glom/libglom/data_structure/layout/layoutitem_field.cc
index 3ec9777..00a57a0 100644
--- a/glom/libglom/data_structure/layout/layoutitem_field.cc
+++ b/glom/libglom/data_structure/layout/layoutitem_field.cc
@@ -44,7 +44,7 @@ LayoutItem_Field::LayoutItem_Field(const LayoutItem_Field& src)
   m_formatting_use_default(src.m_formatting_use_default),
   m_title_custom(src.m_title_custom)
 {
-//g_warning("LayoutItem_Field::LayoutItem_Field: m_choices_related_relationship=%s, src.m_choices_related_relationship=%s", m_choices_related_relationship.c_str(), src.m_choices_related_relationship.c_str());
+//std::cerr << G_STRFUNC << ": m_choices_related_relationship=" << m_choices_related_relationship << ", src.m_choices_related_relationship=" << src.m_choices_related_relationship << std::endl;
 
   m_field = src.m_field;
 }
diff --git a/glom/libglom/data_structure/layout/usesrelationship.cc b/glom/libglom/data_structure/layout/usesrelationship.cc
index 91f7b28..9928c31 100644
--- a/glom/libglom/data_structure/layout/usesrelationship.cc
+++ b/glom/libglom/data_structure/layout/usesrelationship.cc
@@ -205,7 +205,7 @@ Glib::ustring UsesRelationship::get_sql_join_alias_name() const
     const Glib::ustring field_table_name = relationship->get_to_table();
     if(field_table_name.empty())
     {
-      g_warning("get_sql_join_alias_name(): field_table_name is null. relationship name = %s", relationship->get_name().c_str());
+      std::cerr << G_STRFUNC << ": field_table_name is null. relationship name = " << relationship->get_name() << std::endl;
     }
     */
 
diff --git a/glom/libglom/document/bakery/document_xml.cc b/glom/libglom/document/bakery/document_xml.cc
index 857d455..b4f7946 100644
--- a/glom/libglom/document/bakery/document_xml.cc
+++ b/glom/libglom/document/bakery/document_xml.cc
@@ -51,7 +51,7 @@ bool Document_XML::load_after(int& failure_code)
     //m_DOM_Parser.setDoValidation(true);
 
     if(m_strContents.empty())
-      g_warning("Document_XML::load_after(): parsing empty document.");
+      std::cerr << G_STRFUNC << ": parsing empty document." << std::endl;
 
     m_DOM_Parser.parse_memory(m_strContents);
     m_pDOM_Document = m_DOM_Parser.get_document();
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index 4e61606..efd4977 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -352,7 +352,7 @@ std::string Document::get_connection_self_hosted_directory_uri() const
   const std::string uri_file = get_file_uri();
   if(uri_file.empty())
   {
-    g_warning("Document::get_connection_self_hosted_directory_uri(): file_uri is empty.");
+    std::cerr << G_STRFUNC << ": file_uri is empty." << std::endl;
     return std::string();
   }
   else
@@ -386,7 +386,7 @@ std::string Document::get_connection_self_hosted_directory_uri() const
     }
   }
 
-  g_warning("Document::get_connection_self_hosted_directory_uri(): returning empty string.");
+  std::cerr << G_STRFUNC << ": returning empty string." << std::endl;
   return std::string();
 }
 
@@ -865,13 +865,13 @@ Document::type_vec_fields Document::get_table_fields(const Glib::ustring& table_
       }
       else
       {
-        //g_warning("Document::get_table_fields: table not found in document: %s", table_name.c_str());
+        //std::cerr << G_STRFUNC << ": table not found in document: " << table_name << std::endl;
       }
     }
   }
   else
   {
-    //g_warning("Document::get_table_fields: table name is empty.");
+    //std::cerr << G_STRFUNC << ": table name is empty." << std::endl;
   }
 
   //Hide any system fields:
@@ -888,7 +888,7 @@ void Document::set_table_fields(const Glib::ustring& table_name, const type_vec_
   {
     if(vecFields.empty())
     {
-      g_warning("Document::set_table_fields(): vecFields is empty: table_name=%s", table_name.c_str());
+      std::cerr << ": vecFields is empty: table_name=" << table_name << std::endl;
     }
 
     DocumentTableInfo& info = get_table_info_with_add(table_name);
@@ -1698,7 +1698,7 @@ void Document::set_data_layout_groups(const Glib::ustring& layout_name, const Gl
   //std::cout << "debug: " << G_STRFUNC << ": layout_name=" << layout_name << ", parent_table_name=" << parent_table_name << ", layout_platform=" << layout_platform << std::endl;
   const Glib::ustring child_table_name = parent_table_name; //TODO: Remove this cruft.
 
-  //g_warning("Document::set_data_layout_groups(): ADDING layout for table %s (child_table=%s), for layout %s", parent_table_name.c_str(), child_table_name.c_str(), layout_name.c_str());
+  //std::cerr << G_STRFUNC << ": ADDING layout for table " << parent_table_name << " (child_table=" << child_table_name << "), for layout " << layout_name << std::endl;
 
 
   if(!parent_table_name.empty())
@@ -2268,7 +2268,7 @@ void Document::load_after_layout_group(const xmlpp::Element* node, const Glib::u
 {
   if(!node || !group)
   {
-    //g_warning("Document::load_after_layout_group(): node is NULL");
+    //std::cerr << G_STRFUNC << ": node is NULL" << std::endl;
     return;
   }
 
@@ -3778,7 +3778,7 @@ bool Document::save_before()
 
       const Glib::ustring table_name = doctableinfo.m_info->get_name();
       if(table_name.empty())
-        g_warning("Document::save_before(): table name is empty.");
+        std::cerr << G_STRFUNC << ": table name is empty." << std::endl;
 
       if(!table_name.empty())
       {
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index 0706f40..d2a2585 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -70,7 +70,7 @@ boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object&
   sharedptr<const Field> field = m_document->get_field(m_relationship->get_to_table(), field_name);
   if(!field)
   {
-    g_warning("PyGlomRelatedRecord::setitem(): field %s not found in table %s", field_name.c_str(), m_relationship->get_to_table().c_str());
+    std::cerr << G_STRFUNC << ": field " << field_name << " not found in table " << m_relationship->get_to_table() << std::endl;
     PyErr_SetString(PyExc_IndexError, "field not found");
     return boost::python::object();
   }
@@ -134,7 +134,7 @@ boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object&
     }
     else if(!datamodel)
     {
-      g_warning("PyGlomRelatedRecord::setitem()(): The datamodel was null.");
+      std::cerr << G_STRFUNC << ": The datamodel was null." << std::endl;
       ConnectionPool::handle_error_cerr_only();
       RelatedRecord_HandlePythonError();
     }
@@ -144,7 +144,7 @@ boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object&
     }
   }
 
-  g_warning("PyGlomRelatedRecord::setitem()(): return null.");
+  std::cerr << G_STRFUNC << ": return null." << std::endl;
   return boost::python::object();
 }
 
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index b2d1abf..57ccfbf 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -284,7 +284,7 @@ void Box_Data_Calendar_Related::on_record_added(const Gnome::Gda::Value& primary
   }
   else if(Conversions::value_is_empty(m_key_value))
   {
-    g_warning("Box_Data_Calendar_Related::on_record_added(): m_key_value is NULL.");
+    std::cerr << G_STRFUNC << ": m_key_value is NULL." << std::endl;
   }
   else
   {
diff --git a/glom/mode_data/box_data_details.cc b/glom/mode_data/box_data_details.cc
index b0dd406..8a8189c 100644
--- a/glom/mode_data/box_data_details.cc
+++ b/glom/mode_data/box_data_details.cc
@@ -761,7 +761,7 @@ void Box_Data_Details::on_flowtable_field_edited(const sharedptr<const LayoutIte
         }
         else
         {
-          g_warning("Box_Data_Details::on_flowtable_field_edited(): key not found for edited related field.");
+          std::cerr << G_STRFUNC << ": key not found for edited related field." << std::endl;
         }
       }
     }
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index 8ef72bf..6038c9f 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -278,7 +278,7 @@ void Box_Data_List_Related::on_adddel_record_added(const Gtk::TreeModel::iterato
   }
   else if(Conversions::value_is_empty(m_key_value))
   {
-    g_warning("Box_Data_List_Related::on_adddel_record_added(): m_key_value is NULL.");
+    std::cerr << G_STRFUNC << ": m_key_value is NULL." << std::endl;
   }
   else
   {
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index 5d7380b..12f2aef 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -136,7 +136,7 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
       }
       else
       {
-        g_warning("DataWidget::DataWidget(): Unexpected choice type.");
+        std::cerr << G_STRFUNC << ": Unexpected choice type." << std::endl;
       }
 
       pFieldWidget = combo;
diff --git a/glom/mode_data/datawidget/treemodel_db.cc b/glom/mode_data/datawidget/treemodel_db.cc
index 2db89dd..4967e30 100644
--- a/glom/mode_data/datawidget/treemodel_db.cc
+++ b/glom/mode_data/datawidget/treemodel_db.cc
@@ -96,7 +96,7 @@ void DbTreeModelRow::fill_values_if_necessary(DbTreeModel& model, int row)
     }
     else
     {
-      //g_warning("DbTreeModelRow::fill_values_if_necessary(): Non-db row.");
+      //std::cerr << G_STRFUNC << ": Non-db row." << std::endl;
       if(m_extra)
       {
         //std::cout << "debug: " << G_STRFUNC << ": using default value" << std::endl;
@@ -677,7 +677,7 @@ bool DbTreeModel::create_iterator(const type_datamodel_row_index& datamodel_row,
 
 bool DbTreeModel::get_iter_vfunc(const Path& path, iterator& iter) const
 {
-  //g_warning("DbTreeModel::get_iter_vfunc(): path=%s", path.to_string().c_str());
+   //std::cout << ": path=" << path << std::endl;
 
    unsigned sz = path.size();
    if(!sz)
@@ -725,12 +725,12 @@ int DbTreeModel::get_internal_rows_count() const
 DbTreeModel::iterator DbTreeModel::append()
 {
   //const size_type existing_size = m_data_model_rows_count;
-  //g_warning("DbTreeModel::append(): existing_size = %d", existing_size);
+  //std::cerr << G_STRFUNC << ": existing_size = " << existing_size << std::endl;
   //m_rows.resize(existing_size + 1);
 
   //Get aniterator to the last element:
   type_datamodel_row_index datamodel_row = get_internal_rows_count();
-  //g_warning("DbTreeModel::append(): new row number=%d", datamodel_row);
+  //std::cerr << G_STRFUNC << ": new row number=" << datamodel_row << std::endl;
   ++m_count_extra_rows; //So that create_iterator() can succeed.
 
   //Create the row:
@@ -776,7 +776,7 @@ void DbTreeModel::set_value_impl(const iterator& row, int column, const Glib::Va
 
     const ValueDbValue* pDbValue = static_cast<const ValueDbValue*>(&value);
     if(!pDbValue)
-      g_warning("DbTreeModel::set_value_impl(): value is not a Value< DbValue >.");
+      std::cerr << G_STRFUNC << ": value is not a Value< DbValue >." << std::endl;
     else
     {
       DbTreeModelRow& row_details = m_map_rows[datamodel_row]; //Adds it if necessary.
@@ -942,7 +942,7 @@ Gtk::TreeModel::iterator DbTreeModel::get_placeholder_row()
         --row;
       else
       {
-        g_warning("bTreeModel::get_placeholder_row(): Placeholder row not found.");
+        std::cerr << G_STRFUNC << ": Placeholder row not found." << std::endl;
         return result; //failed, because there are no non-removed rows.
       }
     }
@@ -950,7 +950,7 @@ Gtk::TreeModel::iterator DbTreeModel::get_placeholder_row()
     type_map_rows::const_iterator iter_map = m_map_rows.find(row);
     if(iter_map != m_map_rows.end())
     {
-      //g_warning("DbTreeModel::get_last_row(): returning row=%d", row);
+      //std::cerr << G_STRFUNC << ": returning row=" << row << std::endl;
       create_iterator(row, result);
     }
   }
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 0be2f00..f5f6b87 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -1969,7 +1969,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
             pDerived->property_pixbuf() = pixbuf;
           }
           else
-            g_warning("Field::sql(): glom_type is TYPE_IMAGE but gda type is not VALUE_TYPE_BINARY");
+            std::cerr << G_STRFUNC << ": glom_type is TYPE_IMAGE but gda type is not VALUE_TYPE_BINARY" << std::endl;
 
           break;
         }
@@ -2211,7 +2211,7 @@ void DbAddDel::user_changed(const Gtk::TreeModel::iterator& row, guint col)
           }
           else
           {
-            g_warning("Box_Data_List::on_flowtable_field_edited(): key not found for edited related field.");
+            std::cerr << G_STRFUNC << ": key not found for edited related field." << std::endl;
           }
         }
       }
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index ad7eaaa..359f4e7 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -740,7 +740,7 @@ void FlowTableWithFields::set_field_value(const sharedptr<const LayoutItem_Field
     Box_Data_Portal* portal = *iter;
     if(portal)
     {
-      //g_warning("FlowTableWithFields::set_field_value: foreign_key_value=%s", value.to_string().c_str());
+      //std::cerr << G_STRFUNC << ": foreign_key_value=" << value.to_string() << std::endl;
       portal->refresh_data_from_database_with_foreign_key(value /* foreign key value */);
     }
   }
@@ -752,7 +752,7 @@ void FlowTableWithFields::set_field_value(const sharedptr<const LayoutItem_Field
     DataWidgetChildren::ComboChoices* widget = *iter;
     if(widget)
     {
-      //g_warning("FlowTableWithFields::set_field_value: foreign_key_value=%s", value.to_string().c_str());
+      //std::cerr << G_STRFUNC << ": foreign_key_value=" << value.to_string() << std::endl;
       widget->refresh_data_from_database_with_foreign_key(get_document(), value /* foreign key value */);
     }
   }
@@ -778,7 +778,7 @@ Gnome::Gda::Value FlowTableWithFields::get_field_value(const sharedptr<const Lay
       return value;
   }
 
-  //g_warning("FlowTableWithFields::get_field_value(): returning null");
+  //std::cerr << G_STRFUNC << ": returning null" << std::endl;
   return Gnome::Gda::Value(); //null.
 }
 
diff --git a/glom/mode_design/dialog_initial_password.cc b/glom/mode_design/dialog_initial_password.cc
index 4a58dea..3ede566 100644
--- a/glom/mode_design/dialog_initial_password.cc
+++ b/glom/mode_design/dialog_initial_password.cc
@@ -72,7 +72,7 @@ void Dialog_InitialPassword::load_from_document()
     m_entry_user->set_text(user);
   }
   else
-    g_warning("Dialog_InitialPassword::load_from_document(): no document");
+    std::cerr << G_STRFUNC << ": no document" << std::endl;
 
 }
 
diff --git a/glom/mode_design/fields/box_db_table_definition.cc b/glom/mode_design/fields/box_db_table_definition.cc
index f13223e..e70c4ec 100644
--- a/glom/mode_design/fields/box_db_table_definition.cc
+++ b/glom/mode_design/fields/box_db_table_definition.cc
@@ -672,7 +672,7 @@ bool Box_DB_Table_Definition::field_has_non_unique_values(const sharedptr<const
   }
   else
   {
-    g_warning("Box_DB_Table_Definition::field_has_non_unique_values(): SELECT COUNT() failed.");
+    std::cerr << G_STRFUNC << ": SELECT COUNT() failed." << std::endl;
   }
 
   //Count all rows, to compare. TODO_performance: Is there a more efficient way to do this? Maybe count(*), which apparently doesn't ignore NULL rows like count(somefield) would.
@@ -689,7 +689,7 @@ bool Box_DB_Table_Definition::field_has_non_unique_values(const sharedptr<const
   }
   else
   {
-    g_warning("Box_DB_Table_Definition::field_has_non_unique_values(): SELECT COUNT() failed.");
+    std::cerr << G_STRFUNC << ": SELECT COUNT() failed." << std::endl;
   }
 
 
diff --git a/glom/mode_design/layout/dialog_choose_field.cc b/glom/mode_design/layout/dialog_choose_field.cc
index fb51a6b..ef763c3 100644
--- a/glom/mode_design/layout/dialog_choose_field.cc
+++ b/glom/mode_design/layout/dialog_choose_field.cc
@@ -23,6 +23,8 @@
 //#include <libgnome/gnome-i18n.h>
 #include <glibmm/i18n.h>
 
+#include <iostream>
+
 namespace Glom
 {
 
@@ -131,12 +133,12 @@ void Dialog_ChooseField::set_document(Document* document, const Glib::ustring& t
 
   if(!m_document)
   {
-    g_warning("Dialog_ChooseField::set_document(): document is null");
+    std::cerr << G_STRFUNC << ": document is null" << std::endl;
   }
 
   if(table_name.empty())
   {
-    g_warning("Dialog_ChooseField::set_document(): table_name is empty");
+    std::cerr << G_STRFUNC << ": table_name is empty" << std::endl;
   }
   
   Glib::RefPtr<Gtk::TreeView::Selection> selection = m_treeview->get_selection();
diff --git a/glom/mode_design/layout/layout_item_dialogs/combo_summarytype.cc b/glom/mode_design/layout/layout_item_dialogs/combo_summarytype.cc
index 9b35735..40b6c01 100644
--- a/glom/mode_design/layout/layout_item_dialogs/combo_summarytype.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/combo_summarytype.cc
@@ -21,6 +21,8 @@
 #include "combo_summarytype.h"
 #include <glibmm/i18n.h>
 
+#include <iostream>
+
 namespace Glom
 {
 
@@ -66,7 +68,7 @@ void Combo_SummaryType::set_summary_type(LayoutItem_FieldSummary::summaryType su
     }
   }
 
-  g_warning("Combo_SummaryType::set_summary_type(): no item found");
+  std::cerr << G_STRFUNC << ": no item found" << std::endl;
 
   //Not found, so mark it as blank:
   unset_active();
diff --git a/glom/mode_design/print_layouts/box_print_layouts.cc b/glom/mode_design/print_layouts/box_print_layouts.cc
index 53fa146..02ab914 100644
--- a/glom/mode_design/print_layouts/box_print_layouts.cc
+++ b/glom/mode_design/print_layouts/box_print_layouts.cc
@@ -26,6 +26,8 @@
 #include <libglom/utils.h> //For bold_message()).
 #include <glibmm/i18n.h>
 
+#include <iostream>
+
 namespace Glom
 {
 
@@ -113,7 +115,7 @@ bool Box_Print_Layouts::fill_from_database()
     }
    }
   else
-    g_warning("Box_Print_Layouts::fill_from_database(): document is null");
+    std::cerr << G_STRFUNC << ": document is null" << std::endl;
 
   //TODO:
 
diff --git a/glom/navigation/box_tables.cc b/glom/navigation/box_tables.cc
index a11a3d2..130e16c 100644
--- a/glom/navigation/box_tables.cc
+++ b/glom/navigation/box_tables.cc
@@ -151,7 +151,7 @@ bool Box_Tables::fill_from_database()
     listTablesDocument = document->get_tables();
   }
   else
-    g_warning("Box_Tables::fill_from_database(): document is null");
+    std::cerr << G_STRFUNC << ": document is null" << std::endl;
 
   //Get the list of tables in the database, from the server:
   sharedptr<SharedConnection> sharedconnection = connect_to_server(AppWindow::get_appwindow());
diff --git a/glom/utility_widgets/adddel/adddel.cc b/glom/utility_widgets/adddel/adddel.cc
index 13c9a81..9baf215 100644
--- a/glom/utility_widgets/adddel/adddel.cc
+++ b/glom/utility_widgets/adddel/adddel.cc
@@ -769,7 +769,7 @@ void AddDel::set_value(const Gtk::TreeModel::iterator& iter, guint col, const Gn
   {
     case(AddDelColumnInfo::STYLE_Boolean):
     {
-      g_warning("AddDel::set_value(): boolean column being set as bool.");
+      std::cerr << G_STRFUNC << ": boolean column being set as bool." << std::endl;
       set_value(iter, col, value.get_bool());
       break;
     }
@@ -787,7 +787,7 @@ void AddDel::set_value(const Gtk::TreeModel::iterator& iter, guint col, const Gl
   InnerIgnore innerIgnore(this);
 
   if(!m_refListStore)
-    g_warning("AddDel::set_value: No model.");
+    std::cerr << G_STRFUNC << ": No model." << std::endl;
   else
   {
     Gtk::TreeModel::Row treerow = *iter;
@@ -837,7 +837,7 @@ void AddDel::set_value(const Gtk::TreeModel::iterator& iter, guint col, bool bVa
   InnerIgnore innerIgnore(this);
 
   if(!m_refListStore)
-    g_warning("AddDel::set_value: No model.");
+    std::cerr << G_STRFUNC << ": No model." << std::endl;
   else
   {
     Gtk::TreeModel::Row treerow = *iter;
diff --git a/glom/utils_ui.cc b/glom/utils_ui.cc
index 9903c6e..b5192bf 100644
--- a/glom/utils_ui.cc
+++ b/glom/utils_ui.cc
@@ -236,7 +236,7 @@ Glib::RefPtr<Gdk::Pixbuf> Utils::get_pixbuf_for_gda_value(const Gnome::Gda::Valu
       {
         buffer_binary_length = 0;
         buffer_binary = 0;
-        g_warning("Conversions::get_pixbuf_for_gda_value(): Failed to read BLOB data");
+        std::cerr << G_STRFUNC << ": Failed to read BLOB data" << std::endl;
       }
     }
     else
@@ -279,7 +279,7 @@ Glib::RefPtr<Gdk::Pixbuf> Utils::get_pixbuf_for_gda_value(const Gnome::Gda::Valu
 
         catch(const Glib::Exception& ex)
         {
-          g_warning("Conversions::get_pixbuf_for_gda_value(): PixbufLoader::write() failed: %s", ex.what().c_str());
+          std::cerr << G_STRFUNC << ": PixbufLoader::write() failed: " << ex.what() << std::endl;
         }
       }
 



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