aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog13
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.c11
-rw-r--r--calendar/gui/e-tasks.c21
-rw-r--r--calendar/gui/e-tasks.h2
-rw-r--r--calendar/gui/tasks-control.c9
5 files changed, 31 insertions, 25 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index bb8c794a1e..5c6a6a0750 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,18 @@
2003-10-30 Rodrigo Moya <rodrigo@ximian.com>
+ * gui/e-tasks.[ch] (e_tasks_get_cal_client): removed.
+
+ * gui/tasks-control.c (sensitize_commands): fixed to work correctly
+ with the ECalView's model.
+ (tasks_control_set_property): don't use e_tasks_get_cal_client.
+
+ * gui/alarm-notify/alarm-notify.c (free_client_hash): new function
+ to remove items from the CalClient's hash table.
+ (alarm_notify_finalize): call free_client_hash() for each item
+ in the hash table.
+
+2003-10-30 Rodrigo Moya <rodrigo@ximian.com>
+
* gui/alarm-notify/notify-main.c (client_die_cb): use
bonobo_main_quit, not gtk_main_quit.
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
index 006533c6bf..ce73223afb 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/gui/alarm-notify/alarm-notify.c
@@ -88,6 +88,16 @@ alarm_notify_init (AlarmNotify *an, AlarmNotifyClass *klass)
priv->uri_client_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
}
+static void
+free_client_hash (gpointer key, gpointer value, gpointer user_data)
+{
+ char *uri = key;
+ CalClient *client = value;
+
+ g_free (uri);
+ g_object_unref (client);
+}
+
/* Finalize handler for the alarm notify system */
static void
alarm_notify_finalize (GObject *object)
@@ -101,6 +111,7 @@ alarm_notify_finalize (GObject *object)
an = ALARM_NOTIFY (object);
priv = an->priv;
+ g_hash_table_foreach (priv->uri_client_hash, (GHFunc) free_client_hash, NULL);
g_hash_table_destroy (priv->uri_client_hash);
g_free (priv);
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index cf4d79ba41..d094b3af56 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -857,27 +857,6 @@ backend_error_cb (CalClient *client, const char *message, gpointer data)
g_free (urinopwd);
}
-/**
- * e_tasks_get_cal_client:
- * @tasks: An #ETasks.
- *
- * Queries the calendar client interface object that a tasks view is using.
- *
- * Return value: A calendar client interface object.
- **/
-CalClient *
-e_tasks_get_cal_client (ETasks *tasks)
-{
- ETasksPrivate *priv;
-
- g_return_val_if_fail (E_IS_TASKS (tasks), NULL);
-
- priv = tasks->priv;
-
- return priv->client;
-}
-
-
void
e_tasks_new_task (ETasks *tasks)
{
diff --git a/calendar/gui/e-tasks.h b/calendar/gui/e-tasks.h
index e901a7608f..efa2ea2d1e 100644
--- a/calendar/gui/e-tasks.h
+++ b/calendar/gui/e-tasks.h
@@ -67,8 +67,6 @@ void e_tasks_set_ui_component (ETasks *tasks,
gboolean e_tasks_open (ETasks *tasks,
char *file);
-CalClient *e_tasks_get_cal_client (ETasks *tasks);
-
void e_tasks_new_task (ETasks *tasks);
void e_tasks_complete_selected (ETasks *tasks);
void e_tasks_delete_selected (ETasks *tasks);
diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c
index e0482b2d77..2729416ca8 100644
--- a/calendar/gui/tasks-control.c
+++ b/calendar/gui/tasks-control.c
@@ -47,6 +47,7 @@
#include "calendar-config.h"
#include "calendar-commands.h"
#include "e-tasks.h"
+#include "e-calendar-table.h"
#include "tasks-control.h"
#include "evolution-shell-component-utils.h"
@@ -162,11 +163,13 @@ tasks_control_get_property (BonoboPropertyBag *bag,
{
ETasks *tasks = user_data;
const char *uri;
+ ECalModel *model;
switch (arg_id) {
case TASKS_CONTROL_PROPERTY_URI_IDX:
- uri = cal_client_get_uri (e_tasks_get_cal_client (tasks));
+ model = e_calendar_table_get_model (e_tasks_get_calendar_table (tasks));
+ uri = cal_client_get_uri (e_cal_model_get_default_client (model));
BONOBO_ARG_SET_STRING (arg, uri);
break;
@@ -231,11 +234,13 @@ sensitize_commands (ETasks *tasks, BonoboControl *control, int n_selected)
{
BonoboUIComponent *uic;
gboolean read_only = TRUE;
+ ECalModel *model;
uic = bonobo_control_get_ui_component (control);
g_assert (uic != NULL);
- cal_client_is_read_only (e_tasks_get_cal_client (tasks), &read_only, NULL);
+ model = e_calendar_table_get_model (e_tasks_get_calendar_table (tasks));
+ cal_client_is_read_only (e_cal_model_get_default_client (model), &read_only, NULL);
bonobo_ui_component_set_prop (uic, "/commands/TasksCut", "sensitive",
n_selected == 0 || read_only ? "0" : "1",