~ted/indicator-applet/log-to-file

« back to all changes in this revision

Viewing changes to src/applet-main.c

  • Committer: Ted Gould
  • Date: 2010-01-19 21:12:17 UTC
  • Revision ID: ted@gould.cx-20100119211217-g4o4bzm6vn5baafi
Switching to having a temp string for async.

Show diffs side-by-side

added added

removed removed

Lines of Context:
246
246
static void
247
247
log_to_file_cb (GObject * source_obj, GAsyncResult * result, gpointer user_data)
248
248
{
 
249
        g_free(user_data);
249
250
        return;
250
251
}
251
252
 
276
277
                        return;
277
278
                }
278
279
        }
279
 
 
 
280
        
 
281
        gchar * outputstring = g_strdup_printf("Message: %s\n", message);
280
282
        g_output_stream_write_async(G_OUTPUT_STREAM(log_file),
281
 
                                    message, /* data */
282
 
                                    strlen(message), /* length */
 
283
                                    outputstring, /* data */
 
284
                                    strlen(outputstring), /* length */
283
285
                                    G_PRIORITY_LOW, /* priority */
284
286
                                    NULL, /* cancelable */
285
287
                                    log_to_file_cb, /* callback */
286
 
                                    NULL); /* data */
 
288
                                    outputstring); /* data */
287
289
 
288
290
        return;
289
291
}