From: Jean-Philippe Orsini Date: Tue, 2 Apr 2013 16:39:43 +0000 (+0000) Subject: fixed the selection of the sensor X-Git-Tag: v0.8.0.5~104 X-Git-Url: http://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=67578c86259e0c57fac82727a6bd8f4e7b54e3a8 fixed the selection of the sensor --- diff --git a/src/ui_sensorpref.c b/src/ui_sensorpref.c index a4077ca..3fef8cc 100644 --- a/src/ui_sensorpref.c +++ b/src/ui_sensorpref.c @@ -423,17 +423,16 @@ void ui_sensorpref_dialog_run(struct psensor *sensor, struct ui_psensor *ui) { GtkDialog *diag; gint result; + guint ok; GtkBuilder *builder; - GError *error = NULL; + GError *error; GtkTreeView *w_sensors_list; - guint ok; GtkListStore *store; - struct psensor **s_cur, *s; + struct psensor **s_cur, *s, **ordered_sensors; GtkTreeSelection *selection; struct cb_data cbdata; GtkTreeIter iter; struct sensor_pref *spref; - struct psensor **ordered_sensors; gboolean valid; GtkTreeModel *model; @@ -442,6 +441,7 @@ void ui_sensorpref_dialog_run(struct psensor *sensor, struct ui_psensor *ui) builder = gtk_builder_new(); cbdata.builder = builder; + error = NULL; ok = gtk_builder_add_from_file (builder, PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "sensor-edit.glade", @@ -476,11 +476,12 @@ void ui_sensorpref_dialog_run(struct psensor *sensor, struct ui_psensor *ui) if (s == sensor) update_pref(spref, ui->config, builder); } - free(ordered_sensors); selection = gtk_tree_view_get_selection(w_sensors_list); g_signal_connect(selection, "changed", G_CALLBACK(on_changed), &cbdata); - select_sensor(sensor, ui->sensors, w_sensors_list); + select_sensor(sensor, ordered_sensors, w_sensors_list); + + free(ordered_sensors); diag = GTK_DIALOG(gtk_builder_get_object(builder, "dialog1")); result = gtk_dialog_run(diag);