Remove house system from the save data

This doesn’t really belong here, as it is more a user preference than part
of a chart.
This commit is contained in:
Gergely Polonkai 2014-09-28 22:56:29 +02:00
parent 461c99a8d2
commit d65ae8a504
4 changed files with 0 additions and 39 deletions

View File

@ -18,7 +18,6 @@
<second>45</second> <second>45</second>
<timezone>1</timezone> <timezone>1</timezone>
</time> </time>
<housesystem>placidus</housesystem>
</data> </data>
<note>This is my own chart.</note> <note>This is my own chart.</note>
</chartinfo> </chartinfo>

View File

@ -2013,8 +2013,6 @@ ag_chart_get_db_save(AgChart *chart, gint db_id)
AgChartPrivate *priv = ag_chart_get_instance_private(chart); AgChartPrivate *priv = ag_chart_get_instance_private(chart);
AgDbChartSave *save_data = ag_db_chart_save_new(TRUE); AgDbChartSave *save_data = ag_db_chart_save_new(TRUE);
GsweTimestamp *timestamp = gswe_moment_get_timestamp(GSWE_MOMENT(chart)); GsweTimestamp *timestamp = gswe_moment_get_timestamp(GSWE_MOMENT(chart));
GEnumClass *house_system_class;
GEnumValue *house_system_enum;
save_data->db_id = db_id; save_data->db_id = db_id;
@ -2048,13 +2046,6 @@ ag_chart_get_db_save(AgChart *chart, gint db_id)
NULL NULL
); );
save_data->timezone = gswe_timestamp_get_gregorian_timezone(timestamp); save_data->timezone = gswe_timestamp_get_gregorian_timezone(timestamp);
house_system_class = g_type_class_ref(GSWE_TYPE_HOUSE_SYSTEM);
house_system_enum = g_enum_get_value(
house_system_class,
gswe_moment_get_house_system(GSWE_MOMENT(chart))
);
save_data->house_system = g_strdup(house_system_enum->value_nick);
g_type_class_unref(house_system_class);
save_data->note = g_strdup(priv->note); save_data->note = g_strdup(priv->note);
return save_data; return save_data;

View File

