Ignore the house system set on the Edit tab

This is required so we can safely remove it from the save data.
This commit is contained in:
Gergely Polonkai 2014-09-28 22:55:05 +02:00
parent bd16d5c2f6
commit 461c99a8d2
2 changed files with 10 additions and 13 deletions

View File

@ -37,6 +37,7 @@
#include "ag-db.h" #include "ag-db.h"
#include "ag-chart.h" #include "ag-chart.h"
#include "placidus.h" #include "placidus.h"
#include "ag-settings.h"
typedef struct _AgChartPrivate { typedef struct _AgChartPrivate {
gchar *name; gchar *name;
@ -1228,9 +1229,9 @@ ag_chart_new_from_db_save(AgDbChartSave *save_data,
GError **err) GError **err)
{ {
GsweTimestamp *timestamp; GsweTimestamp *timestamp;
gchar *house_system_enum_name;
GsweHouseSystem house_system; GsweHouseSystem house_system;
AgChart *chart; AgChart *chart;
AgSettings *settings;
if (save_data == NULL) { if (save_data == NULL) {
g_set_error( g_set_error(
@ -1242,9 +1243,9 @@ ag_chart_new_from_db_save(AgDbChartSave *save_data,
return NULL; return NULL;
} }
house_system_enum_name = g_utf8_strdown(save_data->house_system, -1); settings = ag_settings_get();
house_system = ag_house_system_nick_to_id(house_system_enum_name); house_system = ag_settings_get_house_system(settings);
g_free(house_system_enum_name); g_object_unref(settings);
timestamp = gswe_timestamp_new_from_gregorian_full( timestamp = gswe_timestamp_new_from_gregorian_full(
save_data->year, save_data->month, save_data->day, save_data->year, save_data->month, save_data->day,

View File

@ -718,6 +718,7 @@ ag_window_recalculate_chart(AgWindow *window, gboolean set_everything)
GsweTimestamp *timestamp; GsweTimestamp *timestamp;
GtkWidget *current; GtkWidget *current;
gint db_id = (priv->saved_data) ? priv->saved_data->db_id : -1; gint db_id = (priv->saved_data) ? priv->saved_data->db_id : -1;
AgSettings *settings;
south = gtk_toggle_button_get_active( south = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(priv->south_lat) GTK_TOGGLE_BUTTON(priv->south_lat)
@ -790,15 +791,6 @@ ag_window_recalculate_chart(AgWindow *window, gboolean set_everything)
g_error("House system is not set! This is clearly a bug."); g_error("House system is not set! This is clearly a bug.");
} }
gtk_tree_model_get(
GTK_TREE_MODEL(priv->house_system_model),
&house_system_iter,
0, &house_system,
-1
);
edit_data->house_system = g_strdup(
ag_house_system_id_to_nick(house_system)
);
gtk_text_buffer_get_bounds(priv->note_buffer, &start_iter, &end_iter); gtk_text_buffer_get_bounds(priv->note_buffer, &start_iter, &end_iter);
edit_data->note = gtk_text_buffer_get_text( edit_data->note = gtk_text_buffer_get_text(
priv->note_buffer, priv->note_buffer,
@ -824,6 +816,10 @@ ag_window_recalculate_chart(AgWindow *window, gboolean set_everything)
g_debug("Recalculating chart data"); g_debug("Recalculating chart data");
settings = ag_settings_get();
house_system = ag_settings_get_house_system(settings);
g_object_unref(settings);
// TODO: Set timezone according to the city selected! // TODO: Set timezone according to the city selected!
if (priv->chart == NULL) { if (priv->chart == NULL) {
timestamp = gswe_timestamp_new_from_gregorian_full( timestamp = gswe_timestamp_new_from_gregorian_full(