[glom] Related Records: Do not try to navigate to an empty record.



commit 83195e2ead507c5c997a55908dbaa4eee62d67cf
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Sep 26 09:53:27 2011 +0200

    Related Records: Do not try to navigate to an empty record.
    
    * glom/mode_data/box_data_list_related.cc: on_adddel_user_requested_edit():
    Ignore clicks on the open button of the empty placeholder row, whose
    primary key is null.

 ChangeLog                               |    6 ++++++
 glom/mode_data/box_data_list_related.cc |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index da2fbe3..68089c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-26  Murray Cumming  <murrayc murrayc-desktop>
+
+	reviewed by: <delete if not using a buddy>
+
+	* glom/mode_data/box_data_list_related.cc:
+
 2011-09-22  Murray Cumming  <murrayc murrayc com>
 
 	Print Layout: Add an Align menu.
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index 574eabe..1b61f7a 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -176,8 +176,12 @@ void Box_Data_List_Related::on_adddel_user_requested_edit(const Gtk::TreeModel::
   //Note that this is really an Open rather than an Edit.
 
   const Gnome::Gda::Value primary_key_value = m_AddDel.get_value_key(row); //The primary key is in the key.
-  //std::cout << "debug: " << G_STRFUNC << ": Requesting edit for primary_key=" << primary_key_value.to_string() << std::endl;
-  signal_user_requested_details().emit(primary_key_value);
+  
+  if(!Conversions::value_is_empty(primary_key_value))
+  {
+    //std::cout << "debug: " << G_STRFUNC << ": Requesting edit for primary_key=" << primary_key_value.to_string() << std::endl;
+    signal_user_requested_details().emit(primary_key_value);
+  }
 }
 
 void Box_Data_List_Related::on_adddel_record_changed()



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