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

« back to all changes in this revision

Viewing changes to libcolord/cd-client.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:
57
57
#define CD_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CD_TYPE_CLIENT, CdClientPrivate))
58
58
 
59
59
#define CD_CLIENT_MESSAGE_TIMEOUT       15000 /* ms */
60
 
 
 
60
#define CD_CLIENT_IMPORT_DAEMON_TIMEOUT 5000 /* ms */
61
61
#define COLORD_DBUS_SERVICE             "org.freedesktop.ColorManager"
62
62
#define COLORD_DBUS_PATH                "/org/freedesktop/ColorManager"
63
63
#define COLORD_DBUS_INTERFACE           "org.freedesktop.ColorManager"
110
110
cd_client_error_quark (void)
111
111
{
112
112
        static GQuark quark = 0;
113
 
        if (!quark)
 
113
        if (!quark) {
114
114
                quark = g_quark_from_static_string ("cd_client_error");
 
115
                g_dbus_error_register_error (quark,
 
116
                                             CD_CLIENT_ERROR_FAILED,
 
117
                                             COLORD_DBUS_SERVICE ".Failed");
 
118
                g_dbus_error_register_error (quark,
 
119
                                             CD_CLIENT_ERROR_ALREADY_EXISTS,
 
120
                                             COLORD_DBUS_SERVICE ".AlreadyExists");
 
121
        }
115
122
        return quark;
116
123
}
117
124
 
150
157
        return client->priv->proxy != NULL;
151
158
}
152
159
 
 
160
/**
 
161
 * cd_client_get_has_server:
 
162
 * @client: a #CdClient instance.
 
163
 *
 
164
 * Gets if the colord server is currently running.
 
165
 *
 
166
 * Return value: %TRUE if the colord process is running
 
167
 *
 
168
 * Since: 0.1.12
 
169
 **/
 
170
gboolean
 
171
cd_client_get_has_server (CdClient *client)
 
172
{
 
173
        gboolean connected = FALSE;
 
174
        gchar *name_owner = NULL;
 
175
 
 
176
        g_return_val_if_fail (CD_IS_CLIENT (client), FALSE);
 
177
 
 
178
        /* not yet connected */
 
179
        if (client->priv->proxy == NULL)
 
180
                goto out;
 
181
 
 
182
        /* get name owner */
 
183
        name_owner = g_dbus_proxy_get_name_owner (client->priv->proxy);
 
184
        if (name_owner == NULL)
 
185
                goto out;
 
186
 
 
187
        /* just assume it's ready for use */
 
188
        connected = TRUE;
 
189
out:
 
190
        g_free (name_owner);
 
191
        return connected;
 
192
}
 
193
 
153
194
/**********************************************************************/
154
195
 
155
196
/**
239
280
 
240
281
/**********************************************************************/
241
282
 
242
 
/**********************************************************************/
243
 
 
244
283
/**
245
284
 * cd_client_connect_finish:
246
285
 * @client: a #CdClient instance.
311
350
 
312
351
        /* success */
313
352
        g_simple_async_result_set_op_res_gboolean (res_source, TRUE);
 
353
        g_simple_async_result_complete_in_idle (res_source);
314
354
out:
315
355
        if (daemon_version != NULL)
316
356
                g_variant_unref (daemon_version);
317
 
        g_simple_async_result_complete_in_idle (res_source);
318
357
        g_object_unref (res_source);
319
358
}
320
359
 
338
377
        GSimpleAsyncResult *res;
339
378
 
340
379
        g_return_if_fail (CD_IS_CLIENT (client));
 
380
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
341
381
 
342
382
        res = g_simple_async_result_new (G_OBJECT (client),
343
383
                                         callback,
410
450
                                           res,
411
451
                                           &error);
412
452
        if (result == NULL) {
413
 
                g_simple_async_result_set_error (res_source,
414
 
                                                 CD_CLIENT_ERROR,
415
 
                                                 CD_CLIENT_ERROR_FAILED,
416
 
                                                 "Failed to CreateDevice: %s",
417
 
                                                 error->message);
 
453
                g_simple_async_result_set_from_error (res_source,
 
454
                                                      error);
418
455
                g_error_free (error);
419
456
                goto out;
420
457
        }
