aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/e-summary-tasks.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-11-21 05:57:43 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-11-21 05:57:43 +0800
commitba846b6b545490d957af46038c9b686b440ca25a (patch)
tree9928fe710ac606e1a49b908e244ea1a3b6ad3fc8 /my-evolution/e-summary-tasks.c
parent37cdfc6c84183613ed796cc218e60e78e07ddc0a (diff)
downloadgsoc2013-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-tasks.c')
-rw-r--r--my-evolution/e-summary-tasks.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/my-evolution/e-summary-tasks.c b/my-evolution/e-summary-tasks.c
index 7763f248ad..3f0ba8ab73 100644
--- a/my-evolution/e-summary-tasks.c
+++ b/my-evolution/e-summary-tasks.c
@@ -31,8 +31,6 @@
#include "e-summary-tasks.h"
#include "e-summary.h"
-#include "e-util/e-config-listener.h"
-
#include <cal-client/cal-client.h>
#include <cal-util/timeutil.h>
@@ -42,6 +40,9 @@
#include <bonobo/bonobo-moniker-util.h>
#include <bonobo/bonobo-object.h>
+#include <gconf/gconf-client.h>
+
+
#define MAX_RELOAD_TRIES 10
struct _ESummaryTasks {
@@ -53,7 +54,7 @@ struct _ESummaryTasks {
char *default_uri;
- EConfigListener *config_listener;
+ GConfClient *gconf_client;
int cal_open_reload_timeout_id;
int reload_count;
@@ -478,7 +479,7 @@ setup_task_folder (ESummary *summary)
tasks = summary->tasks;
g_assert (tasks != NULL);
- g_assert (tasks->config_listener != NULL);
+ g_assert (tasks->gconf_client != NULL);
if (tasks->cal_open_reload_timeout_id != 0) {
g_source_remove (tasks->cal_open_reload_timeout_id);
@@ -490,15 +491,13 @@ setup_task_folder (ESummary *summary)
g_free (tasks->overdue_colour);
g_free (tasks->default_uri);
- tasks->due_today_colour = e_config_listener_get_string_with_default (tasks->config_listener,
- "/Calendar/Tasks/Colors/TasksDueToday", "blue", NULL);
- tasks->overdue_colour = e_config_listener_get_string_with_default (tasks->config_listener,
- "/Calendar/Tasks/Colors/TasksOverdue", "red", NULL);
+ tasks->due_today_colour = gconf_client_get_string (tasks->gconf_client,
+ "/apps/evolution/calendar/tasks/colors/TasksDueToday", NULL);
+ tasks->overdue_colour = gconf_client_get_string (tasks->gconf_client,
+ "/apps/evolution/calendar/tasks/colors/TasksOverdue", NULL);
- tasks->default_uri = e_config_listener_get_string_with_default (tasks->config_listener,
- "/DefaultFolders/tasks_path",
- NULL,
- NULL);
+ tasks->default_uri = gconf_client_get_string (tasks->gconf_client,
+ "/apps/evolution/shell/default_folders/tasks_path", NULL);
if (tasks->client != NULL)
g_object_unref (tasks->client);
@@ -518,26 +517,30 @@ setup_task_folder (ESummary *summary)
}
static void
-config_listener_key_changed_cb (EConfigListener *config_listener,
- const char *key,
- void *user_data)
+gconf_client_value_changed_cb (GConfClient *gconf_client,
+ const char *key,
+ GConfValue *value,
+ void *user_data)
{
setup_task_folder (E_SUMMARY (user_data));
-
generate_html (user_data);
}
static void
-setup_config_listener (ESummary *summary)
+setup_gconf_client (ESummary *summary)
{
ESummaryTasks *tasks;
tasks = summary->tasks;
g_assert (tasks != NULL);
- tasks->config_listener = e_config_listener_new ();
+ tasks->gconf_client = gconf_client_get_default ();
+
+ gconf_client_add_dir (tasks->gconf_client, "/apps/evolution/calendar/tasks/colors", FALSE, NULL);
+ gconf_client_add_dir (tasks->gconf_client, "/apps/evolution/shell/default_folders", FALSE, NULL);
- g_signal_connect (tasks->config_listener, "key_changed", G_CALLBACK (config_listener_key_changed_cb), summary);
+ g_signal_connect (tasks->gconf_client, "value_changed",
+ G_CALLBACK (gconf_client_value_changed_cb), summary);
}
void
@@ -548,11 +551,10 @@ e_summary_tasks_init (ESummary *summary)
g_return_if_fail (summary != NULL);
tasks = g_new0 (ESummaryTasks, 1);
- tasks->config_listener = e_config_listener_new ();
summary->tasks = tasks;
- setup_config_listener (summary);
+ setup_gconf_client (summary);
setup_task_folder (summary);
e_summary_add_protocol_listener (summary, "tasks", e_summary_tasks_protocol, tasks);
@@ -584,7 +586,7 @@ e_summary_tasks_free (ESummary *summary)
g_free (tasks->overdue_colour);
g_free (tasks->default_uri);
- g_object_unref (tasks->config_listener);
+ g_object_unref (tasks->gconf_client);
g_free (tasks);
summary->tasks = NULL;