glom r1890 - in trunk: . glom/libglom/connectionpool_backends glom/mode_design/fields
- From: arminb svn gnome org
- To: svn-commits-list gnome org
- Subject: glom r1890 - in trunk: . glom/libglom/connectionpool_backends glom/mode_design/fields
- Date: Tue, 10 Feb 2009 18:53:15 +0000 (UTC)
Author: arminb
Date: Tue Feb 10 18:53:15 2009
New Revision: 1890
URL: http://svn.gnome.org/viewvc/glom?rev=1890&view=rev
Log:
2009-02-10 Armin Burgmeier <armin openismus com>
* glom/libglom/connectionpool_backends/sqlite.cc (recreate_table):
Use get_value_type() to find out a value's not type, not get_g_type()
which returns the GType the value stores if it's value type is GType.
* glom/mode_design/fields/box_db_table_definition.cc (on_adddel_add):
Don't call on_adddel_changed() just to store the field into the
document, since on_adddel_changed() does a lot of unnecessary extra
stuff such as calling change_columns() on the backend, which forces a
whole table recreation with SQLite.
Modified:
trunk/ChangeLog
trunk/glom/libglom/connectionpool_backends/sqlite.cc
trunk/glom/mode_design/fields/box_db_table_definition.cc
Modified: trunk/glom/libglom/connectionpool_backends/sqlite.cc
==============================================================================
--- trunk/glom/libglom/connectionpool_backends/sqlite.cc (original)
+++ trunk/glom/libglom/connectionpool_backends/sqlite.cc Tue Feb 10 18:53:15 2009
@@ -287,7 +287,7 @@
if(!trans_fields.empty())
trans_fields += ",";
Gnome::Gda::Value default_value = field->get_default_value();
- if(default_value.get_g_type() != G_TYPE_NONE && !default_value.is_null())
+ if(default_value.get_value_type() != G_TYPE_NONE && !default_value.is_null())
trans_fields += field->sql(default_value, Field::SQL_FORMAT_SQLITE);
else
{
Modified: trunk/glom/mode_design/fields/box_db_table_definition.cc
==============================================================================
--- trunk/glom/mode_design/fields/box_db_table_definition.cc (original)
+++ trunk/glom/mode_design/fields/box_db_table_definition.cc Tue Feb 10 18:53:15 2009
@@ -193,7 +193,21 @@
fill_field_row(row, field);
//Store the generated title in the document:
- on_adddel_changed(row, m_colTitle);
+ //on_adddel_changed(row, m_colTitle);
+
+ // Don't call on_adddel_changed for this, since this does a lot of
+ // unnecessary extra stuff just to get the field added into the
+ // document:
+
+ Document_Glom* pDoc = static_cast<Document_Glom*>(get_document());
+ if(pDoc)
+ {
+ Document_Glom::type_vecFields vecFields = pDoc->get_table_fields(m_table_name);
+ vecFields.push_back(field);
+ pDoc->set_table_fields(m_table_name, vecFields);
+ }
+
+ m_AddDel.select_item(field->get_name(), m_colName, false);
//m_AddDel.select_item(row, m_colTitle, true); //Start editing the title
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]