Bug Fix #2

Last blog of pre-GSoC coding. This is the story which dates back to the application period.

The month view of the calendar is a pretty important aspect of the calendar. The keyboard arrow keys allowed a user to switch between days in a specific month. But on reaching the end of the month, a user couldn’t go any further.

Comes, https://bugzilla.gnome.org/show_bug.cgi?id=763198

The fix to which was a simple change to the key_press()
https://github.com/GNOME/gnome-calendar/commit/a738acb462418ab757531bf6aba4ae8679be829d

The calendar, in the past, used a ‘gint’ variable for locating the present location of the selector. So, on going beyond a date in the calendar, it would go to an invalid cell, which would cause nothing to happen. After the patch for bug #763198, it would go to the next month but since it used the cell position, the selection dates for creating new events went bad.

Next comes, https://bugzilla.gnome.org/show_bug.cgi?id=763641

The simple fix-Make the ‘gint’ variables to ‘GDateTime’ variables to track the date rather than a ‘gint’ variable to track the cell position.

The difficulties- The month-view was heavily dependent on those two variables (start_date_cell and end_date_cell) On changing a variable on gint to GDateTime, a lot of changes had to be made.

The result was a huge patch which changed the code at every position of occurrence of tracking variables- https://github.com/GNOME/gnome-calendar/commit/a3cbaf1e8103da3007c980bd1663a2c7c6e191f1

Segment faults are hard!!!

Thanks to the awesome community, an apparent error in the code was pointed out, resulting in the reopening of the bug #763641.

After much trying and failing, comes feaneron! Who solved the error in a few quick patches.

After all this, what has improved-

  • User can navigate to the next and previous month by navigating to the end of the current month.
  • User can create events spanning across multiple months with just the keyboard

What can still be done: The patch was pretty biased towards a keyboard user, there were no additions made for a mouse user, which should and will be done soon.

Next Up: The long forgotten week-view rises!!

2 thoughts on “Bug Fix #2

Leave a comment