Sat, 27 Feb 2021 18:03:38 -0600
Add a description to PurpleCredentialProvider and show it in the preferences selector
Testing Done:
Compiled and ran locally.
Reviewed at https://reviews.imfreedom.org/r/539/
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
40651
8737840a09b7
Fix some file headers for the credential provider api
Gary Kramlich <grim@reaperworld.com>
parents:
40548
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
8737840a09b7
Fix some file headers for the credential provider api
Gary Kramlich <grim@reaperworld.com>
parents:
40548
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * This library is free software; you can redistribute it and/or |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * modify it under the terms of the GNU Lesser General Public |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * License as published by the Free Software Foundation; either |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * version 2 of the License, or (at your option) any later version. |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * This library is distributed in the hope that it will be useful, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * Lesser General Public License for more details. |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU Lesser General Public |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * License along with this library; if not, see <https://www.gnu.org/licenses/>. |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | */ |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | #include "purplecredentialprovider.h" |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | typedef struct { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | gchar *id; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | gchar *name; |
|
40790
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
24 | gchar *description; |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | } PurpleCredentialProviderPrivate; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | enum { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | PROP_0, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | PROP_ID, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | PROP_NAME, |
|
40790
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
31 | PROP_DESCRIPTION, |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | N_PROPERTIES, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | }; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | static GParamSpec *properties[N_PROPERTIES] = {NULL, }; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(PurpleCredentialProvider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | purple_credential_provider, G_TYPE_OBJECT) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | /****************************************************************************** |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | * Helpers |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | *****************************************************************************/ |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | static void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | purple_credential_provider_set_id(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | const gchar *id) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | PurpleCredentialProviderPrivate *priv = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | priv = purple_credential_provider_get_instance_private(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | g_free(priv->id); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | priv->id = g_strdup(id); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | g_object_notify_by_pspec(G_OBJECT(provider), properties[PROP_ID]); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | static void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | purple_credential_provider_set_name(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | const gchar *name) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | PurpleCredentialProviderPrivate *priv = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | priv = purple_credential_provider_get_instance_private(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | g_free(priv->name); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | priv->name = g_strdup(name); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | g_object_notify_by_pspec(G_OBJECT(provider), properties[PROP_NAME]); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | |
|
40790
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
70 | static void |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
71 | purple_credential_provider_set_description(PurpleCredentialProvider *provider, |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
72 | const gchar *description) |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
73 | { |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
74 | PurpleCredentialProviderPrivate *priv = NULL; |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
75 | |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
76 | priv = purple_credential_provider_get_instance_private(provider); |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
77 | |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
78 | g_free(priv->description); |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
79 | priv->description = g_strdup(description); |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
80 | |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
81 | g_object_notify_by_pspec(G_OBJECT(provider), properties[PROP_DESCRIPTION]); |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
82 | } |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
83 | |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | /****************************************************************************** |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | * GObject Implementation |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | *****************************************************************************/ |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | static void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | purple_credential_provider_get_property(GObject *obj, guint param_id, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | GValue *value, GParamSpec *pspec) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | PurpleCredentialProvider *provider = PURPLE_CREDENTIAL_PROVIDER(obj); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | switch(param_id) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | case PROP_ID: |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | g_value_set_string(value, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | purple_credential_provider_get_id(provider)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | break; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | case PROP_NAME: |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | g_value_set_string(value, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | purple_credential_provider_get_name(provider)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | break; |
|
40790
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
102 | case PROP_DESCRIPTION: |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
103 | g_value_set_string(value, |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
104 | purple_credential_provider_get_description(provider)); |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
105 | break; |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | default: |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | break; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | static void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | purple_credential_provider_set_property(GObject *obj, guint param_id, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
114 | const GValue *value, GParamSpec *pspec) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | PurpleCredentialProvider *provider = PURPLE_CREDENTIAL_PROVIDER(obj); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
117 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | switch(param_id) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | case PROP_ID: |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | purple_credential_provider_set_id(provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | g_value_get_string(value)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | break; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | case PROP_NAME: |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | purple_credential_provider_set_name(provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | g_value_get_string(value)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 | break; |
|
40790
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
127 | case PROP_DESCRIPTION: |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
128 | purple_credential_provider_set_description(provider, |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
129 | g_value_get_string(value)); |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
130 | break; |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
131 | default: |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
132 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | break; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | static void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
138 | purple_credential_provider_finalize(GObject *obj) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 | PurpleCredentialProvider *provider = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | PurpleCredentialProviderPrivate *priv = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | provider = PURPLE_CREDENTIAL_PROVIDER(obj); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | priv = purple_credential_provider_get_instance_private(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | g_clear_pointer(&priv->id, g_free); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | g_clear_pointer(&priv->name, g_free); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | G_OBJECT_CLASS(purple_credential_provider_parent_class)->finalize(obj); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | static void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | purple_credential_provider_init(PurpleCredentialProvider *provider) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
154 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | static void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | purple_credential_provider_class_init(PurpleCredentialProviderClass *klass) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
157 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
158 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | obj_class->get_property = purple_credential_provider_get_property; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
160 | obj_class->set_property = purple_credential_provider_set_property; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
161 | obj_class->finalize = purple_credential_provider_finalize; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
162 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
163 | /** |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
164 | * PurpleCredentialProvider::id: |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
165 | * |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
166 | * The ID of the provider. Used for preferences and other things that need |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
167 | * to address it. |
|
40790
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
168 | * |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
169 | * Since: 3.0.0 |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
170 | */ |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
171 | properties[PROP_ID] = g_param_spec_string( |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
172 | "id", "id", "The identifier of the provider", |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
173 | NULL, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
174 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
175 | ); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
176 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
177 | /** |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
178 | * PurpleCredentialProvider::name: |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
179 | * |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
180 | * The name of the provider which will be displayed to the user. |
|
40790
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
181 | * |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
182 | * Since: 3.0.0 |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
183 | */ |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
184 | properties[PROP_NAME] = g_param_spec_string( |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
185 | "name", "name", "The name of the provider", |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
186 | NULL, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
187 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
188 | ); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
189 | |
|
40790
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
190 | /** |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
191 | * PurpleCredentialProvider::description: |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
192 | * |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
193 | * The description of the provider which will be displayed to the user. |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
194 | * |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
195 | * Since: 3.0.0 |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
196 | */ |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
197 | properties[PROP_DESCRIPTION] = g_param_spec_string( |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
198 | "description", "description", "The description of the provider", |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
199 | NULL, |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
200 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
201 | ); |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
202 | |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
203 | g_object_class_install_properties(obj_class, N_PROPERTIES, properties); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
204 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
205 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
206 | /****************************************************************************** |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
207 | * Public API |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
208 | *****************************************************************************/ |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
209 | const gchar * |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
210 | purple_credential_provider_get_id(PurpleCredentialProvider *provider) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
211 | PurpleCredentialProviderPrivate *priv = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
212 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
213 | g_return_val_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider), NULL); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
214 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
215 | priv = purple_credential_provider_get_instance_private(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
216 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
217 | return priv->id; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
218 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
219 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
220 | const gchar * |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
221 | purple_credential_provider_get_name(PurpleCredentialProvider *provider) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
222 | PurpleCredentialProviderPrivate *priv = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
223 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
224 | g_return_val_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider), NULL); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
225 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
226 | priv = purple_credential_provider_get_instance_private(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
227 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
228 | return priv->name; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
229 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
230 | |
|
40790
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
231 | const gchar * |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
232 | purple_credential_provider_get_description(PurpleCredentialProvider *provider) { |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
233 | PurpleCredentialProviderPrivate *priv = NULL; |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
234 | |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
235 | g_return_val_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider), NULL); |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
236 | |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
237 | priv = purple_credential_provider_get_instance_private(provider); |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
238 | |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
239 | return priv->description; |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
240 | } |
|
e92d5c060155
Add a description to PurpleCredentialProvider and show it in the preferences selector
Gary Kramlich <grim@reaperworld.com>
parents:
40748
diff
changeset
|
241 | |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
242 | gboolean |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
243 | purple_credential_provider_is_valid(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
244 | GError **error) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
245 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
246 | PurpleCredentialProviderClass *klass = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
247 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
248 | g_return_val_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider), FALSE); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
249 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
250 | if(purple_credential_provider_get_id(provider) == NULL) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
251 | g_set_error_literal(error, PURPLE_CREDENTIAL_PROVIDER_DOMAIN, 0, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
252 | "provider has no id"); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
253 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
254 | return FALSE; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
255 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
256 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
257 | if(purple_credential_provider_get_name(provider) == NULL) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
258 | g_set_error_literal(error, PURPLE_CREDENTIAL_PROVIDER_DOMAIN, 1, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
259 | "provider has no name"); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
260 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
261 | return FALSE; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
262 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
263 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
264 | klass = PURPLE_CREDENTIAL_PROVIDER_GET_CLASS(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
265 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
266 | if(klass->read_password_async == NULL || klass->read_password_finish == NULL) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
267 | g_set_error_literal(error, PURPLE_CREDENTIAL_PROVIDER_DOMAIN, 2, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
268 | "provider can not read passwords"); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
269 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
270 | return FALSE; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
271 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
272 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
273 | if(klass->write_password_async == NULL || klass->write_password_finish == NULL) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
274 | g_set_error_literal(error, PURPLE_CREDENTIAL_PROVIDER_DOMAIN, 3, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
275 | "provider can not write passwords"); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
276 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
277 | return FALSE; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
278 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
279 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
280 | return TRUE; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
281 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
282 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
283 | void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
284 | purple_credential_provider_read_password_async(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
285 | PurpleAccount *account, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
286 | GCancellable *cancellable, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
287 | GAsyncReadyCallback callback, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
288 | gpointer data) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
289 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
290 | PurpleCredentialProviderClass *klass = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
291 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
292 | g_return_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
293 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
294 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
295 | klass = PURPLE_CREDENTIAL_PROVIDER_GET_CLASS(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
296 | if(klass && klass->read_password_async) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
297 | klass->read_password_async(provider, account, cancellable, callback, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
298 | data); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
299 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
300 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
301 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
302 | gchar * |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
303 | purple_credential_provider_read_password_finish(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
304 | GAsyncResult *result, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
305 | GError **error) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
306 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
307 | PurpleCredentialProviderClass *klass = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
308 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
309 | g_return_val_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider), NULL); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
310 | g_return_val_if_fail(G_IS_ASYNC_RESULT(result), NULL); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
311 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
312 | klass = PURPLE_CREDENTIAL_PROVIDER_GET_CLASS(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
313 | if(klass && klass->read_password_finish) { |
|
40679
062a4574af3e
Remove the account parameter from purple_credential_provider_*_finish functions.
Gary Kramlich <grim@reaperworld.com>
parents:
40651
diff
changeset
|
314 | return klass->read_password_finish(provider, result, error); |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
315 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
316 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
317 | return NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
318 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
319 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
320 | void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
321 | purple_credential_provider_write_password_async(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
322 | PurpleAccount *account, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
323 | const gchar *password, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
324 | GCancellable *cancellable, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
325 | GAsyncReadyCallback callback, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
326 | gpointer data) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
327 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
328 | PurpleCredentialProviderClass *klass = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
329 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
330 | g_return_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
331 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
332 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
333 | klass = PURPLE_CREDENTIAL_PROVIDER_GET_CLASS(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
334 | if(klass && klass->write_password_async) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
335 | klass->write_password_async(provider, account, password, cancellable, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
336 | callback, data); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
337 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
338 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
339 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
340 | gboolean |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
341 | purple_credential_provider_write_password_finish(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
342 | GAsyncResult *result, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
343 | GError **error) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
344 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
345 | PurpleCredentialProviderClass *klass = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
346 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
347 | g_return_val_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider), FALSE); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
348 | g_return_val_if_fail(G_IS_ASYNC_RESULT(result), FALSE); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
349 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
350 | klass = PURPLE_CREDENTIAL_PROVIDER_GET_CLASS(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
351 | if(klass && klass->write_password_finish) { |
|
40679
062a4574af3e
Remove the account parameter from purple_credential_provider_*_finish functions.
Gary Kramlich <grim@reaperworld.com>
parents:
40651
diff
changeset
|
352 | return klass->write_password_finish(provider, result, error); |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
353 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
354 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
355 | return FALSE; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
356 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
357 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
358 | void |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
359 | purple_credential_provider_clear_password_async(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
360 | PurpleAccount *account, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
361 | GCancellable *cancellable, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
362 | GAsyncReadyCallback callback, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
363 | gpointer data) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
364 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
365 | PurpleCredentialProviderClass *klass = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
366 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
367 | g_return_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
368 | g_return_if_fail(PURPLE_IS_ACCOUNT(account)); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
369 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
370 | klass = PURPLE_CREDENTIAL_PROVIDER_GET_CLASS(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
371 | if(klass && klass->clear_password_async) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
372 | klass->clear_password_async(provider, account, cancellable, callback, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
373 | data); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
374 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
375 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
376 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
377 | gboolean |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
378 | purple_credential_provider_clear_password_finish(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
379 | GAsyncResult *result, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
380 | GError **error) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
381 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
382 | PurpleCredentialProviderClass *klass = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
383 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
384 | g_return_val_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider), FALSE); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
385 | g_return_val_if_fail(G_IS_ASYNC_RESULT(result), FALSE); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
386 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
387 | klass = PURPLE_CREDENTIAL_PROVIDER_GET_CLASS(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
388 | if(klass && klass->clear_password_finish) { |
|
40679
062a4574af3e
Remove the account parameter from purple_credential_provider_*_finish functions.
Gary Kramlich <grim@reaperworld.com>
parents:
40651
diff
changeset
|
389 | return klass->clear_password_finish(provider, result, error); |
|
40548
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
390 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
391 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
392 | return FALSE; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
393 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
394 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
395 | PurpleRequestFields * |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
396 | purple_credential_provider_read_settings(PurpleCredentialProvider *provider) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
397 | PurpleCredentialProviderClass *klass = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
398 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
399 | g_return_val_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider), NULL); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
400 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
401 | klass = PURPLE_CREDENTIAL_PROVIDER_GET_CLASS(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
402 | if(klass && klass->read_settings) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
403 | return klass->read_settings(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
404 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
405 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
406 | return NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
407 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
408 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
409 | gboolean |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
410 | purple_credential_provider_write_settings(PurpleCredentialProvider *provider, |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
411 | PurpleRequestFields *fields) |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
412 | { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
413 | PurpleCredentialProviderClass *klass = NULL; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
414 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
415 | g_return_val_if_fail(PURPLE_IS_CREDENTIAL_PROVIDER(provider), FALSE); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
416 | g_return_val_if_fail(fields != NULL, FALSE); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
417 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
418 | klass = PURPLE_CREDENTIAL_PROVIDER_GET_CLASS(provider); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
419 | if(klass && klass->write_settings) { |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
420 | return klass->write_settings(provider, fields); |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
421 | } |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
422 | |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
423 | return FALSE; |
|
42556c49e1e2
Add PurpleCredentialProvider as the first piece to replace the existing keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
424 | } |