Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / glib-networking / hardcode-gsettings.patch
blob0a091b2344dcbe11c56a0d2600df9a5a3c9e5f43
1 diff --git a/proxy/gnome/gproxyresolvergnome.c b/proxy/gnome/gproxyresolvergnome.c
2 index 50b63cd..4364116 100644
3 --- a/proxy/gnome/gproxyresolvergnome.c
4 +++ b/proxy/gnome/gproxyresolvergnome.c
5 @@ -156,23 +156,79 @@
7 resolver->base_resolver = g_simple_proxy_resolver_new (NULL, NULL);
9 - resolver->proxy_settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
10 + {
11 + GSettingsSchemaSource *schema_source;
12 + GSettingsSchema *schema;
13 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
14 + g_settings_schema_source_get_default(),
15 + TRUE, NULL);
16 + schema = g_settings_schema_source_lookup(schema_source,
17 + GNOME_PROXY_SETTINGS_SCHEMA,
18 + FALSE);
19 + resolver->proxy_settings = g_settings_new_full(schema, NULL, NULL);
20 + g_settings_schema_source_unref(schema_source);
21 + g_settings_schema_unref(schema);
22 + }
23 g_signal_connect (resolver->proxy_settings, "changed",
24 G_CALLBACK (gsettings_changed), resolver);
25 - resolver->http_settings = g_settings_get_child (resolver->proxy_settings,
26 - GNOME_PROXY_HTTP_CHILD_SCHEMA);
27 + {
28 + GSettingsSchemaSource *schema_source;
29 + GSettingsSchema *schema;
30 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
31 + g_settings_schema_source_get_default(),
32 + TRUE, NULL);
33 + schema = g_settings_schema_source_lookup(schema_source,
34 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA,
35 + FALSE);
36 + resolver->http_settings = g_settings_new_full(schema, NULL, NULL);
37 + g_settings_schema_source_unref(schema_source);
38 + g_settings_schema_unref(schema);
39 + }
40 g_signal_connect (resolver->http_settings, "changed",
41 G_CALLBACK (gsettings_changed), resolver);
42 - resolver->https_settings = g_settings_get_child (resolver->proxy_settings,
43 - GNOME_PROXY_HTTPS_CHILD_SCHEMA);
44 + {
45 + GSettingsSchemaSource *schema_source;
46 + GSettingsSchema *schema;
47 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
48 + g_settings_schema_source_get_default(),
49 + TRUE, NULL);
50 + schema = g_settings_schema_source_lookup(schema_source,
51 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTPS_CHILD_SCHEMA,
52 + FALSE);
53 + resolver->https_settings = g_settings_new_full(schema, NULL, NULL);
54 + g_settings_schema_source_unref(schema_source);
55 + g_settings_schema_unref(schema);
56 + }
57 g_signal_connect (resolver->https_settings, "changed",
58 G_CALLBACK (gsettings_changed), resolver);
59 - resolver->ftp_settings = g_settings_get_child (resolver->proxy_settings,
60 - GNOME_PROXY_FTP_CHILD_SCHEMA);
61 + {
62 + GSettingsSchemaSource *schema_source;
63 + GSettingsSchema *schema;
64 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
65 + g_settings_schema_source_get_default(),
66 + TRUE, NULL);
67 + schema = g_settings_schema_source_lookup(schema_source,
68 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_FTP_CHILD_SCHEMA,
69 + FALSE);
70 + resolver->ftp_settings = g_settings_new_full(schema, NULL, NULL);
71 + g_settings_schema_source_unref(schema_source);
72 + g_settings_schema_unref(schema);
73 + }
74 g_signal_connect (resolver->ftp_settings, "changed",
75 G_CALLBACK (gsettings_changed), resolver);
76 - resolver->socks_settings = g_settings_get_child (resolver->proxy_settings,
77 - GNOME_PROXY_SOCKS_CHILD_SCHEMA);
78 + {
79 + GSettingsSchemaSource *schema_source;
80 + GSettingsSchema *schema;
81 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
82 + g_settings_schema_source_get_default(),
83 + TRUE, NULL);
84 + schema = g_settings_schema_source_lookup(schema_source,
85 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_SOCKS_CHILD_SCHEMA,
86 + FALSE);
87 + resolver->socks_settings = g_settings_new_full(schema, NULL, NULL);
88 + g_settings_schema_source_unref(schema_source);
89 + g_settings_schema_unref(schema);
90 + }
91 g_signal_connect (resolver->socks_settings, "changed",
92 G_CALLBACK (gsettings_changed), resolver);
94 diff --git a/proxy/tests/gnome.c b/proxy/tests/gnome.c
95 index f76b094..54751e3 100644
96 --- a/proxy/tests/gnome.c
97 +++ b/proxy/tests/gnome.c
98 @@ -55,26 +55,86 @@
100 GSettings *settings, *child;
102 - settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
104 + GSettingsSchemaSource *schema_source;
105 + GSettingsSchema *schema;
106 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
107 + g_settings_schema_source_get_default(),
108 + TRUE, NULL);
109 + schema = g_settings_schema_source_lookup(schema_source,
110 + GNOME_PROXY_SETTINGS_SCHEMA,
111 + FALSE);
112 + settings = g_settings_new_full(schema, NULL, NULL);
113 + g_settings_schema_source_unref(schema_source);
114 + g_settings_schema_unref(schema);
116 g_settings_reset (settings, GNOME_PROXY_MODE_KEY);
117 g_settings_reset (settings, GNOME_PROXY_USE_SAME_PROXY_KEY);
119 - child = g_settings_get_child (settings, GNOME_PROXY_HTTP_CHILD_SCHEMA);
121 + GSettingsSchemaSource *schema_source;
122 + GSettingsSchema *schema;
123 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
124 + g_settings_schema_source_get_default(),
125 + TRUE, NULL);
126 + schema = g_settings_schema_source_lookup(schema_source,
127 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA,
128 + FALSE);
129 + child = g_settings_new_full(schema, NULL, NULL);
130 + g_settings_schema_source_unref(schema_source);
131 + g_settings_schema_unref(schema);
133 g_settings_reset (child, GNOME_PROXY_HTTP_HOST_KEY);
134 g_settings_reset (child, GNOME_PROXY_HTTP_PORT_KEY);
135 g_object_unref (child);
137 - child = g_settings_get_child (settings, GNOME_PROXY_HTTPS_CHILD_SCHEMA);
139 + GSettingsSchemaSource *schema_source;
140 + GSettingsSchema *schema;
141 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
142 + g_settings_schema_source_get_default(),
143 + TRUE, NULL);
144 + schema = g_settings_schema_source_lookup(schema_source,
145 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTPS_CHILD_SCHEMA,
146 + FALSE);
147 + child = g_settings_new_full(schema, NULL, NULL);
148 + g_settings_schema_source_unref(schema_source);
149 + g_settings_schema_unref(schema);
151 g_settings_reset (child, GNOME_PROXY_HTTPS_HOST_KEY);
152 g_settings_reset (child, GNOME_PROXY_HTTPS_PORT_KEY);
153 g_object_unref (child);
155 - child = g_settings_get_child (settings, GNOME_PROXY_FTP_CHILD_SCHEMA);
157 + GSettingsSchemaSource *schema_source;
158 + GSettingsSchema *schema;
159 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
160 + g_settings_schema_source_get_default(),
161 + TRUE, NULL);
162 + schema = g_settings_schema_source_lookup(schema_source,
163 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_FTP_CHILD_SCHEMA,
164 + FALSE);
165 + child = g_settings_new_full(schema, NULL, NULL);
166 + g_settings_schema_source_unref(schema_source);
167 + g_settings_schema_unref(schema);
169 g_settings_reset (child, GNOME_PROXY_FTP_HOST_KEY);
170 g_settings_reset (child, GNOME_PROXY_FTP_PORT_KEY);
171 g_object_unref (child);
173 - child = g_settings_get_child (settings, GNOME_PROXY_SOCKS_CHILD_SCHEMA);
175 + GSettingsSchemaSource *schema_source;
176 + GSettingsSchema *schema;
177 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
178 + g_settings_schema_source_get_default(),
179 + TRUE, NULL);
180 + schema = g_settings_schema_source_lookup(schema_source,
181 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_SOCKS_CHILD_SCHEMA,
182 + FALSE);
183 + child = g_settings_new_full(schema, NULL, NULL);
184 + g_settings_schema_source_unref(schema_source);
185 + g_settings_schema_unref(schema);
187 g_settings_reset (child, GNOME_PROXY_SOCKS_HOST_KEY);
188 g_settings_reset (child, GNOME_PROXY_SOCKS_PORT_KEY);
189 g_object_unref (child);
190 @@ -88,21 +148,69 @@
192 GSettings *settings, *child;
194 - settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
196 + GSettingsSchemaSource *schema_source;
197 + GSettingsSchema *schema;
198 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
199 + g_settings_schema_source_get_default(),
200 + TRUE, NULL);
201 + schema = g_settings_schema_source_lookup(schema_source,
202 + GNOME_PROXY_SETTINGS_SCHEMA,
203 + FALSE);
204 + settings = g_settings_new_full(schema, NULL, NULL);
205 + g_settings_schema_source_unref(schema_source);
206 + g_settings_schema_unref(schema);
208 g_settings_set_enum (settings, GNOME_PROXY_MODE_KEY, G_DESKTOP_PROXY_MODE_MANUAL);
209 g_settings_set_boolean (settings, GNOME_PROXY_USE_SAME_PROXY_KEY, TRUE);
211 - child = g_settings_get_child (settings, GNOME_PROXY_HTTP_CHILD_SCHEMA);
213 + GSettingsSchemaSource *schema_source;
214 + GSettingsSchema *schema;
215 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
216 + g_settings_schema_source_get_default(),
217 + TRUE, NULL);
218 + schema = g_settings_schema_source_lookup(schema_source,
219 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA,
220 + FALSE);
221 + child = g_settings_new_full(schema, NULL, NULL);
222 + g_settings_schema_source_unref(schema_source);
223 + g_settings_schema_unref(schema);
225 g_settings_set_string (child, GNOME_PROXY_HTTP_HOST_KEY, "proxy.example.com");
226 g_settings_set_int (child, GNOME_PROXY_HTTP_PORT_KEY, 8080);
227 g_object_unref (child);
229 - child = g_settings_get_child (settings, GNOME_PROXY_HTTPS_CHILD_SCHEMA);
231 + GSettingsSchemaSource *schema_source;
232 + GSettingsSchema *schema;
233 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
234 + g_settings_schema_source_get_default(),
235 + TRUE, NULL);
236 + schema = g_settings_schema_source_lookup(schema_source,
237 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTPS_CHILD_SCHEMA,
238 + FALSE);
239 + child = g_settings_new_full(schema, NULL, NULL);
240 + g_settings_schema_source_unref(schema_source);
241 + g_settings_schema_unref(schema);
243 g_settings_set_string (child, GNOME_PROXY_HTTPS_HOST_KEY, "proxy-s.example.com");
244 g_settings_set_int (child, GNOME_PROXY_HTTPS_PORT_KEY, 7070);
245 g_object_unref (child);
247 - child = g_settings_get_child (settings, GNOME_PROXY_FTP_CHILD_SCHEMA);
249 + GSettingsSchemaSource *schema_source;
250 + GSettingsSchema *schema;
251 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
252 + g_settings_schema_source_get_default(),
253 + TRUE, NULL);
254 + schema = g_settings_schema_source_lookup(schema_source,
255 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_FTP_CHILD_SCHEMA,
256 + FALSE);
257 + child = g_settings_new_full(schema, NULL, NULL);
258 + g_settings_schema_source_unref(schema_source);
259 + g_settings_schema_unref(schema);
261 g_settings_set_string (child, GNOME_PROXY_FTP_HOST_KEY, "proxy-f.example.com");
262 g_settings_set_int (child, GNOME_PROXY_FTP_PORT_KEY, 6060);
263 g_object_unref (child);
264 @@ -119,12 +227,36 @@
265 GSettings *settings, *child;
266 const gchar *ignore_hosts[2] = { "127.0.0.1", NULL };
268 - settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
270 + GSettingsSchemaSource *schema_source;
271 + GSettingsSchema *schema;
272 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
273 + g_settings_schema_source_get_default(),
274 + TRUE, NULL);
275 + schema = g_settings_schema_source_lookup(schema_source,
276 + GNOME_PROXY_SETTINGS_SCHEMA,
277 + FALSE);
278 + settings = g_settings_new_full(schema, NULL, NULL);
279 + g_settings_schema_source_unref(schema_source);
280 + g_settings_schema_unref(schema);
282 g_settings_set_enum (settings, GNOME_PROXY_MODE_KEY, G_DESKTOP_PROXY_MODE_MANUAL);
283 g_settings_set (settings, GNOME_PROXY_IGNORE_HOSTS_KEY,
284 "@as", g_variant_new_strv (ignore_hosts, -1));
286 - child = g_settings_get_child (settings, GNOME_PROXY_SOCKS_CHILD_SCHEMA);
288 + GSettingsSchemaSource *schema_source;
289 + GSettingsSchema *schema;
290 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
291 + g_settings_schema_source_get_default(),
292 + TRUE, NULL);
293 + schema = g_settings_schema_source_lookup(schema_source,
294 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_SOCKS_CHILD_SCHEMA,
295 + FALSE);
296 + child = g_settings_new_full(schema, NULL, NULL);
297 + g_settings_schema_source_unref(schema_source);
298 + g_settings_schema_unref(schema);
300 g_settings_set_string (child, GNOME_PROXY_SOCKS_HOST_KEY, "proxy.example.com");
301 g_settings_set_int (child, GNOME_PROXY_SOCKS_PORT_KEY, 1234);
302 g_object_unref (child);
303 @@ -139,12 +271,36 @@
305 GSettings *settings, *http;
307 - settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
309 + GSettingsSchemaSource *schema_source;
310 + GSettingsSchema *schema;
311 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
312 + g_settings_schema_source_get_default(),
313 + TRUE, NULL);
314 + schema = g_settings_schema_source_lookup(schema_source,
315 + GNOME_PROXY_SETTINGS_SCHEMA,
316 + FALSE);
317 + settings = g_settings_new_full(schema, NULL, NULL);
318 + g_settings_schema_source_unref(schema_source);
319 + g_settings_schema_unref(schema);
321 g_settings_set_enum (settings, GNOME_PROXY_MODE_KEY, G_DESKTOP_PROXY_MODE_MANUAL);
322 g_settings_set (settings, GNOME_PROXY_IGNORE_HOSTS_KEY,
323 "@as", g_variant_new_strv (ignore_hosts, n_ignore_hosts));
325 - http = g_settings_get_child (settings, GNOME_PROXY_HTTP_CHILD_SCHEMA);
327 + GSettingsSchemaSource *schema_source;
328 + GSettingsSchema *schema;
329 + schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
330 + g_settings_schema_source_get_default(),
331 + TRUE, NULL);
332 + schema = g_settings_schema_source_lookup(schema_source,
333 + GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA,
334 + FALSE);
335 + http = g_settings_new_full(schema, NULL, NULL);
336 + g_settings_schema_source_unref(schema_source);
337 + g_settings_schema_unref(schema);
339 g_settings_set_string (http, GNOME_PROXY_HTTP_HOST_KEY, "localhost");
340 g_settings_set_int (http, GNOME_PROXY_HTTP_PORT_KEY, 8080);