window: simplify constructor

We don't need to pass information that can easily be
retrieved by the GSettings instance from GcalManager.
This commit is contained in:
Georges Basile Stavracas Neto
2017-09-07 13:21:09 -03:00
parent a0b6bdb04a
commit 36a39e6c5c
3 changed files with 12 additions and 26 deletions
+2 -14
View File
@@ -180,12 +180,10 @@ static void
gcal_application_activate (GApplication *application)
{
GcalApplication *self;
GSettings *settings;
GCAL_ENTRY;
self = GCAL_APPLICATION (application);
settings = gcal_manager_get_settings (self->manager);
if (!self->provider)
{
@@ -215,18 +213,8 @@ gcal_application_activate (GApplication *application)
gcal_manager_get_system_timezone (self->manager));
}
self->window = gcal_window_new_with_view_and_date (GCAL_APPLICATION (application),
g_settings_get_enum (settings, "active-view"),
self->initial_date);
g_signal_connect (self->window, "destroy", G_CALLBACK (gtk_widget_destroyed), &(self->window));
g_settings_bind (settings,
"active-view",
self->window,
"active-view",
G_SETTINGS_BIND_SET | G_SETTINGS_BIND_GET);
self->window = gcal_window_new_with_date (GCAL_APPLICATION (application), self->initial_date);
g_signal_connect (self->window, "destroy", G_CALLBACK (gtk_widget_destroyed), &self->window);
gtk_widget_show (self->window);
}