464
501
        GList *list, *l;
465
502
 
466
503
        g_return_if_fail (CD_IS_CLIENT (client));
 
504
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
467
505
        g_return_if_fail (client->priv->proxy != NULL);
468
506
 
469
507
        res = g_simple_async_result_new (G_OBJECT (client),
563
601
        /* this is an error message */
564
602
        if (g_dbus_message_get_message_type (reply) == G_DBUS_MESSAGE_TYPE_ERROR) {
565
603
                g_dbus_message_to_gerror (reply, &error);
566
 
                g_simple_async_result_set_error (res_source,
567
 
                                                 CD_CLIENT_ERROR,
568
 
                                                 CD_CLIENT_ERROR_FAILED,
569
 
                                                 "Failed to CreateProfile: %s",
570
 
                                                 error->message);
 
604
                g_simple_async_result_set_from_error (res_source, error);
571
605
                g_error_free (error);
572
606
                goto out;
573
607
        }
624
658
        GVariantBuilder builder;
625
659
        GSimpleAsyncResult *res;
626
660
 
 
661
        g_return_if_fail (CD_IS_CLIENT (client));
 
662
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 
663
        g_return_if_fail (id != NULL);
 
664
 
627
665
        res = g_simple_async_result_new (G_OBJECT (client),
628
666
                                         callback,
629
667
                                         user_data,
710
748
/**********************************************************************/
711
749
 
712
750
/**
 
751
 * cd_client_import_get_profile_destination:
 
752
 **/
 
753
static GFile *
 
754
cd_client_import_get_profile_destination (GFile *file)
 
755
{
 
756
        gchar *basename;
 
757
        gchar *destination;
 
758
        GFile *dest;
 
759
 
 
760
        g_return_val_if_fail (file != NULL, NULL);
 
761
 
 
762
        /* get destination filename for this source file */
 
763
        basename = g_file_get_basename (file);
 
764
        destination = g_build_filename (g_get_user_data_dir (), "icc", basename, NULL);
 
765
        dest = g_file_new_for_path (destination);
 
766
 
 
767
        g_free (basename);
 
768
        g_free (destination);
 
769
        return dest;
 
770
}
 
771
 
 
772
/**
 
773
 * cd_client_import_mkdir_and_copy:
 
774
 **/
 
775
static gboolean
 
776
cd_client_import_mkdir_and_copy (GFile *source,
 
777
                                 GFile *destination,
 
778
                                 GCancellable *cancellable,
 
779
                                 GError **error)
 
780
{
 
781
        gboolean ret;
 
782
        GFile *parent;
 
783
 
 
784
        g_return_val_if_fail (source != NULL, FALSE);
 
785
        g_return_val_if_fail (destination != NULL, FALSE);
 
786
 
 
787
        /* get parent */
 
788
        parent = g_file_get_parent (destination);
 
789
 
 
790
        /* create directory */
 
791
        if (!g_file_query_exists (parent, cancellable)) {
 
792
                ret = g_file_make_directory_with_parents (parent, cancellable, error);
 
793
                if (!ret)
 
794
                        goto out;
 
795
        }
 
796
 
 
797
        /* do the copy */
 
798
        ret = g_file_copy (source, destination,
 
799
                           G_FILE_COPY_OVERWRITE,
 
800
                           cancellable, NULL, NULL, error);
 
801
        if (!ret)
 
802
                goto out;
 
803
out:
 
804
        g_object_unref (parent);
 
805
        return ret;
 
806
}
 
807
 
 
808
typedef struct {
 
809
        CdClient                *client;
 
810
        GCancellable            *cancellable;
 
811
        GFile                   *dest;
 
812
        GFile                   *file;
 
813
        GSimpleAsyncResult      *res;
 
814
        guint                    hangcheck_id;
 
815
        guint                    profile_added_id;
 
816
} CdClientImportHelper;
 
817
 
 
818
/**
 
819
 * cd_client_import_profile_finish:
 
820
 * @client: a #CdClient instance.
 
821
 * @res: the #GAsyncResult
 
822
 * @error: A #GError or %NULL
 
823
 *
 
824
 * Gets the result from the asynchronous function.
 
825
 *
 
826
 * Return value: (transfer full): a #CdProfile or %NULL
 
827
 *
 
828
 * Since: 0.1.12
 
829
 **/
 
830
CdProfile *
 
831
cd_client_import_profile_finish (CdClient *client,
 
832
                                 GAsyncResult *res,
 
833
                                 GError **error)
 
834
{
 
835
        GSimpleAsyncResult *simple;
 
836
 
 
837
        g_return_val_if_fail (CD_IS_CLIENT (client), NULL);
 
838
        g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), NULL);
 
839
        g_return_val_if_fail (error == NULL || *error == NULL, NULL);
 
840
 
 
841
        simple = G_SIMPLE_ASYNC_RESULT (res);
 
842
        if (g_simple_async_result_propagate_error (simple, error))
 
843
                return NULL;
 
844
 
 
845
        return g_object_ref (g_simple_async_result_get_op_res_gpointer (simple));
 
846
}
 
