diff options
Diffstat (limited to 'sensors-applet/sensors-applet.c')
-rw-r--r-- | sensors-applet/sensors-applet.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sensors-applet/sensors-applet.c b/sensors-applet/sensors-applet.c index be93883..9eab179 100644 --- a/sensors-applet/sensors-applet.c +++ b/sensors-applet/sensors-applet.c @@ -854,6 +854,7 @@ GdkPixbuf *sensors_applet_load_icon(IconType icon_type) { return icon; } +// MUST FREE STRINGS AFTER CALLING THIS FUNCTION!! gboolean sensors_applet_add_sensor(SensorsApplet *sensors_applet, const gchar *path, const gchar *id, @@ -998,13 +999,11 @@ gboolean sensors_applet_add_sensor(SensorsApplet *sensors_applet, /* if sensor is already in settings, load values from there */ gchar *applet_path = mate_panel_applet_get_preferences_path (sensors_applet->applet); - gchar *settings_path = g_strdup_printf ("%s%s/", - applet_path, - sensors_applet_settings_get_unique_id (interface, - id, - path)); + gchar *gsuid = sensors_applet_settings_get_unique_id (interface, id, path); + gchar *settings_path = g_strdup_printf ("%s%s/", applet_path, gsuid); GSettings *settings = g_settings_new_with_path ("org.mate.sensors-applet.sensor", settings_path); g_free (applet_path); + g_free (gsuid); g_free (settings_path); gchar *settings_id = g_settings_get_string (settings, ID); @@ -1332,6 +1331,10 @@ void sensors_applet_init(SensorsApplet *sensors_applet) { sensors_applet->settings = mate_panel_applet_settings_new (sensors_applet->applet, "org.mate.sensors-applet"); + // load sensors from array saved in gsettings + sensors_applet_conf_setup_sensors(sensors_applet); + + /* now do any setup needed manually */ sensors_applet_plugins_load_all(sensors_applet); |