manager: Move GSettings to GcalContext

This commit is contained in:
Georges Basile Stavracas Neto
2019-04-25 16:30:54 -03:00
parent dc9d1d0d9b
commit 802c6948e8
7 changed files with 37 additions and 55 deletions
+2 -6
View File
@@ -73,7 +73,6 @@ load_weather_settings (GcalWeatherSettings *self)
g_autoptr (GVariant) location = NULL;
g_autoptr (GVariant) value = NULL;
g_autofree gchar *location_name = NULL;
GcalManager *manager;
GSettings *settings;
gboolean show_weather;
gboolean auto_location;
@@ -83,8 +82,7 @@ load_weather_settings (GcalWeatherSettings *self)
if (!self->context)
GCAL_RETURN ();
manager = gcal_context_get_manager (self->context);
settings = gcal_manager_get_settings (manager);
settings = gcal_context_get_settings (self->context);
value = g_settings_get_value (settings, "weather-settings");
g_variant_get (value, "(bbsmv)",
@@ -130,7 +128,6 @@ static void
save_weather_settings (GcalWeatherSettings *self)
{
g_autoptr (GWeatherLocation) location = NULL;
GcalManager *manager;
GSettings *settings;
GVariant *value;
GVariant *vlocation;
@@ -144,8 +141,7 @@ save_weather_settings (GcalWeatherSettings *self)
location = gweather_location_entry_get_location (GWEATHER_LOCATION_ENTRY (self->weather_location_entry));
vlocation = location ? gweather_location_serialize (location) : NULL;
manager = gcal_context_get_manager (self->context);
settings = gcal_manager_get_settings (manager);
settings = gcal_context_get_settings (self->context);
value = g_variant_new ("(bbsmv)",
gtk_switch_get_active (self->show_weather_switch),
gtk_switch_get_active (self->weather_auto_location_switch),