Removing uses of timespec

This commit is contained in:
lmat 2017-11-13 12:10:39 -08:00 committed by Christopher Lam
parent 168f6d6740
commit e947214960
3 changed files with 10 additions and 11 deletions

View File

@ -3249,13 +3249,13 @@ gnc_option_set_ui_value_date (GNCOption *option, gboolean use_default,
}
else if (g_strcmp0(symbol_str, "absolute") == 0)
{
Timespec ts;
time64 time;
ts = gnc_date_option_value_get_absolute (value);
time = gnc_date_option_value_get_absolute (value);
if (g_strcmp0(date_option_type, "absolute") == 0)
{
gnc_date_edit_set_time(GNC_DATE_EDIT(widget), ts.tv_sec);
gnc_date_edit_set_time(GNC_DATE_EDIT(widget), time);
}
else if (g_strcmp0(date_option_type, "both") == 0)
{
@ -3267,7 +3267,7 @@ gnc_option_set_ui_value_date (GNCOption *option, gboolean use_default,
GNC_RD_WID_AB_WIDGET_POS);
g_list_free(widget_list);
gnc_date_option_set_select_method(option, TRUE, TRUE);
gnc_date_edit_set_time(GNC_DATE_EDIT(ab_widget), ts.tv_sec);
gnc_date_edit_set_time(GNC_DATE_EDIT(ab_widget), time);
}
else
{

View File

@ -1,6 +1,7 @@
/********************************************************************\
* option-util.c -- GNOME<->guile option interface *
* Copyright (C) 2000 Dave Peticolas *
* Copyright (C) 2017 Aaron Laws *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -2503,18 +2504,15 @@ gnc_date_option_value_get_type (SCM option_value)
* get the absolute time of a date option value *
* *
* Args: option_value - option value to get absolute time of *
* Return: Timespec value *
* Return: time64 value *
\*******************************************************************/
Timespec
time64
gnc_date_option_value_get_absolute (SCM option_value)
{
SCM value;
initialize_getters();
value = scm_call_1 (getters.date_option_value_absolute, option_value);
return gnc_timepair2timespec (value);
return gnc_timepair2timespec (value).tv_sec;
}
/*******************************************************************\

View File

@ -2,6 +2,7 @@
* option-util.h -- GNOME<->guile option interface *
* Copyright (C) 1998,1999 Linas Vepstas *
* Copyright (C) 2000 Dave Peticolas *
* Copyright (C) 2017 Aaron Laws *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -240,7 +241,7 @@ gboolean gnc_option_db_set_string_option(GNCOptionDB *odb,
char * gnc_option_date_option_get_subtype(GNCOption *option);
char * gnc_date_option_value_get_type (SCM option_value);
Timespec gnc_date_option_value_get_absolute (SCM option_value);
time64 gnc_date_option_value_get_absolute (SCM option_value);
SCM gnc_date_option_value_get_relative (SCM option_value);
char * gnc_plot_size_option_value_get_type (SCM option_value);