[gnome-calendar/gbsneto/range: 2/12] event: Simplify some code
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gbsneto/range: 2/12] event: Simplify some code
- Date: Mon, 13 Apr 2020 23:51:38 +0000 (UTC)
commit 7527222d8e09fa1ac607e89aaed8febb8b27617a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun Apr 12 20:49:31 2020 -0300
event: Simplify some code
src/core/gcal-event.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/src/core/gcal-event.c b/src/core/gcal-event.c
index 98047c50..8f28a89f 100644
--- a/src/core/gcal-event.c
+++ b/src/core/gcal-event.c
@@ -1,6 +1,6 @@
/* gcal-event.c
*
- * Copyright (C) 2016 Georges Basile Stavracas Neto <georges stavracas gmail com>
+ * Copyright (C) 2016-2020 Georges Basile Stavracas Neto <georges stavracas gmail com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -898,13 +898,10 @@ gcal_event_set_date_end (GcalEvent *self,
{
g_return_if_fail (GCAL_IS_EVENT (self));
- if (self->dt_end != dt)
+ if (gcal_set_date_time (&self->dt_end, dt))
{
ECalComponentDateTime *component_dt;
- g_clear_pointer (&self->dt_end, g_date_time_unref);
- self->dt_end = g_date_time_ref (dt);
-
/* Setup the ECalComponent's datetime value */
component_dt = build_component_from_datetime (self, dt);
@@ -946,13 +943,10 @@ gcal_event_set_date_start (GcalEvent *self,
{
g_return_if_fail (GCAL_IS_EVENT (self));
- if (self->dt_start != dt)
+ if (gcal_set_date_time (&self->dt_start, dt))
{
ECalComponentDateTime *component_dt;
- g_clear_pointer (&self->dt_start, g_date_time_unref);
- self->dt_start = g_date_time_ref (dt);
-
/* Setup the ECalComponent's datetime value */
component_dt = build_component_from_datetime (self, dt);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]