[evolution] Cancel editing when change notification comes in the Day View



commit 36d981307394a93d8c21a986c18d867141b0f3ef
Author: Milan Crha <mcrha redhat com>
Date:   Wed Feb 10 19:57:56 2016 +0100

    Cancel editing when change notification comes in the Day View
    
    The Day View could revert changes which came from the data server
    when the event had been currently edited in the view. Prefer
    the server change, rather than (maybe no) local change.

 calendar/gui/e-day-view.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 9f020a2..dcf7d2a 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -2620,7 +2620,8 @@ process_component (EDayView *day_view,
 
 static void
 update_row (EDayView *day_view,
-            gint row)
+           gint row,
+           gboolean do_cancel_editing)
 {
        ECalModelComponent *comp_data;
        ECalModel *model;
@@ -2628,7 +2629,10 @@ update_row (EDayView *day_view,
        const gchar *uid = NULL;
        gchar *rid = NULL;
 
-       e_day_view_stop_editing_event (day_view);
+       if (do_cancel_editing)
+               cancel_editing (day_view);
+       else
+               e_day_view_stop_editing_event (day_view);
 
        model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view));
        comp_data = e_cal_model_get_component_at (model, row);
@@ -2668,7 +2672,7 @@ model_row_changed_cb (ETableModel *etm,
                return;
        }
 
-       update_row (day_view, row);
+       update_row (day_view, row, TRUE);
 }
 
 static void
@@ -2685,7 +2689,7 @@ model_cell_changed_cb (ETableModel *etm,
                return;
        }
 
-       update_row (day_view, row);
+       update_row (day_view, row, FALSE);
 }
 
 static void


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