glom r1778 - in trunk: . glom



Author: murrayc
Date: Sat Dec  6 18:57:36 2008
New Revision: 1778
URL: http://svn.gnome.org/viewvc/glom?rev=1778&view=rev

Log:
2008-12-06  Murray Cumming  <murrayc murrayc com>

* glom/combobox_fields.cc: on_cell_data_title(): Pass a ustring to
set_property() for the (None) item, so it really shows up.
set_property() cannot handle a char* there, it seems.
For instance, this means that the choices fields can be cleared again.
This regression probably happened when we first ported Glom to Maemo.
Bug found by Arq. Maximiliano MeilÃn.

Modified:
   trunk/ChangeLog
   trunk/glom/combobox_fields.cc

Modified: trunk/glom/combobox_fields.cc
==============================================================================
--- trunk/glom/combobox_fields.cc	(original)
+++ trunk/glom/combobox_fields.cc	Sat Dec  6 18:57:36 2008
@@ -179,6 +179,7 @@
     tree_iter = m_model->append();
     row = *tree_iter;
 
+    std::cout << "DEBUG: ComboBox_Fields::set_fields(): adding none item." << std::endl;
     row[m_model_columns.m_field] = sharedptr<Field>(); 
     row[m_model_columns.m_separator] = true;
   }
@@ -201,14 +202,19 @@
   if(field)
   {
     m_renderer_title->set_property("text", field->get_title_or_name());
-    //m_renderer_title->property_text() = field->get_title_or_name();
+    //m_renderer_title->property_text() = field->get_title_or_name(); //Not available on Maemo.
   }
   else
   {
     // A special "None" item, allowing the user to do the equivalent of clearing the combobox,
     // which is not normally possible with the GtkComboBox UI:
-    m_renderer_title->set_property("text", _("(None)"));
-    //m_renderer_title->property_text() = _("(None)");
+
+    //set_property() does not work with a const gchar*, so we explicitly create a ustring.
+    //otherwise we get this warning:
+    //" unable to set property `text' of type `gchararray' from value of type `glibmm__CustomPointer_Pc' "
+    //TODO: Add a template specialization to Glib::ObjectBase::set_property() to allow this?
+    m_renderer_title->set_property("text", Glib::ustring(_("(None)")));
+    //m_renderer_title->property_text() = _("(None)"); //Not available on Maemo.
   }
 }
 



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