[evolution] Replace deprecated icaltime_from_timet() with icaltime_from_timet_with_zone()



commit b2d941857ed098ff35a4c80142983741b1a575ff
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jan 5 15:44:16 2017 +0100

    Replace deprecated icaltime_from_timet() with icaltime_from_timet_with_zone()
    
    The upcoming libical release can have the deprecated symbol removed
    and the replacement is available in the requested minimum version
    of the libical already, thus no dependency change by replacing it.

 src/calendar/gui/e-day-view.c                   |    8 ++++----
 src/calendar/gui/tag-calendar.c                 |    5 +----
 src/modules/calendar/e-cal-base-shell-backend.c |    7 ++-----
 src/modules/calendar/e-cal-shell-view-private.c |    5 +----
 4 files changed, 8 insertions(+), 17 deletions(-)
---
diff --git a/src/calendar/gui/e-day-view.c b/src/calendar/gui/e-day-view.c
index c4a3469..fafa0e5 100644
--- a/src/calendar/gui/e-day-view.c
+++ b/src/calendar/gui/e-day-view.c
@@ -7555,8 +7555,8 @@ e_day_view_event_move (ECalendarView *cal_view,
                        return TRUE;
                start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row);
                end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1);
-               start_time = icaltime_from_timet (start_dt, 0);
-               end_time = icaltime_from_timet (end_dt, 0);
+               start_time = icaltime_from_timet_with_zone (start_dt, 0, NULL);
+               end_time = icaltime_from_timet_with_zone (end_dt, 0, NULL);
                icaltime_adjust (&start_time ,-1,0,0,0);
                icaltime_adjust (&end_time ,-1,0,0,0);
                start_dt = icaltime_as_timet (start_time);
@@ -7567,8 +7567,8 @@ e_day_view_event_move (ECalendarView *cal_view,
                        return TRUE;
                start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row);
                end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1);
-               start_time = icaltime_from_timet (start_dt, 0);
-               end_time = icaltime_from_timet (end_dt, 0);
+               start_time = icaltime_from_timet_with_zone (start_dt, 0, NULL);
+               end_time = icaltime_from_timet_with_zone (end_dt, 0, NULL);
                icaltime_adjust (&start_time ,1,0,0,0);
                icaltime_adjust (&end_time ,1,0,0,0);
                start_dt = icaltime_as_timet (start_time);
diff --git a/src/calendar/gui/tag-calendar.c b/src/calendar/gui/tag-calendar.c
index b5563be..652abe0 100644
--- a/src/calendar/gui/tag-calendar.c
+++ b/src/calendar/gui/tag-calendar.c
@@ -234,10 +234,7 @@ encode_timet_to_julian (time_t t,
        if (!t)
                return 0;
 
-       if (zone)
-               tt = icaltime_from_timet_with_zone (t, is_date, zone);
-       else
-               tt = icaltime_from_timet (t, is_date);
+       tt = icaltime_from_timet_with_zone (t, is_date, zone);
 
        if (!icaltime_is_valid_time (tt) || icaltime_is_null_time (tt))
                return 0;
diff --git a/src/modules/calendar/e-cal-base-shell-backend.c b/src/modules/calendar/e-cal-base-shell-backend.c
index 99b8963..9c423c6 100644
--- a/src/modules/calendar/e-cal-base-shell-backend.c
+++ b/src/modules/calendar/e-cal-base-shell-backend.c
@@ -320,10 +320,7 @@ populate_g_date (GDate *date,
        if ((gint) utc_time == -1)
                return;
 
-       if (zone)
-               icaltm = icaltime_from_timet_with_zone (utc_time, FALSE, zone);
-       else
-               icaltm = icaltime_from_timet (utc_time, FALSE);
+       icaltm = icaltime_from_timet_with_zone (utc_time, FALSE, zone);
 
        if (icaltime_is_null_time (icaltm) ||
            !icaltime_is_valid_time (icaltm))
@@ -346,7 +343,7 @@ convert_time_from_isodate (const gchar *text,
        if (use_date_zone && strlen (text) == 8) {
                struct icaltimetype itt;
 
-               itt = icaltime_from_timet (res, TRUE);
+               itt = icaltime_from_timet_with_zone (res, TRUE, NULL);
                res = icaltime_as_timet_with_zone (itt, use_date_zone);
        }
 
diff --git a/src/modules/calendar/e-cal-shell-view-private.c b/src/modules/calendar/e-cal-shell-view-private.c
index 95a8ca8..4f418b2 100644
--- a/src/modules/calendar/e-cal-shell-view-private.c
+++ b/src/modules/calendar/e-cal-shell-view-private.c
@@ -700,10 +700,7 @@ cal_searching_check_candidates (ECalShellView *cal_shell_view)
                data_model = e_cal_base_shell_content_get_data_model (E_CAL_BASE_SHELL_CONTENT 
(cal_shell_view->priv->cal_shell_content));
                zone = e_cal_data_model_get_timezone (data_model);
 
-               if (zone)
-                       tt = icaltime_from_timet_with_zone (candidate, FALSE, zone);
-               else
-                       tt = icaltime_from_timet (candidate, FALSE);
+               tt = icaltime_from_timet_with_zone (candidate, FALSE, zone);
 
                if (icaltime_is_valid_time (tt) && !icaltime_is_null_time (tt)) {
                        ECalendarView *cal_view;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]