847
 
 
848
static void
 
849
cd_client_import_free_helper (CdClientImportHelper *helper)
 
850
{
 
851
        g_object_unref (helper->file);
 
852
        g_object_unref (helper->dest);
 
853
        if (helper->cancellable != NULL)
 
854
                g_object_unref (helper->cancellable);
 
855
        if (helper->profile_added_id > 0)
 
856
                g_signal_handler_disconnect (helper->client, helper->profile_added_id);
 
857
        if (helper->hangcheck_id > 0)
 
858
                g_source_remove (helper->hangcheck_id);
 
859
        g_object_unref (helper->client);
 
860
        g_object_unref (helper->res);
 
861
        g_free (helper);
 
862
}
 
863
 
 
864
static void
 
865
cd_client_import_profile_added_cb (CdClient *client,
 
866
                                   CdProfile *profile,
 
867
                                   gpointer user_data)
 
868
{
 
869
        CdClientImportHelper *helper = (CdClientImportHelper *) user_data;
 
870
 
 
871
        /* success */
 
872
        g_simple_async_result_set_op_res_gpointer (helper->res,
 
873
                                                   g_object_ref (profile),
 
874
                                                   (GDestroyNotify) g_object_unref);
 
875
        g_simple_async_result_complete_in_idle (helper->res);
 
876
        cd_client_import_free_helper (helper);
 
877
}
 
878
 
 
879
static gboolean
 
880
cd_client_import_hangcheck_cb (gpointer user_data)
 
881
{
 
882
        CdClientImportHelper *helper = (CdClientImportHelper *) user_data;
 
883
        g_simple_async_result_set_error (helper->res,
 
884
                                         CD_CLIENT_ERROR,
 
885
                                         CD_CLIENT_ERROR_FAILED,
 
886
                                         "The profile was not added in time");
 
887
        g_simple_async_result_complete_in_idle (helper->res);
 
888
        helper->hangcheck_id = 0;
 
889
        cd_client_import_free_helper (helper);
 
890
        return FALSE;
 
891
}
 
892
 
 
893
static void
 
894
cd_client_import_profile_find_filename_cb (GObject *source_object,
 
895
                                           GAsyncResult *res,
 
896
                                           gpointer user_data)
 
