Port to libecal-2.0
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/merge_requests/70
This commit is contained in:
@@ -383,23 +383,11 @@ static void
|
||||
remove_recurrence_properties (GcalEvent *event)
|
||||
{
|
||||
ECalComponent *comp;
|
||||
icalcomponent *icalcomp;
|
||||
icalproperty *prop;
|
||||
|
||||
comp = gcal_event_get_component (event);
|
||||
icalcomp = e_cal_component_get_icalcomponent (comp);
|
||||
|
||||
e_cal_component_set_recurid (comp, NULL);
|
||||
|
||||
prop = icalcomponent_get_first_property (icalcomp, ICAL_RRULE_PROPERTY);
|
||||
|
||||
if (prop)
|
||||
{
|
||||
icalcomponent_remove_property (icalcomp, prop);
|
||||
icalproperty_free (prop);
|
||||
}
|
||||
|
||||
e_cal_component_rescan (comp);
|
||||
e_cal_component_set_rrules (comp, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -585,7 +573,7 @@ create_row_for_alarm (GcalEvent *event,
|
||||
gtk_label_set_label (GTK_LABEL (label), text);
|
||||
|
||||
/* Retrieves the actions associated to the alarm */
|
||||
e_cal_component_alarm_get_action (alarm, &action);
|
||||
action = e_cal_component_alarm_get_action (alarm);
|
||||
|
||||
/* Updates the volume button to match the action */
|
||||
has_sound = action == E_CAL_COMPONENT_ALARM_AUDIO;
|
||||
|
||||
@@ -1205,7 +1205,7 @@ gcal_event_widget_sort_events (GcalEventWidget *widget1,
|
||||
{
|
||||
g_autoptr (GDateTime) dt_time1 = NULL;
|
||||
g_autoptr (GDateTime) dt_time2 = NULL;
|
||||
icaltimetype *ical_dt;
|
||||
ICalTime *itt;
|
||||
gint diff;
|
||||
|
||||
diff = gcal_event_is_multiday (widget2->event) - gcal_event_is_multiday (widget1->event);
|
||||
@@ -1223,13 +1223,15 @@ gcal_event_widget_sort_events (GcalEventWidget *widget1,
|
||||
if (diff != 0)
|
||||
return diff;
|
||||
|
||||
e_cal_component_get_last_modified (gcal_event_get_component (widget1->event), &ical_dt);
|
||||
if (ical_dt)
|
||||
dt_time1 = gcal_date_time_from_icaltime (ical_dt);
|
||||
itt = e_cal_component_get_last_modified (gcal_event_get_component (widget1->event));
|
||||
if (itt)
|
||||
dt_time1 = gcal_date_time_from_icaltime (itt);
|
||||
g_clear_object (&itt);
|
||||
|
||||
e_cal_component_get_last_modified (gcal_event_get_component (widget2->event), &ical_dt);
|
||||
if (ical_dt)
|
||||
dt_time2 = gcal_date_time_from_icaltime (ical_dt);
|
||||
itt = e_cal_component_get_last_modified (gcal_event_get_component (widget2->event));
|
||||
if (itt)
|
||||
dt_time2 = gcal_date_time_from_icaltime (itt);
|
||||
g_clear_object (&itt);
|
||||
|
||||
return dt_time1 && dt_time2 ? g_date_time_compare (dt_time2, dt_time1) : 0;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <libical/icaltime.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GCAL_TYPE_EVENT_WIDGET (gcal_event_widget_get_type ())
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <libecal/libecal.h>
|
||||
#include <libical/icaltime.h>
|
||||
|
||||
/**
|
||||
* SECTION:gcal-window
|
||||
|
||||
Reference in New Issue
Block a user