~ubuntu-branches/ubuntu/quantal/colord/quantal-proposed

« back to all changes in this revision

Viewing changes to libcolord/cd-client-sync.c

  • Committer: Package Import Robot
  • Author(s): Sjoerd Simons
  • Date: 2011-10-25 16:21:20 UTC
  • mto: (2.1.1 sid) (1.1.2)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: package-import@ubuntu.com-20111025162120-0aypjqn1zx9n6vgf
Tags: upstream-0.1.13
ImportĀ upstreamĀ versionĀ 0.1.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
365
365
/**********************************************************************/
366
366
 
367
367
static void
 
368
cd_client_import_profile_finish_sync (CdClient *client,
 
369
                                      GAsyncResult *res,
 
370
                                      CdClientHelper *helper)
 
371
{
 
372
        helper->profile = cd_client_import_profile_finish (client,
 
373
                                                           res,
 
374
                                                           helper->error);
 
375
        g_main_loop_quit (helper->loop);
 
376
}
 
377
 
 
378
/**
 
379
 * cd_client_import_profile_sync:
 
380
 * @client: a #CdClient instance.
 
381
 * @file: A #GFile
 
382
 * @cancellable: a #GCancellable, or %NULL
 
383
 * @error: a #GError, or %NULL
 
384
 *
 
385
 * Imports a color profile into the users home directory.
 
386
 *
 
387
 * WARNING: This function is synchronous, and may block.
 
388
 * Do not use it in GUI applications.
 
389
 *
 
390
 * Return value: (transfer full): A #CdProfile object, or %NULL for error
 
391
 *
 
392
 * Since: 0.1.12
 
393
 **/
 
394
CdProfile *
 
395
cd_client_import_profile_sync (CdClient *client,
 
396
                               GFile *file,
 
397
                               GCancellable *cancellable,
 
398
                               GError **error)
 
399
{
 
400
        CdClientHelper helper;
 
401
 
 
402
        /* import temp object */
 
403
        helper.loop = g_main_loop_new (NULL, FALSE);
 
404
        helper.error = error;
 
405
        helper.profile = NULL;
 
406
 
 
407
        /* run async method */
 
408
        cd_client_import_profile (client, file, cancellable,
 
409
                                  (GAsyncReadyCallback) cd_client_import_profile_finish_sync,
 
410
                                  &helper);
 
411
        g_main_loop_run (helper.loop);
 
412
 
 
413
        /* free temp object */
 
414
        g_main_loop_unref (helper.loop);
 
415
 
 
416
        return helper.profile;
 
417
}
 
418
 
 
419
/**********************************************************************/
 
420
 
 
421
static void
368
422
cd_client_create_device_finish_sync (CdClient *client,
369
423
                                      GAsyncResult *res,
370
424
                                      CdClientHelper *helper)