From 0a6f70d432d62ed09dcc3dda1eaa0fb9ed35065e Mon Sep 17 00:00:00 2001 From: Jesse Pavel Date: Thu, 26 Oct 2000 20:51:24 +0000 Subject: Small fixes. svn path=/trunk/; revision=6211 --- calendar/ChangeLog | 6 ++++ calendar/gui/Makefile.am | 4 +-- calendar/gui/e-meeting-edit.c | 75 ++++++++++++++++++++++++++++++------------- 3 files changed, 60 insertions(+), 25 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index cfd103f970..e5233376cc 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,9 @@ +2000-10-25 Jesse Pavel + + * gui/e-meeting-edit.c: brushed up some code to deal with + the organizer entry, and solidified the CORBA memory-freeing + issues. + 2000-10-25 Jesse Pavel * removed the Evolution-Composer generated files, due diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am index 63dd31d327..8ab648e90e 100644 --- a/calendar/gui/Makefile.am +++ b/calendar/gui/Makefile.am @@ -61,9 +61,7 @@ glade_DATA = \ glade_messages = event-editor-dialog.glade.h evolution_calendar_SOURCES = \ - Evolution-Composer.h \ - Evolution-Composer-common.c \ - Evolution-Composer-stubs.c \ + $(IDL_GENERATED) \ alarm.c \ alarm.h \ calendar-config.c \ diff --git a/calendar/gui/e-meeting-edit.c b/calendar/gui/e-meeting-edit.c index 54283f3f35..55bfdd8a3b 100644 --- a/calendar/gui/e-meeting-edit.c +++ b/calendar/gui/e-meeting-edit.c @@ -99,40 +99,49 @@ get_icalparam_by_type (icalproperty *prop, icalparameter_kind kind) } +static void +save_organizer (EMeetingEditorPrivate *priv) +{ + icalproperty *prop; + icalvalue *value; + gchar *text; + + /* Save the organizer into the iCAL object. */ + + text = gtk_entry_get_text (GTK_ENTRY (priv->organizer_entry)); + if (strlen (text) > 0) { + gchar buffer[200]; + g_snprintf (buffer, 190, "MAILTO:%s", text); + + prop = icalcomponent_get_first_property (priv->vevent, ICAL_ORGANIZER_PROPERTY); + if (prop == NULL) { + /* We need to add an ORGANIZER property. */ + prop = icalproperty_new (ICAL_ORGANIZER_PROPERTY); + icalcomponent_add_property (priv->vevent, prop); + } + value = icalvalue_new_text (buffer); + icalproperty_set_value (prop, value); + } +} + + + static gboolean window_delete_cb (GtkWidget *widget, GdkEvent *event, gpointer data) { EMeetingEditorPrivate *priv; - gchar *text; priv = (EMeetingEditorPrivate *) ((EMeetingEditor *)data)->priv; + save_organizer (priv); + if (priv->dirty == TRUE) { /* FIXME: notify the event editor that our data has changed. For now, I'll just display a dialog box. */ { GtkWidget *dialog; - icalproperty *prop; - icalvalue *value; - - /* Save the organizer into the iCAL object. */ - prop = icalcomponent_get_first_property (priv->vevent, ICAL_ORGANIZER_PROPERTY); - - text = gtk_entry_get_text (GTK_ENTRY (priv->organizer_entry)); - if (strlen (text) > 0) { - gchar buffer[200]; - g_snprintf (buffer, 190, "MAILTO:%s", text); - - if (prop == NULL) { - /* We need to add an ORGANIZER property. */ - prop = icalproperty_new (ICAL_ORGANIZER_PROPERTY); - icalcomponent_add_property (priv->vevent, prop); - } - value = icalvalue_new_text (buffer); - icalproperty_set_value (prop, value); - } dialog = gnome_warning_dialog_parented ("Note that the meeting has changed,\n" "and you should save this event.", @@ -588,6 +597,8 @@ send_button_clicked_cb (GtkWidget *widget, gpointer data) icalvalue *value; gchar *ical_string; + save_organizer (priv); + comp = icalcomponent_new (ICAL_VCALENDAR_COMPONENT); prop = icalproperty_new (ICAL_PRODID_PROPERTY); @@ -615,6 +626,18 @@ send_button_clicked_cb (GtkWidget *widget, gpointer data) icalcomponent_free (comp); } + + /******** + * This is for debugging. + ********/ + { + FILE *fp = fopen ("/home/jpavel/attach_data.icl", "w"); + + fputs (attach_data, fp); + + fclose (fp); + } + Evolution_Composer_attach_data (composer_server, content_type, filename, description, show_inline, attach_data, @@ -637,14 +660,22 @@ send_button_clicked_cb (GtkWidget *widget, gpointer data) CORBA_exception_free (&ev); /* Let's free shit up. */ + + /* Beware--depending on whether CORBA_free is recursive, which I + think is is, we might have memory leaks, in which case the code + below is necessary. */ +#if 0 for (cntr = 0; cntr < priv->numentries; cntr++) { recipient = &(to_list->_buffer[cntr]); CORBA_free (recipient->name); CORBA_free (recipient->address); recipient->name = recipient->address = NULL; } +#endif + + if (CORBA_sequence_get_release (to_list) != FALSE) + CORBA_free (to_list->_buffer); - CORBA_free (to_list->_buffer); CORBA_free (to_list); CORBA_free (cc_list); CORBA_free (bcc_list); @@ -655,7 +686,7 @@ send_button_clicked_cb (GtkWidget *widget, gpointer data) CORBA_free (description); CORBA_free (attach_data); - bonobo_object_unref (BONOBO_OBJECT (bonobo_server)); + bonobo_object_unref (BONOBO_OBJECT (bonobo_server)); } -- cgit v1.2.3