897
{
 
898
        CdProfile *profile;
 
899
        gboolean ret;
 
900
        gchar *filename = NULL;
 
901
        GError *error = NULL;
 
902
        CdClientImportHelper *helper = (CdClientImportHelper *) user_data;
 
903
 
 
904
        /* does the profile already exist */
 
905
        profile = cd_client_find_profile_by_filename_finish (CD_CLIENT (source_object),
 
906
                                                             res,
 
907
                                                             &error);
 
908
        if (profile != NULL) {
 
909
                filename = g_file_get_path (helper->dest);
 
910
                g_simple_async_result_set_error (helper->res,
 
911
                                                 CD_CLIENT_ERROR,
 
912
                                                 CD_CLIENT_ERROR_ALREADY_EXISTS,
 
913
                                                 "The profile %s already exists",
 
914
                                                 filename);
 
915
                g_simple_async_result_complete_in_idle (helper->res);
 
916
                cd_client_import_free_helper (helper);
 
917
                goto out;
 
918
        }
 
919
        if (error->domain != CD_CLIENT_ERROR ||
 
920
            error->code != CD_CLIENT_ERROR_FAILED) {
 
921
                g_simple_async_result_set_error (helper->res,
 
922
                                                 CD_CLIENT_ERROR,
 
923
                                                 CD_CLIENT_ERROR_FAILED,
 
924
                                                 "Failed to import: %s",
 
925
                                                 error->message);
 
926
                g_simple_async_result_complete_in_idle (helper->res);
 
927
                cd_client_import_free_helper (helper);
 
928
                g_error_free (error);
 
929
                goto out;
 
930
        }
 
931
 
 
932
        /* reset the error */
 
933
        g_clear_error (&error);
 
934
 
 
935
        /* watch for a new profile to be detected and added,
 
936
         * but time out after a couple of seconds */
 
937
        helper->hangcheck_id = g_timeout_add (CD_CLIENT_IMPORT_DAEMON_TIMEOUT,
 
938
                                              cd_client_import_hangcheck_cb,
 
939
                                              helper);
 
940
        helper->profile_added_id = g_signal_connect (helper->client, "profile-added",
 
941
                                                     G_CALLBACK (cd_client_import_profile_added_cb),
 
942
                                                     helper);
 
943
 
 
944
        /* copy profile to the correct place */
 
945
        ret = cd_client_import_mkdir_and_copy (helper->file,
 
946
                                               helper->dest,
 
947
                                               helper->cancellable,
 
948
                                               &error);
 
949
        if (!ret) {
 
950
                g_simple_async_result_set_error (helper->res,
 
951
                                                 CD_CLIENT_ERROR,
 
952
                                                 CD_CLIENT_ERROR_FAILED,
 
953
                                                 "Failed to copy: %s",
 
954
                                                 error->message);
 
955
                g_error_free (error);
 
956
                g_simple_async_result_complete_in_idle (helper->res);
 
957
                cd_client_import_free_helper (helper);
 
958
                goto out;
 
959
        }
 
960
out:
 
961
        g_free (filename);
 
962
        if (profile != NULL)
 
963
                g_object_unref (profile);
 
964
}
 
965
 
 
966
static void
 
967
cd_client_import_profile_query_info_cb (GObject *source_object,
 
968
                                        GAsyncResult *res,
 
969
                                        gpointer user_data)
 
