Bug#863730: unblock: gnome-calendar/3.22.4-2

2017-05-30 Thread Michael Biebl
Am 30.05.2017 um 22:03 schrieb Jonathan Wiltshire:
> Control: tag -1 moreinfo
> 
> Hi,
> 
> On Tue, May 30, 2017 at 04:53:41PM +0200, Michael Biebl wrote:
>> Please unblock package gnome-calendar
>>
>> It's a targetted two-line fix for a crasher bug:
>> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858924
>>
>> The patch is from upstream, the package has already been uploaded and
>> was successfully built everywhere.
> 
> Unfortunately it's stuck behind a new upstream from March. Is this worth
> trying to revert or do through t-p-u, or better abandoned?

Hm,...
Given the tiny diff between 3.22.3 and 3.22.4 and the fact that 3.22.4
has been in unstable for 2 months without new bug reports, maybe
unblocking 3.22.4-1 would be the best option.

Other then that, I'd be willing to prepare a tpu upload.

Regards,
Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
diff --git a/NEWS b/NEWS
index 801c6ec..8e490ac 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Major changes in 3.22.4:
+* Fix outstanding performance issue in Year view
+
 Major changes in 3.22.3:
 * Only decrease search counter when something is removed (Georges Basile Stavracas Neto)
 * Focus entry after calendar selection in quick popover (Mohammed Sadiq)
diff --git a/configure.ac b/configure.ac
index 9741b40..7f304f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 dnl -*- mode: m4 -*-
 AC_PREREQ([2.69])
