application: Remove gcal_application_get_clock()

That moved to GcalContext, and now that all pieces who
used it have access to the context, we can just use it.
This commit is contained in:
Georges Basile Stavracas Neto
2019-04-25 16:30:55 -03:00
parent 54506973fc
commit 1297ad695b
8 changed files with 41 additions and 90 deletions
+6 -13
View File
@@ -1669,8 +1669,6 @@ gcal_week_header_class_init (GcalWeekHeaderClass *kclass)
static void
gcal_week_header_init (GcalWeekHeader *self)
{
GcalApplication *application;
self->expanded = FALSE;
self->selection_start = -1;
self->selection_end = -1;
@@ -1690,17 +1688,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
NULL,
0,
GDK_ACTION_MOVE);
/* Connect to the wall clock */
application = GCAL_APPLICATION (g_application_get_default ());
g_assert (application != NULL);
g_signal_connect_object (gcal_application_get_clock (application),
"day-changed",
G_CALLBACK (gtk_widget_queue_draw),
self,
G_CONNECT_SWAPPED);
}
/* Private API */
@@ -1831,6 +1818,12 @@ gcal_week_header_set_context (GcalWeekHeader *self,
g_return_if_fail (GCAL_IS_WEEK_HEADER (self));
self->context = context;
g_signal_connect_object (gcal_context_get_clock (context),
"day-changed",
G_CALLBACK (gtk_widget_queue_draw),
self,
G_CONNECT_SWAPPED);
}
void