diff options
-rw-r--r-- | filter/ChangeLog | 5 | ||||
-rw-r--r-- | filter/filter-datespec.c | 22 |
2 files changed, 16 insertions, 11 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index dde50f03db..72e57bd460 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,8 @@ +2002-08-01 Peter Williams <peterw@ximian.com> + + * filter-datespec.c (activate_specified): If the value was unset, + initialize it to now. + 2002-07-31 Ettore Perazzoli <ettore@ximian.com> * filter-option.c (xml_create): Remove unused variable. diff --git a/filter/filter-datespec.c b/filter/filter-datespec.c index dd8f02614e..ae0683e0f2 100644 --- a/filter/filter-datespec.c +++ b/filter/filter-datespec.c @@ -313,18 +313,18 @@ activate_specified (GtkMenuItem *item, FilterDatespec *fds) PRIV (fds)->selected_type = FDST_SPECIFIED; /* Set the calendar's time */ + + if (fds->value < 1) + fds->value = time (NULL); + + /* gmtime? */ + seltime = localtime (&(fds->value)); - if (fds->value > 0) { - /* gmtime? */ - seltime = localtime (&(fds->value)); - - gtk_calendar_select_month (GTK_CALENDAR (PRIV (fds)->date_chooser), - seltime->tm_mon, - seltime->tm_year + 1900); - gtk_calendar_select_day (GTK_CALENDAR (PRIV (fds)->date_chooser), - seltime->tm_mday); - /* free seltime?? */ - } + gtk_calendar_select_month (GTK_CALENDAR (PRIV (fds)->date_chooser), + seltime->tm_mon, + seltime->tm_year + 1900); + gtk_calendar_select_day (GTK_CALENDAR (PRIV (fds)->date_chooser), + seltime->tm_mday); gtk_box_pack_start (GTK_BOX (PRIV (fds)->gd->vbox), PRIV (fds)->date_chooser, |