From d65ae8a504e402633c8bfc0ab4c222cc40ab6618 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sun, 28 Sep 2014 22:56:29 +0200 Subject: [PATCH] Remove house system from the save data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This doesn’t really belong here, as it is more a user preference than part of a chart. --- data/examples/saved-chart.agc | 1 - src/ag-chart.c | 9 --------- src/ag-db.c | 28 ---------------------------- src/ag-db.h | 1 - 4 files changed, 39 deletions(-) diff --git a/data/examples/saved-chart.agc b/data/examples/saved-chart.agc index 04328a6..23f7e60 100644 --- a/data/examples/saved-chart.agc +++ b/data/examples/saved-chart.agc @@ -18,7 +18,6 @@ 45 1 - placidus This is my own chart. diff --git a/src/ag-chart.c b/src/ag-chart.c index 51f2a91..68caae2 100644 --- a/src/ag-chart.c +++ b/src/ag-chart.c @@ -2013,8 +2013,6 @@ ag_chart_get_db_save(AgChart *chart, gint db_id) AgChartPrivate *priv = ag_chart_get_instance_private(chart); AgDbChartSave *save_data = ag_db_chart_save_new(TRUE); GsweTimestamp *timestamp = gswe_moment_get_timestamp(GSWE_MOMENT(chart)); - GEnumClass *house_system_class; - GEnumValue *house_system_enum; save_data->db_id = db_id; @@ -2048,13 +2046,6 @@ ag_chart_get_db_save(AgChart *chart, gint db_id) NULL ); 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); return save_data; diff --git a/src/ag-db.c b/src/ag-db.c index d51916c..2f1ded4 100644 --- a/src/ag-db.c +++ b/src/ag-db.c @@ -61,7 +61,6 @@ enum { COLUMN_CHART_MINUTE, COLUMN_CHART_SECOND, COLUMN_CHART_TIMEZONE, - COLUMN_CHART_HOUSE_SYSTEM, COLUMN_CHART_NOTE, /* Leave this as the last element */ @@ -88,7 +87,6 @@ static TableColumnDef chart_table_column[] = { { COLUMN_CHART_MINUTE, "minute" }, { COLUMN_CHART_SECOND, "second" }, { COLUMN_CHART_TIMEZONE, "timezone" }, - { COLUMN_CHART_HOUSE_SYSTEM, "house_system" }, { COLUMN_CHART_NOTE, "note" }, }; @@ -453,7 +451,6 @@ ag_db_check_chart_table(AgDb *db) "minute UNSIGNED INTEGER NOT NULL, " \ "second UNSIGNED INTEGER NOT NULL, " \ "timezone DOUBLE NOT NULL, " \ - "house_system TEXT NOT NULL, " \ "note TEXT" \ ")" ); @@ -589,10 +586,6 @@ ag_db_chart_save_free(AgDbChartSave *save_data) g_free(save_data->city); } - if (save_data->house_system) { - g_free(save_data->house_system); - } - if (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, second = G_VALUE_INIT, timezone = G_VALUE_INIT, - house_system = G_VALUE_INIT, note = G_VALUE_INIT; 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_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(¬e, G_TYPE_STRING); g_value_set_string(¬e, save_data->note); @@ -731,7 +720,6 @@ ag_db_chart_save(AgDb *db, AgDbChartSave *save_data, GError **err) "minute", &minute, "second", &second, "timezone", &timezone, - "house_system", &house_system, "note", ¬e, NULL )) { @@ -795,7 +783,6 @@ ag_db_chart_save(AgDb *db, AgDbChartSave *save_data, GError **err) "minute", &minute, "second", &second, "timezone", &timezone, - "house_system", &house_system, "note", ¬e, NULL )) { @@ -817,7 +804,6 @@ ag_db_chart_save(AgDb *db, AgDbChartSave *save_data, GError **err) } g_value_unset(¬e); - g_value_unset(&house_system); g_value_unset(&timezone); g_value_unset(&second); 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); - 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); if (GDA_VALUE_HOLDS_NULL(value)) { @@ -1225,12 +1203,6 @@ ag_db_chart_save_identical(const AgDbChartSave *a, 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) { g_debug("identical: Notes differ"); diff --git a/src/ag-db.h b/src/ag-db.h index e5c7e03..828525d 100644 --- a/src/ag-db.h +++ b/src/ag-db.h @@ -64,7 +64,6 @@ typedef struct _AgDbChartSave { guint minute; guint second; gdouble timezone; - gchar *house_system; gchar *note; gint refcount; } AgDbChartSave;