[glom] Fix some clang warnings.



commit a7ce7b7a3340047cf597f68322024bcfe4d2d3a0
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Nov 16 10:29:58 2013 +0100

    Fix some clang warnings.

 glom/mode_design/fields/box_db_table_definition.cc |    8 +++++---
 glom/mode_design/fields/dialog_fielddefinition.cc  |   20 +++++++++++++++-----
 2 files changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/glom/mode_design/fields/box_db_table_definition.cc 
b/glom/mode_design/fields/box_db_table_definition.cc
index 68a3850..cb04877 100644
--- a/glom/mode_design/fields/box_db_table_definition.cc
+++ b/glom/mode_design/fields/box_db_table_definition.cc
@@ -51,9 +51,11 @@ void Box_DB_Table_Definition::init()
   add_view(m_dialog_field_definition); //Give it access to the document.
 
   Utils::get_glade_widget_derived_with_warning(m_dialog_default_formatting);
-  add_view(m_dialog_default_formatting);
-  m_dialog_default_formatting->signal_apply().connect(sigc::mem_fun(*this, 
&Box_DB_Table_Definition::on_field_definition_apply));
-
+  if(m_dialog_default_formatting)
+  {
+    add_view(m_dialog_default_formatting);
+    m_dialog_default_formatting->signal_apply().connect(sigc::mem_fun(*this, 
&Box_DB_Table_Definition::on_field_definition_apply));
+  }
 
   pack_start(m_AddDel);
   m_colName = m_AddDel.add_column(_("Name"));
diff --git a/glom/mode_design/fields/dialog_fielddefinition.cc 
b/glom/mode_design/fields/dialog_fielddefinition.cc
index 9d34886..8e1edd6 100644
--- a/glom/mode_design/fields/dialog_fielddefinition.cc
+++ b/glom/mode_design/fields/dialog_fielddefinition.cc
@@ -65,13 +65,23 @@ Dialog_FieldDefinition::Dialog_FieldDefinition(BaseObjectType* cobject, const Gl
   builder->get_widget("button_edit_calculation",  m_pButton_EditCalculation);
 
   //Connect signals:
+  if(m_pCombo_Type)
   m_pCombo_Type->signal_changed().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_combo_type_changed) );
-  m_pCombo_LookupRelationship->signal_changed().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_combo_lookup_relationship_changed) );
-  m_pCheck_Lookup->signal_toggled().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_check_lookup_toggled) );
 
-  m_pRadio_Calculate->signal_toggled().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_radio_calculate_toggled) );
-  m_pRadio_UserEntry->signal_toggled().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_radio_userentry_toggled) );
-  m_pButton_EditCalculation->signal_clicked().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_button_edit_calculation) );
+  if(m_pCombo_LookupRelationship)
+    m_pCombo_LookupRelationship->signal_changed().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_combo_lookup_relationship_changed) );
+
+  if(m_pCheck_Lookup)
+    m_pCheck_Lookup->signal_toggled().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_check_lookup_toggled) );
+
+  if(m_pRadio_Calculate)
+    m_pRadio_Calculate->signal_toggled().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_radio_calculate_toggled) );
+
+  if(m_pRadio_UserEntry)
+    m_pRadio_UserEntry->signal_toggled().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_radio_userentry_toggled) );
+
+  if(m_pButton_EditCalculation)
+    m_pButton_EditCalculation->signal_clicked().connect( sigc::mem_fun(*this, 
&Dialog_FieldDefinition::on_button_edit_calculation) );
 
   //TODO:
   //Connect every widget to on_anything_changed():


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