@ -61,7 +61,6 @@ enum {
COLUMN_CHART_MINUTE, COLUMN_CHART_MINUTE,
COLUMN_CHART_SECOND, COLUMN_CHART_SECOND,
COLUMN_CHART_TIMEZONE, COLUMN_CHART_TIMEZONE,
COLUMN_CHART_HOUSE_SYSTEM,
COLUMN_CHART_NOTE, COLUMN_CHART_NOTE,
/* Leave this as the last element */ /* Leave this as the last element */
@ -88,7 +87,6 @@ static TableColumnDef chart_table_column[] = {
{ COLUMN_CHART_MINUTE, "minute" }, { COLUMN_CHART_MINUTE, "minute" },
{ COLUMN_CHART_SECOND, "second" }, { COLUMN_CHART_SECOND, "second" },
{ COLUMN_CHART_TIMEZONE, "timezone" }, { COLUMN_CHART_TIMEZONE, "timezone" },
{ COLUMN_CHART_HOUSE_SYSTEM, "house_system" },
{ COLUMN_CHART_NOTE, "note" }, { COLUMN_CHART_NOTE, "note" },
}; };
@ -453,7 +451,6 @@ ag_db_check_chart_table(AgDb *db)
"minute UNSIGNED INTEGER NOT NULL, " \ "minute UNSIGNED INTEGER NOT NULL, " \
"second UNSIGNED INTEGER NOT NULL, " \ "second UNSIGNED INTEGER NOT NULL, " \
"timezone DOUBLE NOT NULL, " \ "timezone DOUBLE NOT NULL, " \
"house_system TEXT NOT NULL, " \
"note TEXT" \ "note TEXT" \
")" ")"
); );
@ -589,10 +586,6 @@ ag_db_chart_save_free(AgDbChartSave *save_data)
g_free(save_data->city); g_free(save_data->city);
} }
if (save_data->house_system) {
g_free(save_data->house_system);
}
if (save_data->note) { if (save_data->note) {
g_free(save_data->note); g_free(save_data->note);
} }
@ -655,7 +648,6 @@ ag_db_chart_save(AgDb *db, AgDbChartSave *save_data, GError **err)
minute = G_VALUE_INIT, minute = G_VALUE_INIT,
second = G_VALUE_INIT, second = G_VALUE_INIT,
timezone = G_VALUE_INIT, timezone = G_VALUE_INIT,
house_system = G_VALUE_INIT,
note = G_VALUE_INIT; note = G_VALUE_INIT;
AgDbPrivate *priv = ag_db_get_instance_private(db); AgDbPrivate *priv = ag_db_get_instance_private(db);
@ -706,9 +698,6 @@ ag_db_chart_save(AgDb *db, AgDbChartSave *save_data, GError **err)
g_value_init(&timezone, G_TYPE_DOUBLE); g_value_init(&timezone, G_TYPE_DOUBLE);
g_value_set_double(&timezone, save_data->timezone); g_value_set_double(&timezone, save_data->timezone);
g_value_init(&house_system, G_TYPE_STRING);
g_value_set_string(&house_system, save_data->house_system);
g_value_init(&note, G_TYPE_STRING); g_value_init(&note, G_TYPE_STRING);
g_value_set_string(&note, save_data->note); g_value_set_string(&note, save_data->note);
@ -731,7 +720,6 @@ ag_db_chart_save(AgDb *db, AgDbChartSave *save_data, GError **err)
"minute", &minute, "minute", &minute,
"second", &second, "second", &second,
"timezone", &timezone, "timezone", &timezone,
"house_system", &house_system,
"note", &note, "note", &note,
NULL NULL
)) { )) {
@ -795,7 +783,6 @@ ag_db_chart_save(AgDb *db, AgDbChartSave *save_data, GError **err)
"minute", &minute, "minute", &minute,
"second", &second, "second", &second,
"timezone", &timezone, "timezone", &timezone,
"house_system", &house_system,
"note", &note, "note", &note,
NULL NULL
)) { )) {
@ -817,7 +804,6 @@ ag_db_chart_save(AgDb *db, AgDbChartSave *save_data, GError **err)
} }
g_value_unset(&note); g_value_unset(&note);
g_value_unset(&house_system);
g_value_unset(&timezone); g_value_unset(&timezone);
g_value_unset(&second); g_value_unset(&second);
g_value_unset(&minute); g_value_unset(&minute);
@ -1067,14 +1053,6 @@ ag_db_chart_get_data_by_id(AgDb *db, guint row_id, GError **err)
); );
save_data->timezone = g_value_get_double(value); save_data->timezone = g_value_get_double(value);
value = gda_data_model_get_value_at(
result,
COLUMN_CHART_HOUSE_SYSTEM,
0,
NULL
);
save_data->house_system = g_strdup(g_value_get_string(value));
value = gda_data_model_get_value_at(result, COLUMN_CHART_NOTE, 0, NULL); value = gda_data_model_get_value_at(result, COLUMN_CHART_NOTE, 0, NULL);
if (GDA_VALUE_HOLDS_NULL(value)) { if (GDA_VALUE_HOLDS_NULL(value)) {
@ -1225,12 +1203,6 @@ ag_db_chart_save_identical(const AgDbChartSave *a,
return FALSE; return FALSE;
} }
if (string_collate(a->house_system, b->house_system) != 0) {
g_debug("identical: House systems differ");
return FALSE;
}
if (!chart_only && string_collate(a->note, b->note) != 0) { if (!chart_only && string_collate(a->note, b->note) != 0) {
g_debug("identical: Notes differ"); g_debug("identical: Notes differ");

View File

@ -64,7 +64,6 @@ typedef struct _AgDbChartSave {
guint minute; guint minute;
guint second; guint second;
gdouble timezone; gdouble timezone;
gchar *house_system;
gchar *note; gchar *note;
gint refcount; gint refcount;
} AgDbChartSave; } AgDbChartSave;