utils: Rename gcal_clear_datetime to gcal_clear_date_time

To keep it consistent with the rest of the API.
This commit is contained in:
Georges Basile Stavracas Neto
2019-04-26 13:27:37 -03:00
parent 21c74baed8
commit ab1c0b6ca4
18 changed files with 37 additions and 100 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ gcal_set_date_time (GDateTime **dest,
{
gboolean changed = *dest != src;
gcal_clear_datetime (dest);
gcal_clear_date_time (dest);
if (src)
*dest = g_date_time_ref (src);
+2 -2
View File
@@ -25,12 +25,12 @@
G_BEGIN_DECLS
/**
* gcal_clear_datetime:
* gcal_clear_date_time:
* @dt: location of a #GDateTime pointer
*
* Unreferences @dt if not %NULL, and set it to %NULL.
*/
#define gcal_clear_datetime(dt) g_clear_pointer (dt, g_date_time_unref)
#define gcal_clear_date_time(dt) g_clear_pointer (dt, g_date_time_unref)
gboolean gcal_set_date_time (GDateTime **dest,
GDateTime *src);
-59
View File
@@ -634,65 +634,6 @@ icaltime_compare_with_current (const icaltimetype *date1,
return result;
}
/**
* get_start_of_week:
* @date: an #icaltimetype
*
* Retrieves the start of the week that @date
* falls in. This function already takes the
* first weekday into account.
*
* Returns: (transfer full): a #GDateTime with
* the start of the week.
*/
GDateTime*
get_start_of_week (icaltimetype *date)
{
icaltimetype *new_date;
GDateTime *dt;
new_date = g_new0 (icaltimetype, 1);
*new_date = icaltime_from_day_of_year (icaltime_start_doy_week (*date, get_first_weekday () + 1),
date->year);
new_date->is_date = 0;
new_date->hour = 0;
new_date->minute = 0;
new_date->second = 0;
dt = g_date_time_new_local (new_date->year,
new_date->month,
new_date->day,
0, 0, 0);
g_clear_pointer (&new_date, g_free);
return dt;
}
/**
* get_end_of_week:
* @date: an #icaltimetype
*
* Retrieves the end of the week that @date
* falls in. This function already takes the
* first weekday into account.
*
* Returns: (transfer full): a #GDateTime with
* the end of the week.
*/
GDateTime*
get_end_of_week (icaltimetype *date)
{
GDateTime *week_start, *week_end;
week_start = get_start_of_week (date);
week_end = g_date_time_add_days (week_start, 7);
g_clear_pointer (&week_start, g_date_time_unref);
return week_end;
}
/**
* is_clock_format_24h:
*
-4
View File
@@ -87,10 +87,6 @@ gint icaltime_compare_with_current (const icaltime
const icaltimetype *date2,
time_t *current_time_t);
GDateTime* get_start_of_week (icaltimetype *date);
GDateTime* get_end_of_week (icaltimetype *date);
gboolean is_clock_format_24h (void);
/* code brought from evolution */