970
{
 
971
        const gchar *type;
 
972
        gchar *filename = NULL;
 
973
        GError *error = NULL;
 
974
        GFileInfo *info;
 
975
        CdClientImportHelper *helper = (CdClientImportHelper *) user_data;
 
976
 
 
977
        /* get the file info */
 
978
        filename = g_file_get_path (helper->dest);
 
979
        info = g_file_query_info_finish (G_FILE (source_object),
 
980
                                         res,
 
981
                                         &error);
 
982
        if (info == NULL) {
 
983
                g_simple_async_result_set_error (helper->res,
 
984
                                                 CD_CLIENT_ERROR,
 
985
                                                 CD_CLIENT_ERROR_FAILED,
 
986
                                                 "Cannot get content type for %s: %s",
 
987
                                                 filename,
 
988
                                                 error->message);
 
989
                g_error_free (error);
 
990
                g_simple_async_result_complete_in_idle (helper->res);
 
991
                cd_client_import_free_helper (helper);
 
992
                goto out;
 
993
        }
 
994
 
 
995
        /* check the content type */
 
996
        type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
 
997
        if (g_strcmp0 (type, "application/vnd.iccprofile") != 0) {
 
998
                g_simple_async_result_set_error (helper->res,
 
999
                                                 CD_CLIENT_ERROR,
 
1000
                                                 CD_CLIENT_ERROR_FILE_INVALID,
 
1001
                                                 "Incorrect content type for %s, got %s",
 
1002
                                                 filename, type);
 
1003
                g_simple_async_result_complete_in_idle (helper->res);
 
1004
                cd_client_import_free_helper (helper);
 
1005
                goto out;
 
1006
        }
 
1007
 
 
1008
        /* does this profile already exist? */
 
1009
        cd_client_find_profile_by_filename (helper->client,
 
1010
                                            filename,
 
1011
                                            helper->cancellable,
 
1012
                                            cd_client_import_profile_find_filename_cb,
 
1013
                                            helper);
 
1014
out:
 
1015
        if (info != NULL)
 
1016
                g_object_unref (info);
 
1017
        g_free (filename);
 
1018
}
 
1019
 
 
1020
/**
 
1021
 * cd_client_import_profile:
 
1022
 * @client: a #CdClient instance.
 
1023
 * @file: a #GFile
 
1024
 * @cancellable: a #GCancellable, or %NULL
 
1025
 * @callback: the function to run on completion
 
1026
 * @user_data: the data to pass to @callback
 
1027
 *
 
1028
 * Imports a color profile into the users home directory.
 
1029
 *
 
1030
 * If the profile should be accessable for all users, then call
 
1031
 * cd_profile_install_system_wide() on the result.
 
1032
 *
 
1033
 * Since: 0.1.12
 
1034
 **/
 
1035
void
 
1036
cd_client_import_profile (CdClient *client,
 
1037
                          GFile *file,
 
1038
                          GCancellable *cancellable,
 
1039
                          GAsyncReadyCallback callback,
 
1040
                          gpointer user_data)
 
1041
{
 
1042
        CdClientImportHelper *helper;
 
1043
 
 
1044
        g_return_if_fail (CD_IS_CLIENT (client));
 
1045
        g_return_if_fail (G_IS_FILE (file));
 
1046
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 
1047
 
 
1048
        helper = g_new0 (CdClientImportHelper, 1);
 
1049
        helper->client = g_object_ref (client);
 
1050
        helper->res = g_simple_async_result_new (G_OBJECT (client),
 
1051
                                                 callback,
 
1052
                                                 user_data,
 
1053
                                                 cd_client_import_profile);
 
1054
        helper->file = g_object_ref (file);
 
1055
        helper->dest = cd_client_import_get_profile_destination (file);
 
1056
        if (cancellable != NULL)
 
1057
                helper->cancellable = g_object_ref (cancellable);
 
1058
 
 
1059
        /* check the file really is an ICC file */
 
1060
        g_file_query_info_async (helper->file,
 
1061
                                 G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
 
1062
                                 G_FILE_QUERY_INFO_NONE,
 
1063
                                 G_PRIORITY_DEFAULT,
 
1064
                                 helper->cancellable,
 
1065
                                 cd_client_import_profile_query_info_cb,
 
1066
                                 helper);
 
1067
}
 
1068
 
 
1069
/**********************************************************************/
 
