Ignore the house system set on the Edit tab

This is required so we can safely remove it from the save data.
pull/96/head
Gergely Polonkai 8 years ago
parent bd16d5c2f6
commit 461c99a8d2

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

@ -718,6 +718,7 @@ ag_window_recalculate_chart(AgWindow *window, gboolean set_everything)
GsweTimestamp *timestamp;
GtkWidget *current;
gint db_id = (priv->saved_data) ? priv->saved_data->db_id : -1;
AgSettings *settings;
south = gtk_toggle_button_get_active(
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.");
}
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);
edit_data->note = gtk_text_buffer_get_text(
priv->note_buffer,
@ -824,6 +816,10 @@ ag_window_recalculate_chart(AgWindow *window, gboolean set_everything)
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!
if (priv->chart == NULL) {
timestamp = gswe_timestamp_new_from_gregorian_full(

Loading…
Cancel
Save