diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2002-11-21 05:57:43 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2002-11-21 05:57:43 +0800 |
commit | ba846b6b545490d957af46038c9b686b440ca25a (patch) | |
tree | 9928fe710ac606e1a49b908e244ea1a3b6ad3fc8 /my-evolution/e-summary-calendar.c | |
parent | 37cdfc6c84183613ed796cc218e60e78e07ddc0a (diff) | |
download | gsoc2013-evolution-ba846b6b545490d957af46038c9b686b440ca25a.tar.gz gsoc2013-evolution-ba846b6b545490d957af46038c9b686b440ca25a.tar.zst gsoc2013-evolution-ba846b6b545490d957af46038c9b686b440ca25a.zip |
Use GConf.
* e-summary.c (e_summary_init): Use GConf.
* e-summary-tasks.c: Replaced member config_listener in
ESummaryTasks with a gconf_client.
(setup_gconf_client): Renamed from setup_config_listener(). Set
up the GConf client and invoke gconf_client_add_dir() on the
interesting namespaces.
(gconf_client_value_changed_cb): Renamed from
config_listener_value_changed_cb and changed prototype to match
that of the "value_changed" signal in GConfClient.
(setup_task_folder): Updated to use GConf.
* e-summary-calendar.c: Replaced member config_listener with a
gconf_listener.
(setup_calendar): Use GConf.
(setup_gconf_client): Renamed from setup_config_listener. Set up
a GConf client and invoke gconf_client_add_dir() on the
interesting namespaces.
(gconf_client_value_changed_cb): Renamed from
config_listener_key_changed_cb() and changed prototype to match
that of the "value_changed" signal in GConfClient.
(locale_uses_24h_time_format): Removed.
(e_summary_calendar_free): g_object_unref() the gconf_client.
* Makefile.am: Add rules to install the schemas.
* apps_evolution_summary.schemas: New.
* e-summary-preferences.c: Did a global GList -> GSList switch.
(e_summary_preferences_restore): Use GConfClient instead of
EConfigListener.
(vector_from_folder_list): Removed since GConf makes this useless.
(folder_list_from_vector): Likewise.
(str_list_from_vector): Likewise.
(vector_from_str_list): Likewise.
(make_initial_weather_list): Likewise.
(make_initial_rdf_list): Likewise.
(make_initial_mail_list): Likewise.
(e_summary_preferences_save): Use GConf.
(e_summary_preferences_init): No need to set up defaults here.
* e-summary.h: Changed members display_folders, rdf_urls, stations
in ESummaryPrefs to be GSLists instead of GLists; updated all the
functions that use them accordingly.
svn path=/trunk/; revision=18863
Diffstat (limited to 'my-evolution/e-summary-calendar.c')
-rw-r--r-- | my-evolution/e-summary-calendar.c | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c index 0bb57276e8..71b62829be 100644 --- a/my-evolution/e-summary-calendar.c +++ b/my-evolution/e-summary-calendar.c @@ -1,8 +1,7 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* e-summary-calendar.c * - * Copyright (C) 2001 Ximian, Inc. - * Copyright (C) 2002 Ximian, Inc. + * Copyright (C) 2001, 2002 Ximian, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public @@ -31,14 +30,14 @@ #include "e-summary-calendar.h" #include "e-summary.h" -#include "e-util/e-config-listener.h" - #include <cal-client/cal-client.h> #include <cal-util/timeutil.h> #include <bonobo/bonobo-exception.h> #include <bonobo/bonobo-moniker-util.h> +#include <gconf/gconf-client.h> + #include <ical.h> #define MAX_RELOAD_TRIES 10 @@ -51,7 +50,7 @@ struct _ESummaryCalendar { char *default_uri; - EConfigListener *config_listener; + GConfClient *gconf_client; int cal_open_reload_timeout_id; int reload_count; @@ -526,16 +525,6 @@ e_summary_calendar_protocol (ESummary *summary, bonobo_object_release_unref (factory, NULL); } -static gboolean -locale_uses_24h_time_format (void) -{ - char s[16]; - time_t t = 0; - - strftime (s, sizeof s, "%p", gmtime (&t)); - return s[0] == '\0'; -} - static void setup_calendar (ESummary *summary) { @@ -562,34 +551,38 @@ setup_calendar (ESummary *summary) if (! cal_client_open_default_calendar (calendar->client, FALSE)) g_message ("Open calendar failed"); - calendar->wants24hr = e_config_listener_get_boolean_with_default (calendar->config_listener, - "/Calendar/Display/Use24HourFormat", - locale_uses_24h_time_format (), NULL); - calendar->default_uri = e_config_listener_get_string_with_default (calendar->config_listener, - "/DefaultFolders/calendar_path", - "evolution:/local/Calendar", NULL); + calendar->wants24hr = gconf_client_get_bool (calendar->gconf_client, + "/apps/evolution/calendar/display/use_24h_format", NULL); + calendar->default_uri = gconf_client_get_string (calendar->gconf_client, + "/apps/evolution/shell/default_folders/celendar_path", + NULL); } static void -config_listener_key_changed_cb (EConfigListener *listener, - const char *key, - void *user_data) +gconf_client_value_changed_cb (GConfClient *client, + const char *key, + GConfValue *value, + void *user_data) { setup_calendar (E_SUMMARY (user_data)); generate_html (user_data); } static void -setup_config_listener (ESummary *summary) +setup_gconf_client (ESummary *summary) { ESummaryCalendar *calendar; calendar = summary->calendar; g_assert (calendar != NULL); - calendar->config_listener = e_config_listener_new (); + calendar->gconf_client = gconf_client_get_default (); - g_signal_connect (calendar->config_listener, "key_changed", G_CALLBACK (config_listener_key_changed_cb), summary); + g_signal_connect (calendar->gconf_client, "value_changed", + G_CALLBACK (gconf_client_value_changed_cb), summary); + + gconf_client_add_dir (calendar->gconf_client, "/apps/evolution/calendar", FALSE, NULL); + gconf_client_add_dir (calendar->gconf_client, "/apps/evolution/shell/default_folders", FALSE, NULL); setup_calendar (summary); } @@ -605,7 +598,7 @@ e_summary_calendar_init (ESummary *summary) summary->calendar = calendar; calendar->html = NULL; - setup_config_listener (summary); + setup_gconf_client (summary); setup_calendar (summary); e_summary_add_protocol_listener (summary, "calendar", e_summary_calendar_protocol, calendar); @@ -635,6 +628,8 @@ e_summary_calendar_free (ESummary *summary) g_free (calendar->html); g_free (calendar->default_uri); + g_object_unref (calendar->gconf_client); + g_free (calendar); summary->calendar = NULL; } |