src: Use g_set_date_time()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/873>
This commit is contained in:
@@ -991,7 +991,7 @@ gcal_event_set_date_end (GcalEvent *self,
|
||||
{
|
||||
g_return_if_fail (GCAL_IS_EVENT (self));
|
||||
|
||||
if (gcal_set_date_time (&self->dt_end, dt))
|
||||
if (g_set_date_time (&self->dt_end, dt))
|
||||
{
|
||||
ECalComponentDateTime *component_dt;
|
||||
|
||||
@@ -1037,7 +1037,7 @@ gcal_event_set_date_start (GcalEvent *self,
|
||||
{
|
||||
g_return_if_fail (GCAL_IS_EVENT (self));
|
||||
|
||||
if (gcal_set_date_time (&self->dt_start, dt))
|
||||
if (g_set_date_time (&self->dt_start, dt))
|
||||
{
|
||||
ECalComponentDateTime *component_dt;
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ insert (Node *n,
|
||||
|
||||
/* Update the current node's maximum subrange value */
|
||||
if (!n->max || g_date_time_compare (range_end, n->max) > 0)
|
||||
gcal_set_date_time (&n->max, range_end);
|
||||
g_set_date_time (&n->max, range_end);
|
||||
|
||||
return rebalance (n);
|
||||
}
|
||||
|
||||
@@ -119,13 +119,13 @@ maybe_update_range (GcalShellSearchProvider *self)
|
||||
|
||||
if (self->range_start && gcal_date_time_compare_date (self->range_start, start) != 0)
|
||||
{
|
||||
gcal_set_date_time (&self->range_start, start);
|
||||
g_set_date_time (&self->range_start, start);
|
||||
range_changed = TRUE;
|
||||
}
|
||||
|
||||
if (self->range_end && gcal_date_time_compare_date (self->range_end, end) != 0)
|
||||
{
|
||||
gcal_set_date_time (&self->range_end, end);
|
||||
g_set_date_time (&self->range_end, end);
|
||||
range_changed = TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -600,7 +600,7 @@ gcal_date_chooser_set_date (GcalView *view,
|
||||
g_date_time_get_ymd (self->date, &y1, &m1, &d1);
|
||||
g_date_time_get_ymd (date, &y2, &m2, &d2);
|
||||
|
||||
gcal_set_date_time (&self->date, date);
|
||||
g_set_date_time (&self->date, date);
|
||||
|
||||
if (y1 != y2 || m1 != m2 || d1 != d2)
|
||||
gcal_multi_choice_set_value (GCAL_MULTI_CHOICE (self->combined_choice),
|
||||
|
||||
@@ -724,7 +724,7 @@ gcal_date_time_chooser_set_date_time (GcalDateTimeChooser *self,
|
||||
{
|
||||
GCAL_ENTRY;
|
||||
|
||||
gcal_set_date_time (&self->date_time, date_time);
|
||||
g_set_date_time (&self->date_time, date_time);
|
||||
|
||||
g_signal_handlers_block_by_func (self->date_row, on_date_changed_cb, self);
|
||||
gcal_date_chooser_row_set_date (self->date_row, date_time);
|
||||
|
||||
@@ -117,8 +117,8 @@ gcal_event_schedule_set_all_day (const GcalEventSchedule *values, gboolean all_d
|
||||
0.0);
|
||||
g_autoptr (GDateTime) new_end = g_date_time_add_days (tmp, 1);
|
||||
|
||||
gcal_set_date_time (©->curr.date_start, new_start);
|
||||
gcal_set_date_time (©->curr.date_end, new_end);
|
||||
g_set_date_time (©->curr.date_start, new_start);
|
||||
g_set_date_time (©->curr.date_end, new_end);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -176,8 +176,8 @@ gcal_event_schedule_set_all_day (const GcalEventSchedule *values, gboolean all_d
|
||||
g_date_time_get_seconds (values->orig.date_end));
|
||||
}
|
||||
|
||||
gcal_set_date_time (©->curr.date_start, new_start);
|
||||
gcal_set_date_time (©->curr.date_end, new_end);
|
||||
g_set_date_time (©->curr.date_start, new_start);
|
||||
g_set_date_time (©->curr.date_end, new_end);
|
||||
}
|
||||
|
||||
copy->curr.all_day = all_day;
|
||||
@@ -201,11 +201,11 @@ gcal_event_schedule_set_start_date (const GcalEventSchedule *values, GDateTime *
|
||||
{
|
||||
GcalEventSchedule *copy = gcal_event_schedule_copy (values);
|
||||
|
||||
gcal_set_date_time (©->curr.date_start, start);
|
||||
g_set_date_time (©->curr.date_start, start);
|
||||
|
||||
if (g_date_time_compare (start, copy->curr.date_end) == 1)
|
||||
{
|
||||
gcal_set_date_time (©->curr.date_end, start);
|
||||
g_set_date_time (©->curr.date_end, start);
|
||||
}
|
||||
|
||||
return copy;
|
||||
@@ -226,16 +226,16 @@ gcal_event_schedule_set_end_date (const GcalEventSchedule *values, GDateTime *en
|
||||
* iCalendar.
|
||||
*/
|
||||
g_autoptr (GDateTime) fake_end_date = g_date_time_add_days (end, 1);
|
||||
gcal_set_date_time (©->curr.date_end, fake_end_date);
|
||||
g_set_date_time (©->curr.date_end, fake_end_date);
|
||||
}
|
||||
else
|
||||
{
|
||||
gcal_set_date_time (©->curr.date_end, end);
|
||||
g_set_date_time (©->curr.date_end, end);
|
||||
}
|
||||
|
||||
if (g_date_time_compare (copy->curr.date_start, end) == 1)
|
||||
{
|
||||
gcal_set_date_time (©->curr.date_start, end);
|
||||
g_set_date_time (©->curr.date_start, end);
|
||||
}
|
||||
|
||||
return copy;
|
||||
@@ -246,7 +246,7 @@ gcal_event_schedule_set_start_date_time (const GcalEventSchedule *values, GDateT
|
||||
{
|
||||
GcalEventSchedule *copy = gcal_event_schedule_copy (values);
|
||||
|
||||
gcal_set_date_time (©->curr.date_start, start);
|
||||
g_set_date_time (©->curr.date_start, start);
|
||||
|
||||
if (g_date_time_compare (start, copy->curr.date_end) == 1)
|
||||
{
|
||||
@@ -254,7 +254,7 @@ gcal_event_schedule_set_start_date_time (const GcalEventSchedule *values, GDateT
|
||||
g_autoptr (GDateTime) new_end = g_date_time_add_hours (start, 1);
|
||||
g_autoptr (GDateTime) new_end_in_end_tz = g_date_time_to_timezone (new_end, end_tz);
|
||||
|
||||
gcal_set_date_time (©->curr.date_end, new_end_in_end_tz);
|
||||
g_set_date_time (©->curr.date_end, new_end_in_end_tz);
|
||||
}
|
||||
|
||||
return copy;
|
||||
@@ -265,7 +265,7 @@ gcal_event_schedule_set_end_date_time (const GcalEventSchedule *values, GDateTim
|
||||
{
|
||||
GcalEventSchedule *copy = gcal_event_schedule_copy (values);
|
||||
|
||||
gcal_set_date_time (©->curr.date_end, end);
|
||||
g_set_date_time (©->curr.date_end, end);
|
||||
|
||||
if (g_date_time_compare (copy->curr.date_start, end) == 1)
|
||||
{
|
||||
@@ -273,7 +273,7 @@ gcal_event_schedule_set_end_date_time (const GcalEventSchedule *values, GDateTim
|
||||
g_autoptr (GDateTime) new_start = g_date_time_add_hours (end, -1);
|
||||
g_autoptr (GDateTime) new_start_in_start_tz = g_date_time_to_timezone (new_start, start_tz);
|
||||
|
||||
gcal_set_date_time (©->curr.date_start, new_start_in_start_tz);
|
||||
g_set_date_time (©->curr.date_start, new_start_in_start_tz);
|
||||
}
|
||||
|
||||
return copy;
|
||||
@@ -398,7 +398,7 @@ gcal_event_schedule_set_recurrence_until (const GcalEventSchedule *values,
|
||||
g_assert (copy->curr.recur->frequency != GCAL_RECURRENCE_NO_REPEAT);
|
||||
g_assert (copy->curr.recur->limit_type == GCAL_RECURRENCE_UNTIL);
|
||||
|
||||
gcal_set_date_time (©->curr.recur->limit.until, until);
|
||||
g_set_date_time (©->curr.recur->limit.until, until);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ gcal_application_command_line (GApplication *app,
|
||||
result.tm_min,
|
||||
0);
|
||||
|
||||
gcal_set_date_time (&self->initial_date, initial_date);
|
||||
g_set_date_time (&self->initial_date, initial_date);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -676,5 +676,5 @@ gcal_application_set_initial_date (GcalApplication *self,
|
||||
{
|
||||
g_return_if_fail (GCAL_IS_APPLICATION (self));
|
||||
|
||||
gcal_set_date_time (&self->initial_date, initial_date);
|
||||
g_set_date_time (&self->initial_date, initial_date);
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ update_active_date (GcalWindow *window,
|
||||
new_date_string = g_date_time_format (new_date, "%x %X %z");
|
||||
g_debug ("Updating active date to %s", new_date_string);
|
||||
|
||||
gcal_set_date_time (&window->active_date, new_date);
|
||||
g_set_date_time (&window->active_date, new_date);
|
||||
|
||||
for (i = 0; i < GCAL_WINDOW_VIEW_N_VIEWS; i++)
|
||||
gcal_view_set_date (GCAL_VIEW (window->views[i]), new_date);
|
||||
|
||||
@@ -266,7 +266,7 @@ gcal_agenda_view_day_set_date (GcalAgendaViewDay *self,
|
||||
{
|
||||
g_assert (GCAL_IS_AGENDA_VIEW_DAY (self));
|
||||
|
||||
if (gcal_set_date_time (&self->date, date))
|
||||
if (g_set_date_time (&self->date, date))
|
||||
{
|
||||
GtkFilter *filter = NULL;
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ gcal_agenda_view_set_date (GcalView *view,
|
||||
|
||||
GCAL_ENTRY;
|
||||
|
||||
gcal_set_date_time (&self->date, date);
|
||||
g_set_date_time (&self->date, date);
|
||||
|
||||
for (unsigned int i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (self->days_model)); i++)
|
||||
{
|
||||
|
||||
@@ -397,7 +397,7 @@ update_week_ranges (GcalMonthView *self,
|
||||
if (current_date)
|
||||
current_range = gcal_timeline_subscriber_get_range (GCAL_TIMELINE_SUBSCRIBER (self));
|
||||
|
||||
gcal_set_date_time (&self->date, new_date);
|
||||
g_set_date_time (&self->date, new_date);
|
||||
|
||||
if (current_range && gcal_range_contains_datetime (current_range, new_date))
|
||||
{
|
||||
|
||||
@@ -1299,7 +1299,7 @@ void
|
||||
gcal_week_grid_set_date (GcalWeekGrid *self,
|
||||
GDateTime *date)
|
||||
{
|
||||
gcal_set_date_time (&self->active_date, date);
|
||||
g_set_date_time (&self->active_date, date);
|
||||
|
||||
invalidate_layout_blocks (self);
|
||||
}
|
||||
|
||||
@@ -1868,7 +1868,7 @@ gcal_week_header_set_date (GcalWeekHeader *self,
|
||||
|
||||
had_date = self->active_date != NULL;
|
||||
|
||||
gcal_set_date_time (&self->active_date, date);
|
||||
g_set_date_time (&self->active_date, date);
|
||||
|
||||
update_title (self);
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
|
||||
@@ -432,7 +432,7 @@ gcal_week_view_set_date (GcalView *view,
|
||||
|
||||
GCAL_ENTRY;
|
||||
|
||||
gcal_set_date_time (&self->date, date);
|
||||
g_set_date_time (&self->date, date);
|
||||
|
||||
/* Propagate the new date */
|
||||
gcal_week_grid_set_date (GCAL_WEEK_GRID (self->week_grid), date);
|
||||
|
||||
Reference in New Issue
Block a user