1070
 
 
1071
/**
713
1072
 * cd_client_delete_device_finish:
714
1073
 * @client: a #CdClient instance.
715
1074
 * @res: the #GAsyncResult
791
1150
        GSimpleAsyncResult *res;
792
1151
 
793
1152
        g_return_if_fail (CD_IS_CLIENT (client));
 
1153
        g_return_if_fail (CD_IS_DEVICE (device));
 
1154
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
794
1155
        g_return_if_fail (client->priv->proxy != NULL);
795
1156
 
796
1157
        res = g_simple_async_result_new (G_OBJECT (client),
892
1253
        GSimpleAsyncResult *res;
893
1254
 
894
1255
        g_return_if_fail (CD_IS_CLIENT (client));
 
1256
        g_return_if_fail (CD_IS_PROFILE (profile));
 
1257
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
895
1258
        g_return_if_fail (client->priv->proxy != NULL);
896
1259
 
897
1260
        res = g_simple_async_result_new (G_OBJECT (client),
1004
1367
        GSimpleAsyncResult *res;
1005
1368
 
1006
1369
        g_return_if_fail (CD_IS_CLIENT (client));
 
1370
        g_return_if_fail (id != NULL);
 
1371
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
1007
1372
        g_return_if_fail (client->priv->proxy != NULL);
1008
1373
 
1009
1374
        res = g_simple_async_result_new (G_OBJECT (client),
1117
1482
        GSimpleAsyncResult *res;
1118
1483
 
1119
1484
        g_return_if_fail (CD_IS_CLIENT (client));
 
1485
        g_return_if_fail (key != NULL);
 
1486
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
1120
1487
        g_return_if_fail (client->priv->proxy != NULL);
1121
1488
 
1122
1489
        res = g_simple_async_result_new (G_OBJECT (client),
1228
1595
        GSimpleAsyncResult *res;
1229
1596
 
1230
1597
        g_return_if_fail (CD_IS_CLIENT (client));
 
1598
        g_return_if_fail (id != NULL);
 
1599
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
1231
1600
        g_return_if_fail (client->priv->proxy != NULL);
1232
1601
 
1233
1602
        res = g_simple_async_result_new (G_OBJECT (client),
1339
1708
        GSimpleAsyncResult *res;
1340
1709
 
1341
1710
        g_return_if_fail (CD_IS_CLIENT (client));
 
1711
        g_return_if_fail (filename != NULL);
 
1712
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
1342
1713
        g_return_if_fail (client->priv->proxy != NULL);
1343
1714
 
1344
1715
        res = g_simple_async_result_new (G_OBJECT (client),
1450
1821
        GSimpleAsyncResult *res;
1451
1822
 
1452
1823
        g_return_if_fail (CD_IS_CLIENT (client));
 
1824
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
1453
1825
        g_return_if_fail (client->priv->proxy != NULL);
1454
1826
 
1455
1827
        res = g_simple_async_result_new (G_OBJECT (client),
1588
1960
        GSimpleAsyncResult *res;
1589
1961
 
1590
1962
        g_return_if_fail (CD_IS_CLIENT (client));
 
1963
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
1591
1964
        g_return_if_fail (client->priv->proxy != NULL);
1592
1965
 
1593
1966
        res = g_simple_async_result_new (G_OBJECT (client),
1697
2070
        GSimpleAsyncResult *res;
1698
2071
 
1699
2072
        g_return_if_fail (CD_IS_CLIENT (client));
 
2073
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
1700
2074
        g_return_if_fail (client->priv->proxy != NULL);
1701
2075
 
1702
2076
        res = g_simple_async_result_new (G_OBJECT (client),
1835
2209
        GSimpleAsyncResult *res;
1836
2210
 
1837
2211
        g_return_if_fail (CD_IS_CLIENT (client));
 
2212
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
1838
2213
        g_return_if_fail (client->priv->proxy != NULL);
1839
2214
 
1840
2215
        res = g_simple_async_result_new (G_OBJECT (client),
1972
2347
        GSimpleAsyncResult *res;
1973
2348
 
1974
2349
        g_return_if_fail (CD_IS_CLIENT (client));
 
2350
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
1975
2351
        g_return_if_fail (client->priv->proxy != NULL);
1976
2352
 
1977
2353
        res = g_simple_async_result_new (G_OBJECT (client),
2219
2595
cd_client_init (CdClient *client)
2220
2596
{
2221
2597
        client->priv = CD_CLIENT_GET_PRIVATE (client);
 
2598
 
 
2599
        /* ensure the remote errors are registered */
 
2600
        cd_client_error_quark ();
2222
2601
}
2223
2602
 
2224
2603
/*