 src/sensors-applet-gconf.c |  129 ++++++++++++++++++++++++++++++++++-----------
 1 file changed, 100 insertions(+), 29 deletions(-)

--- sensors-applet-1.6.orig/src/sensors-applet-gconf.c	2005-12-29 18:13:05.000000000 -0500
+++ sensors-applet-1.6/src/sensors-applet-gconf.c	2006-02-06 21:21:35.000000000 -0500
@@ -74,103 +74,141 @@
 	   we set to -1, and visible which we set to false for all
 	   parent nodes and true for all child nodes */
 
+	char hostname[20], path[50];
+
 	GSList *paths = NULL, *ids = NULL, *labels = NULL, *interfaces = NULL, *enables = NULL, *alarm_values = NULL, *alarm_types = NULL, *alarm_enables = NULL, *alarm_commands = NULL, *alarm_timeouts = NULL, *sensor_types = NULL, *multipliers = NULL, *offsets = NULL, *icons = NULL;
 	GSList *current_path, *current_id, *current_label, *current_interface, *current_enable, *current_alarm_value, *current_alarm_type, *current_alarm_command, *current_alarm_timeout, *current_alarm_enable, *current_sensor_type, *current_multiplier, *current_offset, *current_icon;
 
 	GError *error = NULL;
 
