From 241a65b72b3620f85bad00fac28d268e5f47d2d6 Mon Sep 17 00:00:00 2001 From: Arturo Espinosa Date: Mon, 27 Sep 1999 20:56:29 +0000 Subject: Small fix -miguel svn path=/trunk/; revision=1265 --- calendar/gui/Makefile.am | 8 ++++---- calendar/gui/calendar-conduit.c | 4 ++-- calendar/gui/calendar-pilot-sync.c | 4 ++-- calendar/gui/calendar.c | 17 ++++++++++------- calendar/gui/eventedit.c | 26 +++++++++++++------------- calendar/gui/gncal-day-panel.c | 8 ++++---- calendar/gui/gncal-todo.c | 6 +++--- calendar/gui/gnome-cal.c | 1 + calendar/gui/gnome-month-item.c | 8 ++++---- calendar/gui/goto.c | 18 +++++++++--------- calendar/gui/month-view.c | 24 ++++++++++++------------ calendar/gui/prop.c | 10 +++++----- calendar/gui/year-view.c | 16 ++++++++-------- 13 files changed, 77 insertions(+), 73 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am index 90aa6c628b..5ed3d8fbae 100644 --- a/calendar/gui/Makefile.am +++ b/calendar/gui/Makefile.am @@ -9,16 +9,16 @@ gnorba_DATA = gnomecal.gnorba help_base = $(datadir)/gnome/help/cal if HAVE_GNOME_PILOT -bin_PROGRAMS = gnomecal todo-conduit-control-applet calendar-conduit-control-applet +bin_PROGRAMS = gnomecal todo-conduit-control-applet calendar-conduit-control-appleta calendar-pilot-sync else bin_PROGRAMS = gnomecal endif -INCLUDES = \ +INCLUDES = \ -I$(includedir) \ $(GNOME_INCLUDEDIR) \ - $(GNOME_CONDUIT_INCLUDEDIR) \ - $(PISOCK_INCLUDEDIR) \ + $(GNOME_CONDUIT_INCLUDEDIR) \ + $(PISOCK_INCLUDEDIR) \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" GNOMECAL_CORBA_GENERATED = \ diff --git a/calendar/gui/calendar-conduit.c b/calendar/gui/calendar-conduit.c index 3fd110100a..68bcae0887 100644 --- a/calendar/gui/calendar-conduit.c +++ b/calendar/gui/calendar-conduit.c @@ -425,9 +425,9 @@ ical_from_remote_record(GnomePilotConduitStandardAbs *conduit, obj->recur->weekday |= 1 << wd; if (obj->recur->weekday == 0){ - struct tm *tm = localtime (&obj->dtstart); + struct tm tm = *localtime (&obj->dtstart); - obj->recur->weekday = 1 << tm->tm_wday; + obj->recur->weekday = 1 << tm.tm_wday; } break; } diff --git a/calendar/gui/calendar-pilot-sync.c b/calendar/gui/calendar-pilot-sync.c index e8261197af..f4bc821500 100644 --- a/calendar/gui/calendar-pilot-sync.c +++ b/calendar/gui/calendar-pilot-sync.c @@ -245,9 +245,9 @@ update_record (GNOME_Calendar_Repository repo, int id, struct Appointment *a, in obj->recur->weekday |= 1 << wd; if (obj->recur->weekday == 0){ - struct tm *tm = localtime (&obj->dtstart); + struct tm tm = *localtime (&obj->dtstart); - obj->recur->weekday = 1 << tm->tm_wday; + obj->recur->weekday = 1 << tm.tm_wday; } break; } diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c index e6c6dddf59..cffd2476c4 100644 --- a/calendar/gui/calendar.c +++ b/calendar/gui/calendar.c @@ -358,15 +358,15 @@ vcalendar_create_from_calendar (Calendar *cal) VObject *vcal; GList *l; time_t now = time (NULL); - struct tm *tm; + struct tm tm; /* WE call localtime for the side effect of setting tzname */ - tm = localtime (&now); + tm = *localtime (&now); vcal = newVObject (VCCalProp); addPropValue (vcal, VCProdIdProp, "-//GNOME//NONSGML GnomeCalendar//EN"); #if defined(HAVE_TM_ZONE) - addPropValue (vcal, VCTimeZoneProp, tm->tm_zone); + addPropValue (vcal, VCTimeZoneProp, tm.tm_zone); #elif defined(HAVE_TZNAME) addPropValue (vcal, VCTimeZoneProp, tzname[0]); #endif @@ -391,6 +391,9 @@ vcalendar_create_from_calendar (Calendar *cal) addVObjectProp (vcal, obj); } + cleanVObject (vcal); + cleanStrTbl (); + return vcal; } @@ -417,8 +420,8 @@ calendar_save (Calendar *cal, char *fname) g_free (backup_name); } - fp = fopen(fname,"w"); - if (fp) { + fp = fopen(fname,"w"); + if (fp) { writeVObject(fp, vcal); fclose(fp); if (strcmp(cal->filename, fname)) { @@ -430,10 +433,10 @@ calendar_save (Calendar *cal, char *fname) cal->file_time = s.st_mtime; } else { dlg = gnome_message_box_new(_("Failed to save calendar!"), - GNOME_MESSAGE_BOX_ERROR, "Ok", NULL); + GNOME_MESSAGE_BOX_ERROR, "Ok", NULL); gtk_widget_show(dlg); } - + cleanVObject (vcal); cleanStrTbl (); } diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c index ea15cd0d7f..926bb6f09c 100644 --- a/calendar/gui/eventedit.c +++ b/calendar/gui/eventedit.c @@ -182,22 +182,22 @@ check_times (GnomeDateEdit *gde, EventEditor *ee) static void set_all_day (GtkToggleButton *toggle, EventEditor *ee) { - struct tm *tm; + struct tm tm; time_t start_t; start_t = gnome_date_edit_get_date (GNOME_DATE_EDIT (ee->start_time)); - tm = localtime (&start_t); - tm->tm_hour = day_begin; - tm->tm_min = 0; - tm->tm_sec = 0; - gnome_date_edit_set_time (GNOME_DATE_EDIT (ee->start_time), mktime (tm)); + tm = *localtime (&start_t); + tm.tm_hour = day_begin; + tm.tm_min = 0; + tm.tm_sec = 0; + gnome_date_edit_set_time (GNOME_DATE_EDIT (ee->start_time), mktime (&tm)); if (toggle->active) - tm->tm_hour = day_end; + tm.tm_hour = day_end; else - tm->tm_hour++; + tm.tm_hour++; - gnome_date_edit_set_time (GNOME_DATE_EDIT (ee->end_time), mktime (tm)); + gnome_date_edit_set_time (GNOME_DATE_EDIT (ee->end_time), mktime (&tm)); } /* Convenience function to create a properly-configured date editor widget */ @@ -951,9 +951,9 @@ ee_rp_init_rule (EventEditor *ee) GSList *group; int i, page, day_period, week_period, month_period, year_period; int week_vector, default_day, def_pos, def_off; - struct tm *tm; + struct tm tm; - tm = localtime (&ee->ical->dtstart); + tm = *localtime (&ee->ical->dtstart); f = gtk_frame_new (_("Recurrence rule")); @@ -977,8 +977,8 @@ ee_rp_init_rule (EventEditor *ee) /* Default to today */ - week_vector = 1 << tm->tm_wday; - default_day = tm->tm_mday; + week_vector = 1 << tm.tm_wday; + default_day = tm.tm_mday; def_pos = 0; def_off = 0; diff --git a/calendar/gui/gncal-day-panel.c b/calendar/gui/gncal-day-panel.c index bd91a18346..f041e3d6dd 100644 --- a/calendar/gui/gncal-day-panel.c +++ b/calendar/gui/gncal-day-panel.c @@ -95,7 +95,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day) { GncalDayPanel *dpanel; GtkWidget *w; - struct tm *tm; + struct tm tm; g_return_val_if_fail (calendar != NULL, NULL); @@ -148,7 +148,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day) /* Gtk calendar */ - tm = localtime (&start_of_day); + tm = *localtime (&start_of_day); w = gtk_calendar_new (); dpanel->gtk_calendar = GTK_CALENDAR (w); @@ -157,8 +157,8 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day) | GTK_CALENDAR_SHOW_DAY_NAMES | (week_starts_on_monday ? GTK_CALENDAR_WEEK_START_MONDAY : 0))); - gtk_calendar_select_month (dpanel->gtk_calendar, tm->tm_mon, tm->tm_year + 1900); - gtk_calendar_select_day (dpanel->gtk_calendar, tm->tm_mday); + gtk_calendar_select_month (dpanel->gtk_calendar, tm.tm_mon, tm.tm_year + 1900); + gtk_calendar_select_day (dpanel->gtk_calendar, tm.tm_mday); dpanel->day_selected_id = gtk_signal_connect (GTK_OBJECT (dpanel->gtk_calendar), "day_selected_double_click", (GtkSignalFunc) calendar_day_selected, diff --git a/calendar/gui/gncal-todo.c b/calendar/gui/gncal-todo.c index 05611e14e8..941eddf453 100644 --- a/calendar/gui/gncal-todo.c +++ b/calendar/gui/gncal-todo.c @@ -515,10 +515,10 @@ static char * convert_time_t_to_char (time_t t) { char buf[100]; - struct tm *tm; + struct tm tm; - tm = localtime (&t); - strftime(buf, sizeof (buf), "%m/%d/%Y", tm); + tm = *localtime (&t); + strftime(buf, sizeof (buf), "%m/%d/%Y", &tm); return g_strdup (buf); } diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 21d9b78969..88e2f0bdce 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -18,6 +18,7 @@ #include "year-view.h" #include "timeutil.h" #include "main.h" +#include "corba-cal.h" GnomeApp *parent_class; diff --git a/calendar/gui/gnome-month-item.c b/calendar/gui/gnome-month-item.c index 4b8a9d75ac..58e393e4ee 100644 --- a/calendar/gui/gnome-month-item.c +++ b/calendar/gui/gnome-month-item.c @@ -749,15 +749,15 @@ static void gnome_month_item_init (GnomeMonthItem *mitem) { time_t t; - struct tm *tm; + struct tm tm; /* Initialize to the current month by default */ t = time (NULL); - tm = localtime (&t); + tm = *localtime (&t); - mitem->year = tm->tm_year + 1900; - mitem->month = tm->tm_mon; + mitem->year = tm.tm_year + 1900; + mitem->month = tm.tm_mon; mitem->x = 0.0; mitem->y = 0.0; diff --git a/calendar/gui/goto.c b/calendar/gui/goto.c index 20479889aa..41609da678 100644 --- a/calendar/gui/goto.c +++ b/calendar/gui/goto.c @@ -28,7 +28,7 @@ update (void) { GnomeCanvasItem *item; time_t t; - struct tm *tm; + struct tm tm; unmark_month_item (month_item); mark_month_item (month_item, gnome_calendar->cal); @@ -44,10 +44,10 @@ update (void) } t = time (NULL); - tm = localtime (&t); + tm = *localtime (&t); - if (((tm->tm_year + 1900) == month_item->year) && (tm->tm_mon == month_item->month)) { - current_index = gnome_month_item_day2index (month_item, tm->tm_mday); + if (((tm.tm_year + 1900) == month_item->year) && (tm.tm_mon == month_item->month)) { + current_index = gnome_month_item_day2index (month_item, tm.tm_mday); g_assert (current_index != -1); item = gnome_month_item_num2child (month_item, @@ -254,12 +254,12 @@ goto_dialog (GnomeCalendar *gcal) GtkWidget *hbox; GtkWidget *w; GtkWidget *days; - struct tm *tm; + struct tm tm; gnome_calendar = gcal; current_index = -1; - tm = localtime (&gnome_calendar->current_display); + tm = *localtime (&gnome_calendar->current_display); goto_win = gnome_dialog_new (_("Go to date"), GNOME_STOCK_BUTTON_CANCEL, @@ -282,17 +282,17 @@ goto_dialog (GnomeCalendar *gcal) * month_item to be created. */ - days = create_days (tm->tm_mday, tm->tm_mon, tm->tm_year + 1900); + days = create_days (tm.tm_mday, tm.tm_mon, tm.tm_year + 1900); /* Year */ - w = create_year (tm->tm_year + 1900); + w = create_year (tm.tm_year + 1900); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); /* Month */ - w = create_months (tm->tm_mon); + w = create_months (tm.tm_mon); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); diff --git a/calendar/gui/month-view.c b/calendar/gui/month-view.c index 8f74d43d60..5df7b7a23d 100644 --- a/calendar/gui/month-view.c +++ b/calendar/gui/month-view.c @@ -621,7 +621,7 @@ static int add_event (iCalObject *ico, time_t start, time_t end, void *data) { struct iter_info *ii; - struct tm *tm; + struct tm tm; time_t t; time_t day_begin_time, day_end_time; @@ -638,8 +638,8 @@ add_event (iCalObject *ico, time_t start, time_t end, void *data) */ do { - tm = localtime (&day_begin_time); - g_string_sprintfa (ii->strings[ii->first_day_index + tm->tm_mday - 1], "%s\n", ico->summary); + tm = *localtime (&day_begin_time); + g_string_sprintfa (ii->strings[ii->first_day_index + tm.tm_mday - 1], "%s\n", ico->summary); /* Next day */ @@ -703,7 +703,7 @@ static void mark_current_day (MonthView *mv) { time_t t; - struct tm *tm; + struct tm tm; GnomeCanvasItem *item; /* Unmark the old day */ @@ -722,10 +722,10 @@ mark_current_day (MonthView *mv) /* Mark the new day */ t = time (NULL); - tm = localtime (&t); + tm = *localtime (&t); - if (((tm->tm_year + 1900) == mv->year) && (tm->tm_mon == mv->month)) { - mv->old_current_index = gnome_month_item_day2index (GNOME_MONTH_ITEM (mv->mitem), tm->tm_mday); + if (((tm.tm_year + 1900) == mv->year) && (tm.tm_mon == mv->month)) { + mv->old_current_index = gnome_month_item_day2index (GNOME_MONTH_ITEM (mv->mitem), tm.tm_mday); g_assert (mv->old_current_index != -1); item = gnome_month_item_num2child (GNOME_MONTH_ITEM (mv->mitem), @@ -740,7 +740,7 @@ mark_current_day (MonthView *mv) void month_view_set (MonthView *mv, time_t month) { - struct tm *tm; + struct tm tm; char buf[100]; g_return_if_fail (mv != NULL); @@ -748,12 +748,12 @@ month_view_set (MonthView *mv, time_t month) /* Title */ - tm = localtime (&month); + tm = *localtime (&month); - mv->year = tm->tm_year + 1900; - mv->month = tm->tm_mon; + mv->year = tm.tm_year + 1900; + mv->month = tm.tm_mon; - strftime (buf, 100, _("%B %Y"), tm); + strftime (buf, 100, _("%B %Y"), &tm); gnome_canvas_item_set (mv->title, "text", buf, diff --git a/calendar/gui/prop.c b/calendar/gui/prop.c index 87fad703f4..129407293b 100644 --- a/calendar/gui/prop.c +++ b/calendar/gui/prop.c @@ -412,7 +412,7 @@ fake_mark_days (void) static void set_current_day (void) { - struct tm *tm; + struct tm tm; time_t t; GnomeCanvasItem *item; int day_index; @@ -420,16 +420,16 @@ set_current_day (void) /* Set the date */ t = time (NULL); - tm = localtime (&t); + tm = *localtime (&t); gnome_canvas_item_set (month_item, - "year", tm->tm_year + 1900, - "month", tm->tm_mon, + "year", tm.tm_year + 1900, + "month", tm.tm_mon, NULL); /* Highlight current day */ - day_index = gnome_month_item_day2index (GNOME_MONTH_ITEM (month_item), tm->tm_mday); + day_index = gnome_month_item_day2index (GNOME_MONTH_ITEM (month_item), tm.tm_mday); item = gnome_month_item_num2child (GNOME_MONTH_ITEM (month_item), GNOME_MONTH_ITEM_DAY_LABEL + day_index); gnome_canvas_item_set (item, "fill_color", color_spec_from_picker (COLOR_PROP_CURRENT_DAY_FG), diff --git a/calendar/gui/year-view.c b/calendar/gui/year-view.c index 6b338bfdec..5744b4a88f 100644 --- a/calendar/gui/year-view.c +++ b/calendar/gui/year-view.c @@ -629,7 +629,7 @@ static void mark_current_day (YearView *yv) { time_t t; - struct tm *tm; + struct tm tm; int month_index, day_index; GnomeCanvasItem *item; @@ -652,11 +652,11 @@ mark_current_day (YearView *yv) /* Mark the new day */ t = time (NULL); - tm = localtime (&t); + tm = *localtime (&t); - if ((tm->tm_year + 1900) == yv->year) { - month_index = tm->tm_mon; - day_index = gnome_month_item_day2index (GNOME_MONTH_ITEM (yv->mitems[month_index]), tm->tm_mday); + if ((tm.tm_year + 1900) == yv->year) { + month_index = tm.tm_mon; + day_index = gnome_month_item_day2index (GNOME_MONTH_ITEM (yv->mitems[month_index]), tm.tm_mday); g_assert (day_index != -1); item = gnome_month_item_num2child (GNOME_MONTH_ITEM (yv->mitems[month_index]), @@ -673,15 +673,15 @@ mark_current_day (YearView *yv) void year_view_set (YearView *yv, time_t year) { - struct tm *tm; + struct tm tm; char buf[100]; int i; g_return_if_fail (yv != NULL); g_return_if_fail (IS_YEAR_VIEW (yv)); - tm = localtime (&year); - yv->year = tm->tm_year + 1900; + tm = *localtime (&year); + yv->year = tm.tm_year + 1900; /* Heading */ -- cgit