diff options
author | info-cppsp <[email protected]> | 2017-10-26 14:03:24 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-10-28 20:05:15 +0200 |
commit | c5bce79ac7c654716cd8e1d69882a67053d469ef (patch) | |
tree | 196a2b0ecded54244549012d40132bf0cf22ab63 /sensors-applet/sensors-applet.c | |
parent | 9912a19d75bce7b44dc5f5c259bafa312b482afc (diff) | |
download | mate-sensors-applet-c5bce79ac7c654716cd8e1d69882a67053d469ef.tar.bz2 mate-sensors-applet-c5bce79ac7c654716cd8e1d69882a67053d469ef.tar.xz |
fix save order of sensors
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 ac156e7..2845ddc 100644 --- a/sensors-applet/sensors-applet.c +++ b/sensors-applet/sensors-applet.c @@ -872,6 +872,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, @@ -1016,13 +1017,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); @@ -1350,6 +1349,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); |