From 84e13e55846950db7a5ab1debebdf9e3fd977343 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Tue, 19 Mar 2002 13:25:33 +0000 Subject: Move the preferences from a per-view setting to a global setting svn path=/trunk/; revision=16205 --- my-evolution/e-summary-preferences.c | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'my-evolution/e-summary-preferences.c') diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c index 9b8f63dfa0..bf3e4159e6 100644 --- a/my-evolution/e-summary-preferences.c +++ b/my-evolution/e-summary-preferences.c @@ -49,9 +49,9 @@ #include "evolution-config-control.h" - #define FACTORY_ID "OAFIID:GNOME_Evolution_Summary_ConfigControlFactory" +static ESummaryPrefs *global_preferences = NULL; static void make_initial_mail_list (ESummaryPrefs *prefs) @@ -363,22 +363,22 @@ e_summary_preferences_copy (ESummaryPrefs *prefs) return prefs_copy; } -void -e_summary_preferences_init (ESummary *summary) +ESummaryPrefs * +e_summary_preferences_init (void) { ESummaryPrefs *prefs; - g_return_if_fail (summary != NULL); - g_return_if_fail (IS_E_SUMMARY (summary)); - - summary->preferences = g_new0 (ESummaryPrefs, 1); - summary->old_prefs = NULL; - - if (e_summary_preferences_restore (summary->preferences) == TRUE) { - return; + if (global_preferences != NULL) { + return global_preferences; + } + + prefs = g_new0 (ESummaryPrefs, 1); + global_preferences = prefs; + + if (e_summary_preferences_restore (prefs) == TRUE) { + return prefs; } - prefs = summary->preferences; /* Defaults */ /* Mail */ @@ -396,6 +396,8 @@ e_summary_preferences_init (ESummary *summary) prefs->days = E_SUMMARY_CALENDAR_ONE_DAY; prefs->show_tasks = E_SUMMARY_CALENDAR_ALL_TASKS; + + return prefs; } struct _MailPage { @@ -1204,11 +1206,6 @@ config_control_destroy_cb (EvolutionConfigControl *config_control, pd = (PropertyData *) data; - if (pd->summary->old_prefs != NULL) { - e_summary_preferences_free (pd->summary->old_prefs); - pd->summary->old_prefs = NULL; - } - e_summary_preferences_save (pd->summary->preferences); free_property_dialog (pd); } @@ -1228,11 +1225,6 @@ factory_fn (BonoboGenericFactory *generic_factory, gtk_object_ref (GTK_OBJECT (summary)); pd->summary = summary; - if (summary->old_prefs != NULL) - e_summary_preferences_free (summary->old_prefs); - - summary->old_prefs = e_summary_preferences_copy (summary->preferences); - pd->xml = glade_xml_new (EVOLUTION_GLADEDIR "/my-evolution.glade", NULL); g_return_val_if_fail (pd->xml != NULL, NULL); -- cgit v1.2.3