-AC_INIT([gnome-calendar],[3.22.3],[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-calendar],[gnome-calendar],[https://wiki.gnome.org/Apps/Calendar])
+AC_INIT([gnome-calendar],[3.22.4],[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-calendar],[gnome-calendar],[https://wiki.gnome.org/Apps/Calendar])
 
 AX_IS_RELEASE([minor-version])
 
diff --git a/data/appdata/org.gnome.Calendar.appdata.xml.in b/data/appdata/org.gnome.Calendar.appdata.xml.in
index e69de4b..3f9851f 100644
--- a/data/appdata/org.gnome.Calendar.appdata.xml.in
+++ b/data/appdata/org.gnome.Calendar.appdata.xml.in
@@ -42,6 +42,16 @@
   GNOME
 
   
+
+  
+
+  This is the fifth stable release for GNOME Calendar 3.22, and fixes
+  an outstanding performance issue in Year view.
+
+Thanks to all the contributors that worked on GNOME Calendar!
+  
+
+
 
   
 
diff --git a/src/gcal-window.c b/src/gcal-window.c
index f4a4945..85c799f 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -702,7 +702,7 @@ set_new_event_mode (GcalWindow *window,
   /* for now we relaunch the new-event widget */
   if (!enabled && gtk_widget_is_visible (window->quick_add_popover))
 {
-  gtk_widget_set_visible (window->quick_add_popover, FALSE);
+  gtk_popover_popdown (GTK_POPOVER (window->quick_add_popover));
 }
 }
 
@@ -750,7 +750,7 @@ show_new_event_widget (GcalView   *view,
   rect.height = 1;
 
   gtk_popover_set_pointing_to (GTK_POPOVER (window->quick_add_popover), );
-  gtk_widget_show (window->quick_add_popover);
+  gtk_popover_popup (GTK_POPOVER (window->quick_add_popover));
 }
 
 static void
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index e1c5d4c..79612be 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -108,6 +108,13 @@ struct _GcalYearView
 
   /* date property */
   icaltimetype *date;
+
+  /*
+   * Array with the events at every month. Events
+   * that span multiple months are added multiple
+   * times to the array.
+   */
+  GPtrArray*events[12];
 };
 
 enum {
@@ -650,6 +657,45 @@ calculate_day_month_for_coord (GcalYearView *year_view,
   *out_day = day;
   return TRUE;
 }
+static guint
+count_events_at_day (GcalYearView *self,
+ icaltimetype *today)
+{
+  g_autoptr (GDateTime) today_start, today_end;
+  GPtrArray *events;
+  guint i, n_events;
+
+  events = self->events[today->month - 1];
+  n_events = 0;
+  today_start = icaltime_to_datetime (today);
+  today_end = g_date_time_add_days (today_start, 1);
+
+  for (i = 0; i < events->len; i++)
+{
+  g_autoptr (GDateTime) event_start, event_end;
+  GcalEvent *event;
+
+  event = g_ptr_array_index (events, i);
+
+  event_start = g_date_time_ref (gcal_event_get_date_start (event));
+
+  if (gcal_event_get_all_day (event))
+  event_end = g_date_time_add_days (gcal_event_get_date_end (event), -1);
+  else
+  event_end = g_date_time_ref (gcal_event_get_date_end (event));
+
+
+  if (datetime_compare_date (event_start, today_end) >= 0 ||
+  datetime_compare_date (event_end, today_start) < 0)
+{
+  continue;
+}
+
+  n_events++;
+}
+
+  return n_events;
+}
 
 static void
 draw_month_grid (GcalYearView *year_view,
@@ -671,8 +717,7 @@ draw_month_grid (GcalYearView *year_view,
   gint days_delay, days, shown_rows, sunday_idx;
   gchar *str, *nr_day, *nr_week;
   gboolean selected_day;
-  GList *events;
-  icaltimetype start_date, 

Bug#863730: unblock: gnome-calendar/3.22.4-2

2017-05-30 Thread Jonathan Wiltshire
Control: tag -1 moreinfo

Hi,

On Tue, May 30, 2017 at 04:53:41PM +0200, Michael Biebl wrote:
> Please unblock package gnome-calendar
> 
> It's a targetted two-line fix for a crasher bug:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858924
> 
> The patch is from upstream, the package has already been uploaded and
> was successfully built everywhere.

Unfortunately it's stuck behind a new upstream from March. Is this worth
trying to revert or do through t-p-u, or better abandoned?

Thanks,

-- 
Jonathan Wiltshire  j...@debian.org
Debian Developer http://people.debian.org/~jmw

4096R: 0xD3524C51 / 0A55 B7C5 1223 3942 86EC  74C3 5394 479D D352 4C51



Bug#863730: unblock: gnome-calendar/3.22.4-2

2017-05-30 Thread Michael Biebl
Package: release.debian.org
Severity: normal
User: release.debian@packages.debian.org
Usertags: unblock

Please unblock package gnome-calendar

It's a targetted two-line fix for a crasher bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858924

The patch is from upstream, the package has already been uploaded and
was successfully built everywhere.

Full debdiff is attached.

Regards,
Michael

unblock gnome-calendar/3.22.4-2

-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8), 
LANGUAGE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru gnome-calendar-3.22.4/debian/changelog 
gnome-calendar-3.22.4/debian/changelog
--- gnome-calendar-3.22.4/debian/changelog  2017-03-29 23:00:23.0 
+0200
+++ gnome-calendar-3.22.4/debian/changelog  2017-05-30 10:15:57.0 
+0200
@@ -1,3 +1,11 @@
+gnome-calendar (3.22.4-2) unstable; urgency=medium
+
+  [ Jason Crain ]
+  * Add debian/patches/0003-set-edit-dialogs-event-to-NULL-after-saving.patch:
+fix crash when creating a new event. (Closes: #858924)
+
+ -- Michael Biebl   Tue, 30 May 2017 10:15:57 +0200
+
 gnome-calendar (3.22.4-1) unstable; urgency=medium
 
   * New upstream release.
diff -Nru gnome-calendar-3.22.4/debian/control 
gnome-calendar-3.22.4/debian/control
--- gnome-calendar-3.22.4/debian/control2017-03-29 23:00:23.0 
+0200
+++ gnome-calendar-3.22.4/debian/control2017-05-30 10:15:57.0 
+0200
@@ -6,7 +6,7 @@
 Section: gnome
 Priority: optional
 Maintainer: Debian GNOME Maintainers 

-Uploaders: Andreas Henriksson , Iain Lane 
, Michael Biebl 
+Uploaders: Andreas Henriksson , Michael Biebl 

 Build-Depends: appstream-util,
autoconf-archive,
debhelper (>= 10),
diff -Nru 
gnome-calendar-3.22.4/debian/patches/0003-set-edit-dialogs-event-to-NULL-after-saving.patch
 
gnome-calendar-3.22.4/debian/patches/0003-set-edit-dialogs-event-to-NULL-after-saving.patch
--- 
gnome-calendar-3.22.4/debian/patches/0003-set-edit-dialogs-event-to-NULL-after-saving.patch
 1970-01-01 01:00:00.0 +0100
+++ 
gnome-calendar-3.22.4/debian/patches/0003-set-edit-dialogs-event-to-NULL-after-saving.patch
 2017-05-30 09:50:28.0 +0200
@@ -0,0 +1,39 @@
+From: Yash Singh 
+Date: Fri, 10 Mar 2017 17:58:52 +0530
+Subject: window: set edit dialog's event to NULL after saving
+
+Earlier the app used to crash when a new event was added using the
+'Edit Details' buttion/dialog. This was happening because edit dialog's
+event was set to NULL before the event was being stored in the calendar
+through the 'edit_dialog' and hence the app was crashing.
+
+This patch fixes the above-mentioned issue by saving the event before
+setting the edit dialog's event to NULL.
+
+Origin: upstream, 
https://git.gnome.org/browse/gnome-calendar/commit/?id=6f87ada70dbeae71e3428ee3a63f79b8c918f121
+Bug: https://bugzilla.gnome.org/779733
+Bug-Debian: https://bugs.debian.org/858924
+Last-Update: 2017-05-28
+---
+ src/gcal-window.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/src/gcal-window.c
 b/src/gcal-window.c
+@@ -1102,7 +1102,6 @@
+   event = gcal_edit_dialog_get_event (edit_dialog);
+   view = GCAL_VIEW (window->views[window->active_view]);
+ 
+-  gcal_edit_dialog_set_event (edit_dialog, NULL);
+   gtk_widget_hide (GTK_WIDGET (dialog));
+ 
+   switch (response)
+@@ -1149,6 +1148,8 @@
+   break;
+ 
+ }
++
++  gcal_edit_dialog_set_event (edit_dialog, NULL);
+ }
+ 
+ static void
diff -Nru gnome-calendar-3.22.4/debian/patches/series 
gnome-calendar-3.22.4/debian/patches/series
--- gnome-calendar-3.22.4/debian/patches/series 2016-09-15 00:30:46.0 
+0200
+++ gnome-calendar-3.22.4/debian/patches/series 2017-05-30 09:50:28.0 
+0200
@@ -1,2 +1,3 @@
 0001-Hide-GOA-sources-on-Unity.patch
 0002-Spawn-Ubuntu-s-credentials-panel-instead-of-the-GOA-.patch
+0003-set-edit-dialogs-event-to-NULL-after-saving.patch