summaryrefslogtreecommitdiff
path: root/sensors-applet/sensors-applet.c
diff options
context:
space:
mode:
authorinfo-cppsp <[email protected]>2017-10-26 14:03:24 +0200
committerraveit65 <[email protected]>2017-11-09 11:58:58 +0100
commitf9116086520c29d7e0795198b4ec026e62a0039d (patch)
treec324056c60548bb25b0e4306bff6d32c15f0ff47 /sensors-applet/sensors-applet.c
parent84ad8252c74237aa2b801e6a40cf9fe25110b16c (diff)
downloadmate-sensors-applet-f9116086520c29d7e0795198b4ec026e62a0039d.tar.bz2
mate-sensors-applet-f9116086520c29d7e0795198b4ec026e62a0039d.tar.xz
fix save order of sensors
Diffstat (limited to 'sensors-applet/sensors-applet.c')
-rw-r--r--sensors-applet/sensors-applet.c13
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);