application: Move night light monitor to GcalContext

This commit is contained in:
Georges Basile Stavracas Neto
2019-04-25 16:30:55 -03:00
parent 1b8a29e59b
commit 8366d22cf0
2 changed files with 6 additions and 6 deletions
-6
View File
@@ -26,7 +26,6 @@
#include "gcal-debug.h"
#include "gcal-enums.h"
#include "gcal-log.h"
#include "gcal-night-light-monitor.h"
#include "gcal-shell-search-provider.h"
#include "gcal-weather-service.h"
#include "gcal-window.h"
@@ -53,7 +52,6 @@ struct _GcalApplication
GcalWeatherService *weather_service;
GcalShellSearchProvider *search_provider;
GcalNightLightMonitor *night_light_monitor;
GcalContext *context;
};
@@ -229,7 +227,6 @@ gcal_application_finalize (GObject *object)
g_clear_object (&self->context);
g_clear_object (&self->colors_provider);
g_clear_object (&self->desktop_settings);
g_clear_object (&self->night_light_monitor);
g_clear_object (&self->provider);
g_clear_object (&self->search_provider);
g_clear_object (&self->weather_service);
@@ -295,9 +292,6 @@ gcal_application_activate (GApplication *application)
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 2);
}
if (!self->night_light_monitor)
self->night_light_monitor = gcal_night_light_monitor_new (self->context);
if (!self->window)
{
if (!self->initial_date)
+6
View File
@@ -21,6 +21,7 @@
#define G_LOG_DOMAIN "GcalContext"
#include "gcal-context.h"
#include "gcal-night-light-monitor.h"
struct _GcalContext
{
@@ -31,6 +32,8 @@ struct _GcalContext
GcalManager *manager;
GSettings *settings;
GcalWeatherService *weather_service;
GcalNightLightMonitor *night_light_monitor;
};
G_DEFINE_TYPE (GcalContext, gcal_context, G_TYPE_OBJECT)
@@ -61,6 +64,7 @@ gcal_context_finalize (GObject *object)
g_clear_object (&self->clock);
g_clear_object (&self->goa_client);
g_clear_object (&self->manager);
g_clear_object (&self->night_light_monitor);
g_clear_object (&self->weather_service);
G_OBJECT_CLASS (gcal_context_parent_class)->finalize (object);
@@ -169,6 +173,8 @@ gcal_context_init (GcalContext *self)
self->manager = gcal_manager_new ();
self->settings = g_settings_new ("org.gnome.calendar");
self->weather_service = gcal_weather_service_new ();
self->night_light_monitor = gcal_night_light_monitor_new (self);
}
/**