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:
@@ -1112,8 +1112,6 @@ gcal_week_grid_class_init (GcalWeekGridClass *klass)
|
||||
static void
|
||||
gcal_week_grid_init (GcalWeekGrid *self)
|
||||
{
|
||||
GcalApplication *application;
|
||||
|
||||
gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
|
||||
|
||||
self->selection_start = -1;
|
||||
@@ -1128,17 +1126,6 @@ gcal_week_grid_init (GcalWeekGrid *self)
|
||||
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),
|
||||
"minute-changed",
|
||||
G_CALLBACK (gtk_widget_queue_draw),
|
||||
self,
|
||||
G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
||||
/* Public API */
|
||||
@@ -1149,6 +1136,12 @@ gcal_week_grid_set_context (GcalWeekGrid *self,
|
||||
g_return_if_fail (GCAL_IS_WEEK_GRID (self));
|
||||
|
||||
self->context = context;
|
||||
|
||||
g_signal_connect_object (gcal_context_get_clock (context),
|
||||
"minute-changed",
|
||||
G_CALLBACK (gtk_widget_queue_draw),
|
||||
self,
|
||||
G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user