[glom/glom-1-10] Fixed a crash when Glom was lanuched via LDTP:ChangeLog



commit 395b383d8c27ee56efa497472e30070cecfc3219
Author: Armin Burgmeier <armin openismus com>
Date:   Thu May 28 17:58:25 2009 +0200

    Fixed a crash when Glom was lanuched via LDTP:ChangeLog
    
    * glom/dialog_existing_or_new.cc (constructor): Create the top level
    list elements before setting the cell data func, to avoid the cell
    data func being called before all the list elements have been added.
    This happended when Glom was launched via LDTP, leading to a crash.
---
 ChangeLog                      |    7 +++++++
 glom/dialog_existing_or_new.cc |   36 +++++++++++++++++-------------------
 2 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3535690..7fd1c4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-05-25  Armin Burgmeier  <armin openismus com>
+
+	* glom/dialog_existing_or_new.cc (constructor): Create the top level
+	list elements before setting the cell data func, to avoid the cell
+	data func being called before all the list elements have been added.
+	This happended when Glom was launched via LDTP, leading to a crash.
+	
 2009-05-07 Murray Cumming <murrayc murrayc com>
 
 	Pass some sharedptr&s as const.
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index ffff0d6..7df58e7 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -115,6 +115,23 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
   m_new_model = Gtk::TreeStore::create(m_new_columns);
   m_new_view->set_model(m_new_model);
 
+  m_iter_existing_other = m_existing_model->append();
+  (*m_iter_existing_other)[m_existing_columns.m_col_title] = _("Select File");
+
+#ifndef G_OS_WIN32
+  m_iter_existing_network = m_existing_model->append();
+  (*m_iter_existing_network)[m_existing_columns.m_col_title] = _("Local Network");
+#endif
+
+  m_iter_existing_recent = m_existing_model->append();
+  (*m_iter_existing_recent)[m_existing_columns.m_col_title] = _("Recently Opened");
+  
+  m_iter_new_empty = m_new_model->append();
+  (*m_iter_new_empty)[m_new_columns.m_col_title] = _("New Empty Document");
+
+  m_iter_new_template = m_new_model->append();
+  (*m_iter_new_template)[m_new_columns.m_col_title] = _("New From Template");
+
   m_existing_column_title.set_expand(true);
   m_existing_column_title.pack_start(m_existing_icon_renderer, false);
   m_existing_column_title.pack_start(m_existing_title_renderer, true);
@@ -122,7 +139,6 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
   m_existing_column_title.set_cell_data_func(m_existing_title_renderer, sigc::mem_fun(*this, &Dialog_ExistingOrNew::existing_title_data_func));
   m_existing_view->append_column(m_existing_column_title);
 
-
   m_new_column_title.set_expand(true);
   m_new_column_title.pack_start(m_new_icon_renderer, false);
   m_new_column_title.pack_start(m_new_title_renderer, true);
@@ -135,24 +151,6 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
   m_new_view->set_headers_visible(false);
   m_new_view->signal_row_activated().connect(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_new_row_activated));
 
-  m_iter_existing_other = m_existing_model->append();
-  (*m_iter_existing_other)[m_existing_columns.m_col_title] = _("Select File");
-
-#ifndef G_OS_WIN32
-  m_iter_existing_network = m_existing_model->append();
-  (*m_iter_existing_network)[m_existing_columns.m_col_title] = _("Local Network");
-#endif
-
-  m_iter_existing_recent = m_existing_model->append();
-  (*m_iter_existing_recent)[m_existing_columns.m_col_title] = _("Recently Opened");
-  
-  m_iter_new_empty = m_new_model->append();
-  (*m_iter_new_empty)[m_new_columns.m_col_title] = _("New Empty Document");
-
-  m_iter_new_template = m_new_model->append();
-  (*m_iter_new_template)[m_new_columns.m_col_title] = _("New From Template");
-
-
  // Load example files:
 #ifndef GLOM_ENABLE_CLIENT_ONLY
 



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