[glom] LayoutInfo: Remove the superfluous parent_table.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] LayoutInfo: Remove the superfluous parent_table.
- Date: Tue, 2 Apr 2013 08:12:21 +0000 (UTC)
commit 42c6ba9a89f3ee4295afb755787e6e67158f49f9
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Apr 2 02:13:25 2013 +0200
LayoutInfo: Remove the superfluous parent_table.
* glom/glom/libglom/document/document.[h|cc]:
LayoutInfo: Do not bother storing the parent table here because
these are all stored in a table-specific map anyway.
* glom/glom/glom_document.dtd: Remove the mention of the
parent_table attribute. The parent table node already specifies
it.
* glom/examples/*.glom: Resave these without the parent_table
attributes.
ChangeLog | 13 +++
examples/example_film_manager.glom | 103 ++++++++++++---------
examples/example_lesson_planner.glom | 20 ++--
examples/example_music_collection.glom | 16 ++--
examples/example_project_manager.glom | 20 ++--
examples/example_smallbusiness.glom | 20 ++--
examples/tests/example_field_formatting_test.glom | 8 +-
glom/glom_document.dtd | 3 +-
glom/libglom/document/document.cc | 24 +----
glom/libglom/document/document.h | 1 -
tests/test_document_load_translations.cc | 4 +-
11 files changed, 124 insertions(+), 108 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8312506..df2a599 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2013-04-01 Murray Cumming <murrayc murrayc com>
+ LayoutInfo: Remove the superfluous parent_table.
+
+ * glom/glom/libglom/document/document.[h|cc]:
+ LayoutInfo: Do not bother storing the parent table here because
+ these are all stored in a table-specific map anyway.
+ * glom/glom/glom_document.dtd: Remove the mention of the
+ parent_table attribute. The parent table node already specifies
+ it.
+ * glom/examples/*.glom: Resave these without the parent_table
+ attributes.
+
+2013-04-01 Murray Cumming <murrayc murrayc com>
+
Dialog_FlowTable: Make a getter const.
* glom/utility_widgets/dialog_flowtable.[h|cc]:
diff --git a/examples/example_film_manager.glom b/examples/example_film_manager.glom
index e59f748..a42712f 100644
--- a/examples/example_film_manager.glom
+++ b/examples/example_film_manager.glom
@@ -217,7 +217,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="accommodation">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -304,7 +304,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="accommodation">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="accommodation_id" editable="true" use_default_formatting="true">
@@ -473,7 +473,7 @@
</fields>
<relationships/>
<data_layouts>
- <data_layout name="details" parent_table="cars">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -527,7 +527,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="cars">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="car_id" editable="true" use_default_formatting="true">
@@ -730,7 +730,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="cast">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_group name="overview" columns_count="2" title="Overview">
@@ -792,6 +792,21 @@
<formatting format_thousands_separator="true" format_decimal_places="2"/>
</data_layout_item>
<data_layout_item name="name_full" relationship="contacts_actor" editable="true"
use_default_formatting="true">
+ <title_custom use_custom="true" title="Actor's Name">
+ <trans_set>
+ <trans loc="cs" val="Jméno herce"/>
+ <trans loc="de" val="Name des Schauspielers"/>
+ <trans loc="el" val="Όνομα ηθοποιού"/>
+ <trans loc="en_GB" val="Actor's Name"/>
+ <trans loc="es" val="Nombre del actor"/>
+ <trans loc="fr" val="Nom de l'acteur"/>
+ <trans loc="id" val="Nama Aktor"/>
+ <trans loc="pt_BR" val="Nome do ator"/>
+ <trans loc="sl" val="Ime igralca"/>
+ <trans loc="sr" val="Име глумца"/>
+ <trans loc="sr latin" val="Ime glumca"/>
+ </trans_set>
+ </title_custom>
<formatting/>
</data_layout_item>
<data_layout_item name="address_street1" relationship="contacts_actor" editable="true"
use_default_formatting="true">
@@ -845,7 +860,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="cast">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="character_id" editable="true" use_default_formatting="true">
@@ -899,7 +914,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="characters">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -1003,7 +1018,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="characters">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="character_id" editable="true" use_default_formatting="true">
@@ -1315,7 +1330,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="companies">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -1388,7 +1403,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="companies">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="company_id" editable="true" use_default_formatting="true">
@@ -2329,7 +2344,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="contacts">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -2542,7 +2557,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="contacts">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="contact_id" editable="true" use_default_formatting="true">
@@ -3449,7 +3464,7 @@ Orientation=portrait
</fields>
<relationships/>
<data_layouts>
- <data_layout name="list" parent_table="costume">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="costume_id" editable="true" use_default_formatting="true">
@@ -3464,7 +3479,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="costume">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -3700,7 +3715,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="crew">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -3840,7 +3855,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="crew">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="crew_id" editable="true" use_default_formatting="true">
@@ -4212,7 +4227,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="deliveries">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="delivery_id" editable="true" use_default_formatting="true">
@@ -4272,7 +4287,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="deliveries">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -4496,7 +4511,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="departments">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -4545,7 +4560,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="departments">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="departments_id" editable="true" use_default_formatting="true">
@@ -4665,7 +4680,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="equipment">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -4718,7 +4733,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="equipment">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="equipment_id" editable="true" use_default_formatting="true">
@@ -4959,7 +4974,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="journeys">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="journey_id" editable="true" use_default_formatting="true">
@@ -4986,7 +5001,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="journeys">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -5343,7 +5358,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="locations">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -5447,7 +5462,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="locations">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="location_id" editable="true" use_default_formatting="true">
@@ -5589,7 +5604,7 @@ Orientation=portrait
</fields>
<relationships/>
<data_layouts>
- <data_layout name="list" parent_table="props">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="prop_id" editable="true" use_default_formatting="true">
@@ -5604,7 +5619,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="props">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -5807,7 +5822,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="scene_cast">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="scene_cast_id" editable="true" use_default_formatting="true">
@@ -5825,7 +5840,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="scene_cast">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_group name="overview" columns_count="2" title="Overview">
@@ -6014,7 +6029,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="scene_costume">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="scene_costume_id" editable="true" use_default_formatting="true">
@@ -6029,7 +6044,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="scene_costume">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -6240,7 +6255,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="scene_crew">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_group name="overview" columns_count="2" title="Overview">
@@ -6293,7 +6308,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="scene_crew">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="scene_crew_id" editable="true" use_default_formatting="true">
@@ -6418,7 +6433,7 @@ Orientation=portrait
<relationship name="scene" key="scene_id" other_table="scenes" other_key="scene_id"/>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="scene_equipment">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="scene_equipment_id" editable="true" use_default_formatting="true">
@@ -6436,7 +6451,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="scene_equipment">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -6616,7 +6631,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="scene_extras">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_group name="overview" columns_count="2" title="Overview">
@@ -6672,7 +6687,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="scene_extras">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="scene_extras_id" editable="true" use_default_formatting="true">
@@ -6782,7 +6797,7 @@ Orientation=portrait
</fields>
<relationships/>
<data_layouts>
- <data_layout name="list" parent_table="scene_makeup">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="scene_makeup_id" editable="true" use_default_formatting="true">
@@ -6800,7 +6815,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="scene_makeup">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -6974,7 +6989,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="scene_props">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="scene_props_id" editable="true" use_default_formatting="true">
@@ -6989,7 +7004,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="scene_props">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -7556,7 +7571,7 @@ else:
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="scenes">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -7800,7 +7815,7 @@ else:
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="scenes">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="scene_id" editable="true" use_default_formatting="true">
diff --git a/examples/example_lesson_planner.glom b/examples/example_lesson_planner.glom
index 73c59eb..d2c07da 100644
--- a/examples/example_lesson_planner.glom
+++ b/examples/example_lesson_planner.glom
@@ -229,7 +229,7 @@
</fields>
<relationships/>
<data_layouts>
- <data_layout name="details" parent_table="invoice_lines">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="invoice_lines_id" editable="true" use_default_formatting="true">
@@ -262,7 +262,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="invoice_lines">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="invoice_lines_id" editable="true" use_default_formatting="true">
@@ -590,7 +590,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="lessons">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="lesson_id" editable="true" use_default_formatting="true">
@@ -617,7 +617,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="lessons">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -932,7 +932,7 @@
</fields>
<relationships/>
<data_layouts>
- <data_layout name="list" parent_table="rooms">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="room_id" editable="true" use_default_formatting="true">
@@ -950,7 +950,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="rooms">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -1148,7 +1148,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="subjects">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="subject_id" editable="true" use_default_formatting="true">
@@ -1163,7 +1163,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="subjects">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -1889,7 +1889,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="teachers">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="teacher_id" editable="true" use_default_formatting="true">
@@ -1955,7 +1955,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="teachers">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
diff --git a/examples/example_music_collection.glom b/examples/example_music_collection.glom
index 039f52b..3825ce5 100644
--- a/examples/example_music_collection.glom
+++ b/examples/example_music_collection.glom
@@ -247,7 +247,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="albums">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -344,7 +344,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="albums">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="toplevel">
<data_layout_item name="name" editable="true" use_default_formatting="true">
@@ -590,7 +590,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="artists">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -646,7 +646,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="artists">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="artist_id" editable="true" use_default_formatting="true">
@@ -772,7 +772,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="publishers">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -828,7 +828,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="publishers">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="publishers_id" editable="true" use_default_formatting="true">
@@ -1247,7 +1247,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="songs">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -1336,7 +1336,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="songs">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="song_id" editable="true" use_default_formatting="true">
diff --git a/examples/example_project_manager.glom b/examples/example_project_manager.glom
index a9e741c..3c87312 100644
--- a/examples/example_project_manager.glom
+++ b/examples/example_project_manager.glom
@@ -694,7 +694,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="contacts">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -856,7 +856,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="contacts">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="contact_id" use_default_formatting="true">
@@ -1075,7 +1075,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="projects">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -1141,7 +1141,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="projects">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="project_id" editable="true" use_default_formatting="true">
@@ -1324,7 +1324,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="project_teams">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="project_team_id" editable="true" use_default_formatting="true">
@@ -1342,7 +1342,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="project_teams">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -1637,7 +1637,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="list" parent_table="team_members">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="team_members_id" editable="true" use_default_formatting="true">
@@ -1661,7 +1661,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="team_members">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -1862,7 +1862,7 @@
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="teams">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -1933,7 +1933,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="teams">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="team_id" editable="true" use_default_formatting="true">
diff --git a/examples/example_smallbusiness.glom b/examples/example_smallbusiness.glom
index 26ea3d0..98fc72e 100644
--- a/examples/example_smallbusiness.glom
+++ b/examples/example_smallbusiness.glom
@@ -678,7 +678,7 @@ http://www.flickr.com/photos/mape_s/350700095/</value>
</fields>
<relationships/>
<data_layouts>
- <data_layout name="details" parent_table="contacts">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -837,7 +837,7 @@ dialog.hide();
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="contacts">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="contact_id" use_default_formatting="true">
@@ -1675,7 +1675,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="invoice_lines">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="invoice_lines_id" editable="true" use_default_formatting="true">
@@ -1708,7 +1708,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="invoice_lines">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="invoice_lines_id" editable="true" use_default_formatting="true">
@@ -1943,7 +1943,7 @@ Orientation=portrait
</relationship>
</relationships>
<data_layouts>
- <data_layout name="details" parent_table="invoices">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -2030,7 +2030,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="invoices">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="invoice_id" use_default_formatting="true">
@@ -2260,7 +2260,7 @@ Orientation=portrait
</fields>
<relationships/>
<data_layouts>
- <data_layout name="details" parent_table="products">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -2316,7 +2316,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="products">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="product_id" use_default_formatting="true">
@@ -2691,7 +2691,7 @@ Orientation=portrait
</fields>
<relationships/>
<data_layouts>
- <data_layout name="details" parent_table="staff">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<trans_set>
@@ -2787,7 +2787,7 @@ Orientation=portrait
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="list" parent_table="staff">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="staff_id" use_default_formatting="true">
diff --git a/examples/tests/example_field_formatting_test.glom
b/examples/tests/example_field_formatting_test.glom
index 9f65208..05ca546 100644
--- a/examples/tests/example_field_formatting_test.glom
+++ b/examples/tests/example_field_formatting_test.glom
@@ -30,7 +30,7 @@
</fields>
<relationships/>
<data_layouts>
- <data_layout name="list" parent_table="alignment">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="alignment_id" editable="true" use_default_formatting="true">
@@ -53,7 +53,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="alignment">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="overview" columns_count="2" title="Overview">
<data_layout_item name="alignment_id" editable="true" use_default_formatting="true">
@@ -118,7 +118,7 @@
</fields>
<relationships/>
<data_layouts>
- <data_layout name="list" parent_table="colours">
+ <data_layout name="list">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_item name="colours_id" editable="true" use_default_formatting="true">
@@ -140,7 +140,7 @@
</data_layout_group>
</data_layout_groups>
</data_layout>
- <data_layout name="details" parent_table="colours">
+ <data_layout name="details">
<data_layout_groups>
<data_layout_group name="main">
<data_layout_group name="overview" columns_count="2" title="Overview">
diff --git a/glom/glom_document.dtd b/glom/glom_document.dtd
index 42c6cf5..ce135f1 100644
--- a/glom/glom_document.dtd
+++ b/glom/glom_document.dtd
@@ -216,8 +216,7 @@ TODO: Should we specify the presence of child text nodes in the ELEMENT somehow?
<!ELEMENT data_layout (data_layout_groups)>
<!ATTLIST data_layout
- name CDATA #REQUIRED
- parent_table CDATA #IMPLIED>
+ name CDATA #REQUIRED>
<!ELEMENT data_layout_groups (data_layout_group*)>
<!ATTLIST data_layout_groups>
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index 9b394b4..ad8005b 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -75,7 +75,6 @@ static const char GLOM_ATTRIBUTE_BORDER_WIDTH[] = "border_width";
static const char GLOM_NODE_DATA_LAYOUTS[] = "data_layouts";
static const char GLOM_NODE_DATA_LAYOUT[] = "data_layout";
static const char GLOM_ATTRIBUTE_LAYOUT_PLATFORM[] = "platform";
-static const char GLOM_ATTRIBUTE_PARENT_TABLE_NAME[] = "parent_table";
static const char GLOM_NODE_DATA_LAYOUT_NOTEBOOK[] = "data_layout_notebook";
@@ -254,22 +253,20 @@ template<class T_Element>
class predicate_Layout
{
public:
- predicate_Layout(const Glib::ustring& parent_table, const Glib::ustring& layout_name, const Glib::ustring&
layout_platform)
- : m_parent_table(parent_table),
- m_layout_name(layout_name),
+ predicate_Layout(const Glib::ustring& layout_name, const Glib::ustring& layout_platform)
+ : m_layout_name(layout_name),
m_layout_platform(layout_platform)
{
}
bool operator() (const T_Element& element)
{
- return (element.m_parent_table == m_parent_table) &&
- (element.m_layout_name == m_layout_name) &&
+ return (element.m_layout_name == m_layout_name) &&
(element.m_layout_platform == m_layout_platform);
}
private:
- Glib::ustring m_parent_table, m_layout_name, m_layout_platform;
+ Glib::ustring m_layout_name, m_layout_platform;
};
@@ -1490,7 +1487,7 @@ Document::type_list_layout_groups Document::get_data_layout_groups(const Glib::u
const DocumentTableInfo& info = iterFind->second;
//Look for the layout with this name:
- DocumentTableInfo::type_layouts::const_iterator iter = std::find_if(info.m_layouts.begin(),
info.m_layouts.end(), predicate_Layout<LayoutInfo>(parent_table_name, layout_name, layout_platform));
+ DocumentTableInfo::type_layouts::const_iterator iter = std::find_if(info.m_layouts.begin(),
info.m_layouts.end(), predicate_Layout<LayoutInfo>(layout_name, layout_platform));
if(iter != info.m_layouts.end())
{
return iter->m_layout_groups; //found
@@ -1517,8 +1514,6 @@ bool Document::get_data_layout_groups_have_any_fields(const Glib::ustring& layou
void Document::set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring&
parent_table_name, const Glib::ustring& layout_platform, const type_list_layout_groups& groups)
{
//std::cout << "debug: " << G_STRFUNC << ": layout_name=" << layout_name << ", parent_table_name=" <<
parent_table_name << ", layout_platform=" << layout_platform << std::endl;
- const Glib::ustring child_table_name = parent_table_name; //TODO: Remove this cruft.
-
//std::cerr << G_STRFUNC << ": ADDING layout for table " << parent_table_name << " (child_table=" <<
child_table_name << "), for layout " << layout_name << std::endl;
@@ -1527,11 +1522,10 @@ void Document::set_data_layout_groups(const Glib::ustring& layout_name, const Gl
DocumentTableInfo& info = get_table_info_with_add(parent_table_name);
LayoutInfo layout_info;
- layout_info.m_parent_table = child_table_name;
layout_info.m_layout_name = layout_name;
layout_info.m_layout_groups = groups;
- DocumentTableInfo::type_layouts::iterator iter = std::find_if(info.m_layouts.begin(),
info.m_layouts.end(), predicate_Layout<LayoutInfo>(child_table_name, layout_name, layout_platform));
+ DocumentTableInfo::type_layouts::iterator iter = std::find_if(info.m_layouts.begin(),
info.m_layouts.end(), predicate_Layout<LayoutInfo>(layout_name, layout_platform));
if(iter == info.m_layouts.end())
info.m_layouts.push_back(layout_info);
else
@@ -2778,10 +2772,6 @@ bool Document::load_after(int& failure_code)
const Glib::ustring layout_name = XmlUtils::get_node_attribute_value(node,
GLOM_ATTRIBUTE_NAME);
const Glib::ustring layout_platform = XmlUtils::get_node_attribute_value(node,
GLOM_ATTRIBUTE_LAYOUT_PLATFORM);
- Glib::ustring parent_table = XmlUtils::get_node_attribute_value(node,
GLOM_ATTRIBUTE_PARENT_TABLE_NAME);
- if(parent_table.empty())
- parent_table = table_name; //Deal with the earlier file format that did not include this.
-
type_list_layout_groups layout_groups;
const xmlpp::Element* nodeGroups = XmlUtils::get_node_child_named(node,
GLOM_NODE_DATA_LAYOUT_GROUPS);
@@ -2807,7 +2797,6 @@ bool Document::load_after(int& failure_code)
}
LayoutInfo layout_info;
- layout_info.m_parent_table = parent_table;
layout_info.m_layout_name = layout_name;
layout_info.m_layout_platform = layout_platform;
layout_info.m_layout_groups = layout_groups;
@@ -3746,7 +3735,6 @@ bool Document::save_before()
xmlpp::Element* nodeLayout = nodeDataLayouts->add_child(GLOM_NODE_DATA_LAYOUT);
XmlUtils::set_node_attribute_value(nodeLayout, GLOM_ATTRIBUTE_NAME, iter->m_layout_name);
XmlUtils::set_node_attribute_value(nodeLayout, GLOM_ATTRIBUTE_LAYOUT_PLATFORM,
iter->m_layout_platform);
- XmlUtils::set_node_attribute_value(nodeLayout, GLOM_ATTRIBUTE_PARENT_TABLE_NAME,
iter->m_parent_table);
xmlpp::Element* nodeGroups = nodeLayout->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
diff --git a/glom/libglom/document/document.h b/glom/libglom/document/document.h
index fd12fd6..f46b943 100644
--- a/glom/libglom/document/document.h
+++ b/glom/libglom/document/document.h
@@ -541,7 +541,6 @@ private:
public:
Glib::ustring m_layout_name;
Glib::ustring m_layout_platform; //Empty string (meaning normal platforms), or "maemo", or something
else.
- Glib::ustring m_parent_table;
type_list_layout_groups m_layout_groups;
};
diff --git a/tests/test_document_load_translations.cc b/tests/test_document_load_translations.cc
index 0aa798c..0630feb 100644
--- a/tests/test_document_load_translations.cc
+++ b/tests/test_document_load_translations.cc
@@ -172,7 +172,7 @@ void check_title(const T_Item& item, const char* title_en, const char* title_de)
if(has_own_title)
g_assert( item->get_title_original() == title_en );
-
+
g_assert( item->get_title(Glib::ustring()) == title_en );
g_assert( item->get_title("en_US") == title_en );
@@ -289,6 +289,8 @@ int main()
Glom::sharedptr<const Glom::LayoutItem_Field> field_on_layout =
get_field_on_layout(document, "characters", "contacts", "name_full");
g_assert(field_on_layout);
+ g_assert(field_on_layout->get_has_relationship_name());
+ g_assert(field_on_layout->get_relationship_name() == "contacts_actor");
check_title(field_on_layout, "Actor's Name", "Name des Schauspielers");
//Check a LayoutItemField's Field title:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]