From 7b773f5c8225479e0748db69b9ac7f92b127890c Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Tue, 24 Oct 2006 21:14:35 +0000 Subject: Allows to change the report output format. Better report generation code. --- hardinfo2/callbacks.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'hardinfo2/callbacks.c') diff --git a/hardinfo2/callbacks.c b/hardinfo2/callbacks.c index 1146bc50..c56088f4 100644 --- a/hardinfo2/callbacks.c +++ b/hardinfo2/callbacks.c @@ -37,8 +37,7 @@ void cb_copy_to_clipboard() ShellModuleEntry *entry = shell_get_main_shell()->selected; gchar *data = entry->func(entry->number); GtkClipboard *clip = gtk_clipboard_get(gdk_atom_intern("CLIPBOARD", FALSE)); - gchar *fmtdata = g_strdup(""); - ReportContext *ctx = report_context_string_new(NULL, fmtdata); + ReportContext *ctx = report_context_text_new(NULL); ctx->entry = entry; @@ -46,11 +45,10 @@ void cb_copy_to_clipboard() report_table(ctx, data); report_footer(ctx); - gtk_clipboard_set_text(clip, ctx->stream, -1); + gtk_clipboard_set_text(clip, ctx->output, -1); - g_free((gchar*) ctx->stream); - g_free(ctx); g_free(data); + report_context_free(ctx); } void cb_side_pane() -- cgit v1.2.3