-	paths = panel_applet_gconf_get_list(sensors_applet->applet, PATHS, GCONF_VALUE_STRING, &error);
+	if (gethostname(hostname, sizeof(hostname)) == -1)
+		return FALSE;
+
+	snprintf(path, sizeof(path), "%s/%s", hostname, PATHS);
+	paths = panel_applet_gconf_get_list(sensors_applet->applet, path,
+					    GCONF_VALUE_STRING, &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	ids = panel_applet_gconf_get_list(sensors_applet->applet, IDS, GCONF_VALUE_STRING, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, IDS);
+	ids = panel_applet_gconf_get_list(sensors_applet->applet, path,
+					  GCONF_VALUE_STRING, &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	labels = panel_applet_gconf_get_list(sensors_applet->applet, LABELS, GCONF_VALUE_STRING, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, LABELS);
+	labels = panel_applet_gconf_get_list(sensors_applet->applet, path,
+					     GCONF_VALUE_STRING, &error);
 	if (error) {	
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	interfaces = panel_applet_gconf_get_list(sensors_applet->applet, INTERFACES, GCONF_VALUE_INT, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, INTERFACES);
+	interfaces = panel_applet_gconf_get_list(sensors_applet->applet, path,
+						 GCONF_VALUE_INT, &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	sensor_types = panel_applet_gconf_get_list(sensors_applet->applet, SENSOR_TYPES, GCONF_VALUE_INT, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, SENSOR_TYPES);
+	sensor_types = panel_applet_gconf_get_list(sensors_applet->applet,
+						   path, GCONF_VALUE_INT,
+						   &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	enables = panel_applet_gconf_get_list(sensors_applet->applet, ENABLES, GCONF_VALUE_BOOL, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ENABLES);
+	enables = panel_applet_gconf_get_list(sensors_applet->applet, path,
+					      GCONF_VALUE_BOOL, &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	alarm_values = panel_applet_gconf_get_list(sensors_applet->applet, ALARM_VALUES, GCONF_VALUE_INT, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_VALUES);
+	alarm_values = panel_applet_gconf_get_list(sensors_applet->applet,
+						   path, GCONF_VALUE_INT,
+						   &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	alarm_types = panel_applet_gconf_get_list(sensors_applet->applet, ALARM_TYPES, GCONF_VALUE_INT, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_TYPES);
+	alarm_types = panel_applet_gconf_get_list(sensors_applet->applet, path,
+						  GCONF_VALUE_INT, &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	alarm_enables = panel_applet_gconf_get_list(sensors_applet->applet, ALARM_ENABLES, GCONF_VALUE_BOOL, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_ENABLES);
+	alarm_enables = panel_applet_gconf_get_list(sensors_applet->applet,
+						    path, GCONF_VALUE_BOOL,
+						    &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	alarm_commands = panel_applet_gconf_get_list(sensors_applet->applet, ALARM_COMMANDS, GCONF_VALUE_STRING, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_COMMANDS);
+	alarm_commands = panel_applet_gconf_get_list(sensors_applet->applet,
+						     path, GCONF_VALUE_STRING,
+						     &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	alarm_timeouts = panel_applet_gconf_get_list(sensors_applet->applet, ALARM_TIMEOUTS, GCONF_VALUE_INT, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_TIMEOUTS);
+	alarm_timeouts = panel_applet_gconf_get_list(sensors_applet->applet,
+						     path, GCONF_VALUE_INT,
+						     &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	multipliers = panel_applet_gconf_get_list(sensors_applet->applet, MULTIPLIERS, GCONF_VALUE_INT, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, MULTIPLIERS);
+	multipliers = panel_applet_gconf_get_list(sensors_applet->applet, path,
+						  GCONF_VALUE_INT, &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	offsets = panel_applet_gconf_get_list(sensors_applet->applet, OFFSETS, GCONF_VALUE_INT, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, OFFSETS);
+	offsets = panel_applet_gconf_get_list(sensors_applet->applet, path,
+					      GCONF_VALUE_INT, &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
 		return FALSE;
 	}
 
-	icons = panel_applet_gconf_get_list(sensors_applet->applet, ICONS, GCONF_VALUE_STRING, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ICONS);
+	icons = panel_applet_gconf_get_list(sensors_applet->applet, path,
+					    GCONF_VALUE_STRING, &error);
 	if (error) {
 		sensors_applet_gconf_error_occurred();
 		g_error_free(error);
@@ -227,6 +265,7 @@
 	/* write everything to gconf except VISIBLE and
 	   ALARM_TIMEOUT_INDEX */
 	/* for stepping through GtkTreeStore data structure */
+	char hostname[20], path[50];
 	GtkTreeIter interfaces_iter, sensors_iter;
 	gboolean not_end_of_interfaces = TRUE, not_end_of_sensors = TRUE;
 
@@ -237,6 +276,10 @@
 	guint current_interface, current_alarm_timeout, current_sensor_type, current_alarm_type;
 	
 	GError *error = NULL;
+
+	if (gethostname(hostname, sizeof(hostname)) == -1)
+		return FALSE;
+
 	/* now step through the GtkTreeStore sensors to
 	   find which sensors are enabled */
 	for (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(sensors_applet->sensors), &interfaces_iter); not_end_of_interfaces; not_end_of_interfaces = gtk_tree_model_iter_next(GTK_TREE_MODEL(sensors_applet->sensors), &interfaces_iter)) {
@@ -307,85 +350,113 @@
 	offsets = g_slist_reverse(offsets);
 	icons = g_slist_reverse(icons);
 
-	panel_applet_gconf_set_list(sensors_applet->applet, PATHS, GCONF_VALUE_STRING, paths, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, PATHS);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_STRING, paths, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 
-	panel_applet_gconf_set_list(sensors_applet->applet, IDS, GCONF_VALUE_STRING, ids, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, IDS);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_STRING, ids, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 
-	panel_applet_gconf_set_list(sensors_applet->applet, LABELS, GCONF_VALUE_STRING, labels, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, LABELS);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+ 				    GCONF_VALUE_STRING, labels, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 
-	panel_applet_gconf_set_list(sensors_applet->applet, INTERFACES, GCONF_VALUE_INT, interfaces, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, INTERFACES);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_INT, interfaces, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 	
-	panel_applet_gconf_set_list(sensors_applet->applet, SENSOR_TYPES, GCONF_VALUE_INT, sensor_types, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, SENSOR_TYPES);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_INT, sensor_types, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 	
-	panel_applet_gconf_set_list(sensors_applet->applet, ENABLES, GCONF_VALUE_BOOL, enables, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ENABLES);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_BOOL, enables, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 	
-	panel_applet_gconf_set_list(sensors_applet->applet, ALARM_VALUES, GCONF_VALUE_INT, alarm_values, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_VALUES);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_INT, alarm_values, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 	
-	panel_applet_gconf_set_list(sensors_applet->applet, ALARM_TYPES, GCONF_VALUE_INT, alarm_types, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_TYPES);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_INT, alarm_types, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 	
-	panel_applet_gconf_set_list(sensors_applet->applet, ALARM_ENABLES, GCONF_VALUE_BOOL, alarm_enables, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_ENABLES);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_BOOL, alarm_enables, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 	
-	panel_applet_gconf_set_list(sensors_applet->applet, ALARM_COMMANDS, GCONF_VALUE_STRING, alarm_commands, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_COMMANDS);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_STRING, alarm_commands, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 	
-	panel_applet_gconf_set_list(sensors_applet->applet, ALARM_TIMEOUTS, GCONF_VALUE_INT, alarm_timeouts, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ALARM_TIMEOUTS);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_INT, alarm_timeouts, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
-	
-	panel_applet_gconf_set_list(sensors_applet->applet, MULTIPLIERS, GCONF_VALUE_INT, multipliers, &error);
+
+	snprintf(path, sizeof(path), "%s/%s", hostname, MULTIPLIERS);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_INT, multipliers, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 	
-	panel_applet_gconf_set_list(sensors_applet->applet, OFFSETS, GCONF_VALUE_INT, offsets, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, OFFSETS);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_INT, offsets, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;
 	}
 	
-	panel_applet_gconf_set_list(sensors_applet->applet, ICONS, GCONF_VALUE_STRING, icons, &error);
+	snprintf(path, sizeof(path), "%s/%s", hostname, ICONS);
+	panel_applet_gconf_set_list(sensors_applet->applet, path,
+				    GCONF_VALUE_STRING, icons, &error);
 	if (error) {
 		g_error_free(error);
 		return FALSE;

