[gnome-calendar] Revert "edit-dialog: fix date span backward"
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] Revert "edit-dialog: fix date span backward"
- Date: Tue, 7 Mar 2017 01:20:34 +0000 (UTC)
commit 36cabc0aff7bdac7b308ad0705d7840223114edd
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Mar 6 22:19:34 2017 -0300
Revert "edit-dialog: fix date span backward"
This reverts commit 1228f05a902eb948664b8a59c5641af9ced63cf5.
src/gcal-edit-dialog.c | 37 ++++---------------------------------
1 files changed, 4 insertions(+), 33 deletions(-)
---
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index 46d6d3f..34dd1e7 100644
--- a/src/gcal-edit-dialog.c
+++ b/src/gcal-edit-dialog.c
@@ -300,12 +300,10 @@ sync_datetimes (GcalEditDialog *self,
{
GDateTime *start, *end, *new_date;
GtkWidget *date_widget, *time_widget;
- gboolean is_start_time, is_start_date;
+ gboolean is_start;
gint hour_to_add;
- is_start_time = (widget == self->start_time_selector);
- is_start_date = (widget == self->start_date_selector);
-
+ is_start = (widget == self->start_time_selector || widget == self->start_date_selector);
start = gcal_edit_dialog_get_date_start (self);
end = gcal_edit_dialog_get_date_end (self);
@@ -319,36 +317,9 @@ sync_datetimes (GcalEditDialog *self,
*/
hour_to_add = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->all_day_check)) ? 0 : 1;
- if (is_start_date)
- {
- if (hour_to_add)
- {
- if (g_date_time_difference(end, start) < 0)
- {
- new_date = g_date_time_add_hours (start, hour_to_add + 24);
-
- date_widget = self->end_date_selector;
- time_widget = self->end_time_selector;
- }
- else
- {
- new_date = g_date_time_add_hours (start, hour_to_add);
-
- date_widget = self->end_date_selector;
- time_widget = self->end_time_selector;
- }
- }
- else
- {
- new_date = g_date_time_add_hours (start, hour_to_add);
-
- date_widget = self->end_date_selector;
- time_widget = self->end_time_selector;
- }
- }
- else if (is_start_time)
+ if (is_start)
{
- new_date = g_date_time_add_hours (start, hour_to_add + 24);
+ new_date = g_date_time_add_hours (start, hour_to_add);
date_widget = self->end_date_selector;
time_widget = self->end_time_selector;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]