[gnome-calendar] event: refactor gcal_event_is_multiday
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] event: refactor gcal_event_is_multiday
- Date: Thu, 14 Sep 2017 17:06:34 +0000 (UTC)
commit 8a2376ae55b94d18807a6702709d586befc7b656
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Sep 14 14:05:53 2017 -0300
event: refactor gcal_event_is_multiday
src/gcal-event.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-event.c b/src/gcal-event.c
index e3dd041..789f67c 100644
--- a/src/gcal-event.c
+++ b/src/gcal-event.c
@@ -1545,16 +1545,15 @@ gcal_event_get_uid (GcalEvent *self)
gboolean
gcal_event_is_multiday (GcalEvent *self)
{
- GDateTime *end_date, *real_end_date;
+ g_autoptr (GDateTime) real_end_date = NULL;
gboolean is_multiday;
gint n_days;
g_return_val_if_fail (GCAL_IS_EVENT (self), FALSE);
- end_date = gcal_event_get_date_end (self);
- real_end_date = g_date_time_add_seconds (end_date, -1);
- is_multiday = FALSE;
+ real_end_date = g_date_time_add_seconds (gcal_event_get_date_end (self), -1);
n_days = g_date_time_difference (real_end_date, self->dt_start) / G_TIME_SPAN_DAY;
+ is_multiday = FALSE;
/*
* An all-day event with only 1 day of time span is treated as a
@@ -1575,8 +1574,6 @@ gcal_event_is_multiday (GcalEvent *self)
is_multiday = TRUE;
}
- g_clear_pointer (&real_end_date, g_date_time_unref);
-
return is_multiday;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]