diff options
Diffstat (limited to 'modules/benchmark.c')
-rw-r--r-- | modules/benchmark.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/modules/benchmark.c b/modules/benchmark.c index 511c984e..d4a39677 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -518,7 +518,7 @@ static gchar *benchmark_include_results_internal(bench_value this_machine_value, ShellOrderType order_type) { bench_result *this_machine; - GSList *result_list, *li; + GSList *result_list=NULL, *li; gchar *results = g_strdup(""); gchar *output; gchar *path; @@ -603,6 +603,7 @@ do_benchmark_handler(GIOChannel *source, GIOCondition condition, gpointer data) GIOStatus status; gchar *result; bench_value r = EMPTY_BENCH_VALUE; + status = g_io_channel_read_line(source, &result, NULL, NULL, NULL); if (status != G_IO_STATUS_NORMAL) { DEBUG("error while reading benchmark result"); @@ -657,8 +658,7 @@ static void do_benchmark(void (*benchmark_function)(void), int entry) bench_dialog = gtk_dialog_new_with_buttons ("Benchmarking...", GTK_WINDOW(shell_get_main_shell()->transient_dialog), GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, - "Stop", - GTK_BUTTONS_CLOSE, + _("Stop"), GTK_RESPONSE_ACCEPT, NULL); gtk_widget_set_sensitive(GTK_WIDGET(shell_get_main_shell()->transient_dialog), FALSE); @@ -670,8 +670,7 @@ static void do_benchmark(void (*benchmark_function)(void), int entry) #else box = gtk_hbox_new(FALSE, 1); #endif - label = gtk_label_new ("Please do not move your mouse\n" - "or press any keys."); + label = gtk_label_new ("Please do not move your mouse\nor press any keys."); gtk_widget_show (bench_image); @@ -681,11 +680,6 @@ static void do_benchmark(void (*benchmark_function)(void), int entry) gtk_misc_set_alignment(GTK_MISC(bench_image), 0.0, 0.0); #endif - g_signal_connect_swapped (bench_dialog, - "response", - G_CALLBACK (gtk_widget_destroy), - bench_dialog); - gtk_box_pack_start (GTK_BOX(box), bench_image, TRUE, TRUE, 10); gtk_box_pack_start (GTK_BOX(box), label, TRUE, TRUE, 10); gtk_container_add (GTK_CONTAINER(content_area), box); @@ -720,16 +714,15 @@ static void do_benchmark(void (*benchmark_function)(void), int entry) switch (gtk_dialog_run(GTK_DIALOG(bench_dialog))) { case GTK_RESPONSE_NONE: DEBUG("benchmark finished"); + bench_results[entry] = benchmark_dialog->r; break; case GTK_RESPONSE_ACCEPT: DEBUG("cancelling benchmark"); - gtk_widget_destroy(bench_dialog); g_source_remove(watch_id); kill(bench_pid, SIGINT); } - bench_results[entry] = benchmark_dialog->r; g_io_channel_unref(channel); shell_view_set_enabled(TRUE); @@ -835,7 +828,8 @@ static gchar *get_benchmark_results(gsize *len) ADD_JSON_VALUE(int, "MachineDataVersion", this_machine->machine_data_version); ADD_JSON_VALUE(string, "MachineType", this_machine->machine_type); - + ADD_JSON_VALUE(string, "LinuxKernel", this_machine->linux_kernel); + ADD_JSON_VALUE(string, "LinuxOS", this_machine->linux_os); ADD_JSON_VALUE(boolean, "Legacy", FALSE); ADD_JSON_VALUE(string, "ExtraInfo", bench_results[i].extra); ADD_JSON_VALUE(string, "UserNote", bench_results[i].user_note); @@ -867,7 +861,7 @@ static gchar *run_benchmark(gchar *name) { int i; - DEBUG("name = %s", name); + DEBUG("run_benchmark = %s", name); for (i = 0; entries[i].name; i++) { if (g_str_equal(entries[i].name, name)) { |