Merge lp:~online-accounts/libaccounts-glib/packaging into lp:libaccounts-glib
- packaging
- Merge into trunk
Proposed by
Alberto Mardegan
Status: | Merged |
---|---|
Approved by: | Alberto Mardegan |
Approved revision: | 200 |
Merged at revision: | 198 |
Proposed branch: | lp:~online-accounts/libaccounts-glib/packaging |
Merge into: | lp:libaccounts-glib |
Diff against target: |
627 lines (+188/-28) 30 files modified
NEWS (+7/-0) configure.ac (+1/-1) debian/changelog (+9/-0) debian/libaccounts-glib0.symbols (+2/-0) libaccounts-glib/Makefile.am (+1/-1) libaccounts-glib/accounts-glib.h (+1/-1) libaccounts-glib/ag-account-service.c (+1/-1) libaccounts-glib/ag-account-service.h (+1/-1) libaccounts-glib/ag-account.h (+1/-0) libaccounts-glib/ag-application.c (+67/-4) libaccounts-glib/ag-application.h (+3/-1) libaccounts-glib/ag-auth-data.c (+1/-1) libaccounts-glib/ag-auth-data.h (+1/-1) libaccounts-glib/ag-debug.c (+1/-0) libaccounts-glib/ag-debug.h (+1/-0) libaccounts-glib/ag-errors.h (+1/-1) libaccounts-glib/ag-internals.h (+2/-3) libaccounts-glib/ag-manager.c (+19/-1) libaccounts-glib/ag-manager.h (+3/-1) libaccounts-glib/ag-provider.c (+1/-1) libaccounts-glib/ag-provider.h (+1/-1) libaccounts-glib/ag-service-type.c (+1/-1) libaccounts-glib/ag-service-type.h (+1/-1) libaccounts-glib/ag-service.c (+1/-1) libaccounts-glib/ag-service.h (+1/-1) libaccounts-glib/ag-types.h (+1/-1) libaccounts-glib/ag-util.c (+1/-1) libaccounts-glib/ag-util.h (+1/-1) tests/check_ag.c (+46/-1) tests/data/accounts/applications/Mailer.application (+10/-0) |
To merge this branch: | bzr merge lp:~online-accounts/libaccounts-glib/packaging |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Online Accounts | Pending | ||
Review via email: mp+306991@code.launchpad.net |
Commit message
Description of the change
New upstream release
Add a couple of methods related to .application files:
ag_manager_
ag_application_
To post a comment you must log in.
- 200. By Alberto Mardegan
-
Update symbols file
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'NEWS' | |||
2 | --- NEWS 2016-05-20 08:30:26 +0000 | |||
3 | +++ NEWS 2016-09-28 08:05:28 +0000 | |||
4 | @@ -1,5 +1,12 @@ | |||
5 | 1 | libaccounts-glib NEWS | 1 | libaccounts-glib NEWS |
6 | 2 | 2 | ||
7 | 3 | Version 1.23 | ||
8 | 4 | ------------ | ||
9 | 5 | |||
10 | 6 | * Add a couple of methods related to .application files: | ||
11 | 7 | ag_manager_list_services_by_application() and | ||
12 | 8 | ag_application_supports_service(). | ||
13 | 9 | |||
14 | 3 | Version 1.22 | 10 | Version 1.22 |
15 | 4 | ------------ | 11 | ------------ |
16 | 5 | 12 | ||
17 | 6 | 13 | ||
18 | === modified file 'configure.ac' | |||
19 | --- configure.ac 2016-05-20 08:30:26 +0000 | |||
20 | +++ configure.ac 2016-09-28 08:05:28 +0000 | |||
21 | @@ -1,7 +1,7 @@ | |||
22 | 1 | dnl Process this file with autoconf to produce a configure script. | 1 | dnl Process this file with autoconf to produce a configure script. |
23 | 2 | AC_PREREQ([2.64]) | 2 | AC_PREREQ([2.64]) |
24 | 3 | AC_INIT([libaccounts-glib], | 3 | AC_INIT([libaccounts-glib], |
26 | 4 | [1.22], | 4 | [1.23], |
27 | 5 | [https://gitlab.com/accounts-sso/libaccounts-glib/issues], | 5 | [https://gitlab.com/accounts-sso/libaccounts-glib/issues], |
28 | 6 | [libaccounts-glib], | 6 | [libaccounts-glib], |
29 | 7 | [https://gitlab.com/accounts-sso/libaccounts-glib]) | 7 | [https://gitlab.com/accounts-sso/libaccounts-glib]) |
30 | 8 | 8 | ||
31 | === modified file 'debian/changelog' | |||
32 | --- debian/changelog 2016-05-20 13:28:05 +0000 | |||
33 | +++ debian/changelog 2016-09-28 08:05:28 +0000 | |||
34 | @@ -1,3 +1,12 @@ | |||
35 | 1 | libaccounts-glib (1.23-0ubuntu1) UNRELEASED; urgency=medium | ||
36 | 2 | |||
37 | 3 | * New upstream release | ||
38 | 4 | - Add a couple of methods related to .application files: | ||
39 | 5 | ag_manager_list_services_by_application() and | ||
40 | 6 | ag_application_supports_service(). | ||
41 | 7 | |||
42 | 8 | -- Alberto Mardegan <alberto.mardegan@canonical.com> Wed, 28 Sep 2016 10:55:30 +0300 | ||
43 | 9 | |||
44 | 1 | libaccounts-glib (1.22+16.10.20160520.2-0ubuntu1) yakkety; urgency=medium | 10 | libaccounts-glib (1.22+16.10.20160520.2-0ubuntu1) yakkety; urgency=medium |
45 | 2 | 11 | ||
46 | 3 | [ Alberto Mardegan ] | 12 | [ Alberto Mardegan ] |
47 | 4 | 13 | ||
48 | === modified file 'debian/libaccounts-glib0.symbols' | |||
49 | --- debian/libaccounts-glib0.symbols 2013-10-15 14:14:06 +0000 | |||
50 | +++ debian/libaccounts-glib0.symbols 2016-09-28 08:05:28 +0000 | |||
51 | @@ -55,6 +55,7 @@ | |||
52 | 55 | ag_application_get_service_usage@Base 1.0 | 55 | ag_application_get_service_usage@Base 1.0 |
53 | 56 | ag_application_get_type@Base 1.0 | 56 | ag_application_get_type@Base 1.0 |
54 | 57 | ag_application_ref@Base 1.0 | 57 | ag_application_ref@Base 1.0 |
55 | 58 | ag_application_supports_service@Base 1.23 | ||
56 | 58 | ag_application_unref@Base 1.0 | 59 | ag_application_unref@Base 1.0 |
57 | 59 | ag_auth_data_get_credentials_id@Base 1.0 | 60 | ag_auth_data_get_credentials_id@Base 1.0 |
58 | 60 | ag_auth_data_get_login_parameters@Base 1.4 | 61 | ag_auth_data_get_login_parameters@Base 1.4 |
59 | @@ -86,6 +87,7 @@ | |||
60 | 86 | ag_manager_list_providers@Base 1.0 | 87 | ag_manager_list_providers@Base 1.0 |
61 | 87 | ag_manager_list_service_types@Base 1.0 | 88 | ag_manager_list_service_types@Base 1.0 |
62 | 88 | ag_manager_list_services@Base 1.0 | 89 | ag_manager_list_services@Base 1.0 |
63 | 90 | ag_manager_list_services_by_application@Base 1.23 | ||
64 | 89 | ag_manager_list_services_by_type@Base 1.0 | 91 | ag_manager_list_services_by_type@Base 1.0 |
65 | 90 | ag_manager_load_account@Base 1.0 | 92 | ag_manager_load_account@Base 1.0 |
66 | 91 | ag_manager_load_service_type@Base 1.0 | 93 | ag_manager_load_service_type@Base 1.0 |
67 | 92 | 94 | ||
68 | === modified file 'libaccounts-glib/Makefile.am' | |||
69 | --- libaccounts-glib/Makefile.am 2015-12-01 10:34:17 +0000 | |||
70 | +++ libaccounts-glib/Makefile.am 2016-09-28 08:05:28 +0000 | |||
71 | @@ -14,7 +14,7 @@ | |||
72 | 14 | $(LIBACCOUNTS_LIBS) | 14 | $(LIBACCOUNTS_LIBS) |
73 | 15 | libaccounts_glib_la_LDFLAGS = \ | 15 | libaccounts_glib_la_LDFLAGS = \ |
74 | 16 | $(COVERAGE_LDFLAGS) \ | 16 | $(COVERAGE_LDFLAGS) \ |
76 | 17 | -version-info 1:3:1 \ | 17 | -version-info 2:0:2 \ |
77 | 18 | --no-allow-shlib-undefined \ | 18 | --no-allow-shlib-undefined \ |
78 | 19 | -export-symbols-regex '^ag_' | 19 | -export-symbols-regex '^ag_' |
79 | 20 | 20 | ||
80 | 21 | 21 | ||
81 | === modified file 'libaccounts-glib/accounts-glib.h' | |||
82 | --- libaccounts-glib/accounts-glib.h 2013-01-03 09:13:14 +0000 | |||
83 | +++ libaccounts-glib/accounts-glib.h 2016-09-28 08:05:28 +0000 | |||
84 | @@ -3,7 +3,7 @@ | |||
85 | 3 | /* | 3 | /* |
86 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
87 | 5 | * | 5 | * |
89 | 6 | * Copyright (C) 2011 Canonical Ltd. | 6 | * Copyright (C) 2011-2016 Canonical Ltd. |
90 | 7 | * | 7 | * |
91 | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
92 | 9 | * | 9 | * |
93 | 10 | 10 | ||
94 | === modified file 'libaccounts-glib/ag-account-service.c' | |||
95 | --- libaccounts-glib/ag-account-service.c 2012-10-24 12:58:32 +0000 | |||
96 | +++ libaccounts-glib/ag-account-service.c 2016-09-28 08:05:28 +0000 | |||
97 | @@ -4,7 +4,7 @@ | |||
98 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
99 | 5 | * | 5 | * |
100 | 6 | * Copyright (C) 2011 Nokia Corporation. | 6 | * Copyright (C) 2011 Nokia Corporation. |
102 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
103 | 8 | * | 8 | * |
104 | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
105 | 10 | * | 10 | * |
106 | 11 | 11 | ||
107 | === modified file 'libaccounts-glib/ag-account-service.h' | |||
108 | --- libaccounts-glib/ag-account-service.h 2012-10-17 14:02:06 +0000 | |||
109 | +++ libaccounts-glib/ag-account-service.h 2016-09-28 08:05:28 +0000 | |||
110 | @@ -4,7 +4,7 @@ | |||
111 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
112 | 5 | * | 5 | * |
113 | 6 | * Copyright (C) 2009-2011 Nokia Corporation. | 6 | * Copyright (C) 2009-2011 Nokia Corporation. |
115 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
116 | 8 | * | 8 | * |
117 | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
118 | 10 | * | 10 | * |
119 | 11 | 11 | ||
120 | === modified file 'libaccounts-glib/ag-account.h' | |||
121 | --- libaccounts-glib/ag-account.h 2012-10-22 13:03:16 +0000 | |||
122 | +++ libaccounts-glib/ag-account.h 2016-09-28 08:05:28 +0000 | |||
123 | @@ -4,6 +4,7 @@ | |||
124 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
125 | 5 | * | 5 | * |
126 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
127 | 7 | * Copyright (C) 2012-2016 Canonical Ltd. | ||
128 | 7 | * | 8 | * |
129 | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
130 | 9 | * | 10 | * |
131 | 10 | 11 | ||
132 | === modified file 'libaccounts-glib/ag-application.c' | |||
133 | --- libaccounts-glib/ag-application.c 2013-06-14 08:26:06 +0000 | |||
134 | +++ libaccounts-glib/ag-application.c 2016-09-28 08:05:28 +0000 | |||
135 | @@ -3,7 +3,7 @@ | |||
136 | 3 | /* | 3 | /* |
137 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
138 | 5 | * | 5 | * |
140 | 6 | * Copyright (C) 2012 Canonical Ltd. | 6 | * Copyright (C) 2012-2016 Canonical Ltd. |
141 | 7 | * | 7 | * |
142 | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
143 | 9 | * | 9 | * |
144 | @@ -158,6 +158,8 @@ | |||
145 | 158 | item = g_slice_new0 (AgApplicationItem); | 158 | item = g_slice_new0 (AgApplicationItem); |
146 | 159 | g_hash_table_insert (hash_table, item_id, item); | 159 | g_hash_table_insert (hash_table, item_id, item); |
147 | 160 | 160 | ||
148 | 161 | if (xmlTextReaderIsEmptyElement (reader)) return TRUE; | ||
149 | 162 | |||
150 | 161 | ret = xmlTextReaderRead (reader); | 163 | ret = xmlTextReaderRead (reader); |
151 | 162 | while (ret == 1) | 164 | while (ret == 1) |
152 | 163 | { | 165 | { |
153 | @@ -365,6 +367,13 @@ | |||
154 | 365 | return ret; | 367 | return ret; |
155 | 366 | } | 368 | } |
156 | 367 | 369 | ||
157 | 370 | static gint compare_service_name (gconstpointer a, gconstpointer b) | ||
158 | 371 | { | ||
159 | 372 | AgService *service = (AgService *)a; | ||
160 | 373 | const gchar *name = b; | ||
161 | 374 | return g_strcmp0 (ag_service_get_name (service), name); | ||
162 | 375 | } | ||
163 | 376 | |||
164 | 368 | AgApplication * | 377 | AgApplication * |
165 | 369 | _ag_application_new_from_file (const gchar *application_name) | 378 | _ag_application_new_from_file (const gchar *application_name) |
166 | 370 | { | 379 | { |
167 | @@ -383,10 +392,42 @@ | |||
168 | 383 | return application; | 392 | return application; |
169 | 384 | } | 393 | } |
170 | 385 | 394 | ||
173 | 386 | gboolean | 395 | GList * |
174 | 387 | _ag_application_supports_service (AgApplication *self, AgService *service) | 396 | _ag_application_list_supported_services (AgApplication *self, AgManager *manager) |
175 | 388 | { | 397 | { |
177 | 389 | return _ag_application_get_service_item (self, service) != NULL; | 398 | GHashTableIter iter; |
178 | 399 | GList *ret = NULL; | ||
179 | 400 | gchar *key; | ||
180 | 401 | AgService *service; | ||
181 | 402 | |||
182 | 403 | g_return_val_if_fail (self != NULL, NULL); | ||
183 | 404 | |||
184 | 405 | if (self->service_types) | ||
185 | 406 | { | ||
186 | 407 | g_hash_table_iter_init (&iter, self->service_types); | ||
187 | 408 | while (g_hash_table_iter_next (&iter, (gpointer)&key, NULL)) | ||
188 | 409 | { | ||
189 | 410 | GList *services = ag_manager_list_services_by_type (manager, key); | ||
190 | 411 | ret = g_list_concat (ret, services); | ||
191 | 412 | } | ||
192 | 413 | } | ||
193 | 414 | |||
194 | 415 | if (self->services) | ||
195 | 416 | { | ||
196 | 417 | g_hash_table_iter_init (&iter, self->services); | ||
197 | 418 | while (g_hash_table_iter_next (&iter, (gpointer)&key, NULL)) | ||
198 | 419 | { | ||
199 | 420 | if (g_list_find_custom (ret, key, compare_service_name)) continue; | ||
200 | 421 | |||
201 | 422 | service = ag_manager_get_service (manager, key); | ||
202 | 423 | if (service) | ||
203 | 424 | { | ||
204 | 425 | ret = g_list_prepend (ret, service); | ||
205 | 426 | } | ||
206 | 427 | } | ||
207 | 428 | } | ||
208 | 429 | |||
209 | 430 | return ret; | ||
210 | 390 | } | 431 | } |
211 | 391 | 432 | ||
212 | 392 | /** | 433 | /** |
213 | @@ -463,6 +504,28 @@ | |||
214 | 463 | } | 504 | } |
215 | 464 | 505 | ||
216 | 465 | /** | 506 | /** |
217 | 507 | * ag_application_supports_service: | ||
218 | 508 | * @self: the #AgApplication. | ||
219 | 509 | * @service: an #AgService. | ||
220 | 510 | * | ||
221 | 511 | * Check whether the application supports the given service. | ||
222 | 512 | * | ||
223 | 513 | * Returns: %TRUE if @service is supported, %FALSE otherwise. | ||
224 | 514 | */ | ||
225 | 515 | gboolean | ||
226 | 516 | ag_application_supports_service (AgApplication *self, AgService *service) | ||
227 | 517 | { | ||
228 | 518 | AgApplicationItem *item; | ||
229 | 519 | |||
230 | 520 | g_return_val_if_fail (self != NULL, FALSE); | ||
231 | 521 | g_return_val_if_fail (service != NULL, FALSE); | ||
232 | 522 | |||
233 | 523 | item = _ag_application_get_service_item (self, service); | ||
234 | 524 | |||
235 | 525 | return item != NULL; | ||
236 | 526 | } | ||
237 | 527 | |||
238 | 528 | /** | ||
239 | 466 | * ag_application_get_service_usage: | 529 | * ag_application_get_service_usage: |
240 | 467 | * @self: the #AgApplication. | 530 | * @self: the #AgApplication. |
241 | 468 | * @service: an #AgService. | 531 | * @service: an #AgService. |
242 | 469 | 532 | ||
243 | === modified file 'libaccounts-glib/ag-application.h' | |||
244 | --- libaccounts-glib/ag-application.h 2012-07-06 13:09:23 +0000 | |||
245 | +++ libaccounts-glib/ag-application.h 2016-09-28 08:05:28 +0000 | |||
246 | @@ -3,7 +3,7 @@ | |||
247 | 3 | /* | 3 | /* |
248 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
249 | 5 | * | 5 | * |
251 | 6 | * Copyright (C) 2012 Canonical Ltd. | 6 | * Copyright (C) 2012-2016 Canonical Ltd. |
252 | 7 | * | 7 | * |
253 | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
254 | 9 | * | 9 | * |
255 | @@ -39,6 +39,8 @@ | |||
256 | 39 | 39 | ||
257 | 40 | GDesktopAppInfo *ag_application_get_desktop_app_info (AgApplication *self); | 40 | GDesktopAppInfo *ag_application_get_desktop_app_info (AgApplication *self); |
258 | 41 | 41 | ||
259 | 42 | gboolean ag_application_supports_service (AgApplication *self, | ||
260 | 43 | AgService *service); | ||
261 | 42 | const gchar *ag_application_get_service_usage(AgApplication *self, | 44 | const gchar *ag_application_get_service_usage(AgApplication *self, |
262 | 43 | AgService *service); | 45 | AgService *service); |
263 | 44 | 46 | ||
264 | 45 | 47 | ||
265 | === modified file 'libaccounts-glib/ag-auth-data.c' | |||
266 | --- libaccounts-glib/ag-auth-data.c 2014-11-04 08:18:31 +0000 | |||
267 | +++ libaccounts-glib/ag-auth-data.c 2016-09-28 08:05:28 +0000 | |||
268 | @@ -3,7 +3,7 @@ | |||
269 | 3 | /* | 3 | /* |
270 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
271 | 5 | * | 5 | * |
273 | 6 | * Copyright (C) 2012 Canonical Ltd. | 6 | * Copyright (C) 2012-2016 Canonical Ltd. |
274 | 7 | * | 7 | * |
275 | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
276 | 9 | * | 9 | * |
277 | 10 | 10 | ||
278 | === modified file 'libaccounts-glib/ag-auth-data.h' | |||
279 | --- libaccounts-glib/ag-auth-data.h 2012-10-16 07:40:27 +0000 | |||
280 | +++ libaccounts-glib/ag-auth-data.h 2016-09-28 08:05:28 +0000 | |||
281 | @@ -3,7 +3,7 @@ | |||
282 | 3 | /* | 3 | /* |
283 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
284 | 5 | * | 5 | * |
286 | 6 | * Copyright (C) 2012 Canonical Ltd. | 6 | * Copyright (C) 2012-2016 Canonical Ltd. |
287 | 7 | * | 7 | * |
288 | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
289 | 9 | * | 9 | * |
290 | 10 | 10 | ||
291 | === modified file 'libaccounts-glib/ag-debug.c' | |||
292 | --- libaccounts-glib/ag-debug.c 2012-07-13 06:21:13 +0000 | |||
293 | +++ libaccounts-glib/ag-debug.c 2016-09-28 08:05:28 +0000 | |||
294 | @@ -4,6 +4,7 @@ | |||
295 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
296 | 5 | * | 5 | * |
297 | 6 | * Copyright (C) 2010 Nokia Corporation. | 6 | * Copyright (C) 2010 Nokia Corporation. |
298 | 7 | * Copyright (C) 2012-2016 Canonical Ltd. | ||
299 | 7 | * | 8 | * |
300 | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
301 | 9 | * | 10 | * |
302 | 10 | 11 | ||
303 | === modified file 'libaccounts-glib/ag-debug.h' | |||
304 | --- libaccounts-glib/ag-debug.h 2012-07-13 06:21:13 +0000 | |||
305 | +++ libaccounts-glib/ag-debug.h 2016-09-28 08:05:28 +0000 | |||
306 | @@ -4,6 +4,7 @@ | |||
307 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
308 | 5 | * | 5 | * |
309 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
310 | 7 | * Copyright (C) 2012-2016 Canonical Ltd. | ||
311 | 7 | * | 8 | * |
312 | 8 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
313 | 9 | * | 10 | * |
314 | 10 | 11 | ||
315 | === modified file 'libaccounts-glib/ag-errors.h' | |||
316 | --- libaccounts-glib/ag-errors.h 2013-09-05 09:10:38 +0000 | |||
317 | +++ libaccounts-glib/ag-errors.h 2016-09-28 08:05:28 +0000 | |||
318 | @@ -4,7 +4,7 @@ | |||
319 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
320 | 5 | * | 5 | * |
321 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
323 | 7 | * Copyright (C) 2012-2013 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
324 | 8 | * | 8 | * |
325 | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
326 | 10 | * | 10 | * |
327 | 11 | 11 | ||
328 | === modified file 'libaccounts-glib/ag-internals.h' | |||
329 | --- libaccounts-glib/ag-internals.h 2016-05-02 14:35:01 +0000 | |||
330 | +++ libaccounts-glib/ag-internals.h 2016-09-28 08:05:28 +0000 | |||
331 | @@ -222,9 +222,8 @@ | |||
332 | 222 | G_GNUC_INTERNAL | 222 | G_GNUC_INTERNAL |
333 | 223 | AgApplication *_ag_application_new_from_file (const gchar *application_name); | 223 | AgApplication *_ag_application_new_from_file (const gchar *application_name); |
334 | 224 | 224 | ||
335 | 225 | /* Application functions */ | ||
336 | 226 | G_GNUC_INTERNAL | 225 | G_GNUC_INTERNAL |
339 | 227 | gboolean _ag_application_supports_service (AgApplication *self, | 226 | GList *_ag_application_list_supported_services (AgApplication *self, |
340 | 228 | AgService *service); | 227 | AgManager *manager); |
341 | 229 | 228 | ||
342 | 230 | #endif /* _AG_INTERNALS_H_ */ | 229 | #endif /* _AG_INTERNALS_H_ */ |
343 | 231 | 230 | ||
344 | === modified file 'libaccounts-glib/ag-manager.c' | |||
345 | --- libaccounts-glib/ag-manager.c 2016-05-02 14:35:01 +0000 | |||
346 | +++ libaccounts-glib/ag-manager.c 2016-09-28 08:05:28 +0000 | |||
347 | @@ -2839,7 +2839,7 @@ | |||
348 | 2839 | for (list = all_applications; list != NULL; list = list->next) | 2839 | for (list = all_applications; list != NULL; list = list->next) |
349 | 2840 | { | 2840 | { |
350 | 2841 | AgApplication *application = list->data; | 2841 | AgApplication *application = list->data; |
352 | 2842 | if (_ag_application_supports_service (application, service)) | 2842 | if (ag_application_supports_service (application, service)) |
353 | 2843 | { | 2843 | { |
354 | 2844 | applications = g_list_prepend (applications, application); | 2844 | applications = g_list_prepend (applications, application); |
355 | 2845 | } | 2845 | } |
356 | @@ -2853,3 +2853,21 @@ | |||
357 | 2853 | return applications; | 2853 | return applications; |
358 | 2854 | } | 2854 | } |
359 | 2855 | 2855 | ||
360 | 2856 | /** | ||
361 | 2857 | * ag_manager_list_services_by_application: | ||
362 | 2858 | * @manager: the #AgManager. | ||
363 | 2859 | * @application: a #AgApplication. | ||
364 | 2860 | * | ||
365 | 2861 | * Get the list of services that are supported by @application. | ||
366 | 2862 | * | ||
367 | 2863 | * Returns: (transfer full) (element-type AgService): a #GList of #AgService | ||
368 | 2864 | * items representing all the services which are supported. Must be free'd with | ||
369 | 2865 | * ag_service_list_free(). | ||
370 | 2866 | */ | ||
371 | 2867 | GList * | ||
372 | 2868 | ag_manager_list_services_by_application (AgManager *manager, | ||
373 | 2869 | AgApplication *application) | ||
374 | 2870 | { | ||
375 | 2871 | g_return_val_if_fail (AG_IS_MANAGER (manager), NULL); | ||
376 | 2872 | return _ag_application_list_supported_services (application, manager); | ||
377 | 2873 | } | ||
378 | 2856 | 2874 | ||
379 | === modified file 'libaccounts-glib/ag-manager.h' | |||
380 | --- libaccounts-glib/ag-manager.h 2012-10-17 14:02:06 +0000 | |||
381 | +++ libaccounts-glib/ag-manager.h 2016-09-28 08:05:28 +0000 | |||
382 | @@ -4,7 +4,7 @@ | |||
383 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
384 | 5 | * | 5 | * |
385 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
387 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
388 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
389 | 9 | * | 9 | * |
390 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
391 | @@ -95,6 +95,8 @@ | |||
392 | 95 | GList *ag_manager_list_services (AgManager *manager); | 95 | GList *ag_manager_list_services (AgManager *manager); |
393 | 96 | GList *ag_manager_list_services_by_type (AgManager *manager, | 96 | GList *ag_manager_list_services_by_type (AgManager *manager, |
394 | 97 | const gchar *service_type); | 97 | const gchar *service_type); |
395 | 98 | GList *ag_manager_list_services_by_application (AgManager *manager, | ||
396 | 99 | AgApplication *application); | ||
397 | 98 | GList *ag_manager_list_enabled (AgManager *manager); | 100 | GList *ag_manager_list_enabled (AgManager *manager); |
398 | 99 | GList *ag_manager_list_enabled_by_service_type (AgManager *manager, | 101 | GList *ag_manager_list_enabled_by_service_type (AgManager *manager, |
399 | 100 | const gchar *service_type); | 102 | const gchar *service_type); |
400 | 101 | 103 | ||
401 | === modified file 'libaccounts-glib/ag-provider.c' | |||
402 | --- libaccounts-glib/ag-provider.c 2014-03-05 08:15:15 +0000 | |||
403 | +++ libaccounts-glib/ag-provider.c 2016-09-28 08:05:28 +0000 | |||
404 | @@ -4,7 +4,7 @@ | |||
405 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
406 | 5 | * | 5 | * |
407 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
409 | 7 | * Copyright (C) 2012-2013 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
410 | 8 | * | 8 | * |
411 | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
412 | 10 | * | 10 | * |
413 | 11 | 11 | ||
414 | === modified file 'libaccounts-glib/ag-provider.h' | |||
415 | --- libaccounts-glib/ag-provider.h 2013-10-10 11:28:53 +0000 | |||
416 | +++ libaccounts-glib/ag-provider.h 2016-09-28 08:05:28 +0000 | |||
417 | @@ -4,7 +4,7 @@ | |||
418 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
419 | 5 | * | 5 | * |
420 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
422 | 7 | * Copyright (C) 2012-2013 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
423 | 8 | * | 8 | * |
424 | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
425 | 10 | * | 10 | * |
426 | 11 | 11 | ||
427 | === modified file 'libaccounts-glib/ag-service-type.c' | |||
428 | --- libaccounts-glib/ag-service-type.c 2012-10-16 14:25:19 +0000 | |||
429 | +++ libaccounts-glib/ag-service-type.c 2016-09-28 08:05:28 +0000 | |||
430 | @@ -4,7 +4,7 @@ | |||
431 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
432 | 5 | * | 5 | * |
433 | 6 | * Copyright (C) 2010 Nokia Corporation. | 6 | * Copyright (C) 2010 Nokia Corporation. |
435 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
436 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
437 | 9 | * | 9 | * |
438 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
439 | 11 | 11 | ||
440 | === modified file 'libaccounts-glib/ag-service-type.h' | |||
441 | --- libaccounts-glib/ag-service-type.h 2012-07-13 06:21:13 +0000 | |||
442 | +++ libaccounts-glib/ag-service-type.h 2016-09-28 08:05:28 +0000 | |||
443 | @@ -4,7 +4,7 @@ | |||
444 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
445 | 5 | * | 5 | * |
446 | 6 | * Copyright (C) 2010 Nokia Corporation. | 6 | * Copyright (C) 2010 Nokia Corporation. |
448 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
449 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
450 | 9 | * | 9 | * |
451 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
452 | 11 | 11 | ||
453 | === modified file 'libaccounts-glib/ag-service.c' | |||
454 | --- libaccounts-glib/ag-service.c 2013-06-05 06:38:48 +0000 | |||
455 | +++ libaccounts-glib/ag-service.c 2016-09-28 08:05:28 +0000 | |||
456 | @@ -4,7 +4,7 @@ | |||
457 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
458 | 5 | * | 5 | * |
459 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
461 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
462 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
463 | 9 | * | 9 | * |
464 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
465 | 11 | 11 | ||
466 | === modified file 'libaccounts-glib/ag-service.h' | |||
467 | --- libaccounts-glib/ag-service.h 2012-07-13 06:21:13 +0000 | |||
468 | +++ libaccounts-glib/ag-service.h 2016-09-28 08:05:28 +0000 | |||
469 | @@ -4,7 +4,7 @@ | |||
470 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
471 | 5 | * | 5 | * |
472 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
474 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
475 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
476 | 9 | * | 9 | * |
477 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
478 | 11 | 11 | ||
479 | === modified file 'libaccounts-glib/ag-types.h' | |||
480 | --- libaccounts-glib/ag-types.h 2013-12-23 15:22:56 +0000 | |||
481 | +++ libaccounts-glib/ag-types.h 2016-09-28 08:05:28 +0000 | |||
482 | @@ -4,7 +4,7 @@ | |||
483 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
484 | 5 | * | 5 | * |
485 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
487 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
488 | 8 | * | 8 | * |
489 | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
490 | 10 | * | 10 | * |
491 | 11 | 11 | ||
492 | === modified file 'libaccounts-glib/ag-util.c' | |||
493 | --- libaccounts-glib/ag-util.c 2016-02-18 19:37:45 +0000 | |||
494 | +++ libaccounts-glib/ag-util.c 2016-09-28 08:05:28 +0000 | |||
495 | @@ -4,7 +4,7 @@ | |||
496 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
497 | 5 | * | 5 | * |
498 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
500 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
501 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
502 | 9 | * | 9 | * |
503 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
504 | 11 | 11 | ||
505 | === modified file 'libaccounts-glib/ag-util.h' | |||
506 | --- libaccounts-glib/ag-util.h 2013-10-10 11:28:53 +0000 | |||
507 | +++ libaccounts-glib/ag-util.h 2016-09-28 08:05:28 +0000 | |||
508 | @@ -4,7 +4,7 @@ | |||
509 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
510 | 5 | * | 5 | * |
511 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
513 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
514 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
515 | 9 | * | 9 | * |
516 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
517 | 11 | 11 | ||
518 | === modified file 'tests/check_ag.c' | |||
519 | --- tests/check_ag.c 2016-02-19 10:05:07 +0000 | |||
520 | +++ tests/check_ag.c 2016-09-28 08:05:28 +0000 | |||
521 | @@ -4,7 +4,7 @@ | |||
522 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
523 | 5 | * | 5 | * |
524 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
526 | 7 | * Copyright (C) 2012-2013 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
527 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
528 | 9 | * | 9 | * |
529 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
530 | @@ -1625,6 +1625,8 @@ | |||
531 | 1625 | "mailer-catalog") == 0); | 1625 | "mailer-catalog") == 0); |
532 | 1626 | fail_unless (g_strcmp0 (ag_application_get_description (application), | 1626 | fail_unless (g_strcmp0 (ag_application_get_description (application), |
533 | 1627 | "Mailer application") == 0); | 1627 | "Mailer application") == 0); |
534 | 1628 | ck_assert (ag_application_supports_service (application, email_service)); | ||
535 | 1629 | ck_assert (!ag_application_supports_service (application, sharing_service)); | ||
536 | 1628 | fail_unless (g_strcmp0 (ag_application_get_service_usage (application, | 1630 | fail_unless (g_strcmp0 (ag_application_get_service_usage (application, |
537 | 1629 | email_service), | 1631 | email_service), |
538 | 1630 | "Mailer can retrieve your e-mails") == 0); | 1632 | "Mailer can retrieve your e-mails") == 0); |
539 | @@ -1647,6 +1649,8 @@ | |||
540 | 1647 | "Gallery") == 0); | 1649 | "Gallery") == 0); |
541 | 1648 | fail_unless (g_strcmp0 (ag_application_get_description (application), | 1650 | fail_unless (g_strcmp0 (ag_application_get_description (application), |
542 | 1649 | "Image gallery") == 0); | 1651 | "Image gallery") == 0); |
543 | 1652 | ck_assert (!ag_application_supports_service (application, email_service)); | ||
544 | 1653 | ck_assert (ag_application_supports_service (application, sharing_service)); | ||
545 | 1650 | fail_unless (g_strcmp0 (ag_application_get_service_usage (application, | 1654 | fail_unless (g_strcmp0 (ag_application_get_service_usage (application, |
546 | 1651 | sharing_service), | 1655 | sharing_service), |
547 | 1652 | "Publish images on OtherService") == 0); | 1656 | "Publish images on OtherService") == 0); |
548 | @@ -1660,6 +1664,46 @@ | |||
549 | 1660 | } | 1664 | } |
550 | 1661 | END_TEST | 1665 | END_TEST |
551 | 1662 | 1666 | ||
552 | 1667 | START_TEST(test_application_supported_services) | ||
553 | 1668 | { | ||
554 | 1669 | AgService *email_service, *sharing_service; | ||
555 | 1670 | AgApplication *application; | ||
556 | 1671 | GList *list; | ||
557 | 1672 | gint i; | ||
558 | 1673 | |||
559 | 1674 | manager = ag_manager_new (); | ||
560 | 1675 | |||
561 | 1676 | application = ag_manager_get_application (manager, "Mailer"); | ||
562 | 1677 | ck_assert (application != NULL); | ||
563 | 1678 | |||
564 | 1679 | list = ag_manager_list_services_by_application (manager, application); | ||
565 | 1680 | ck_assert (list != NULL); | ||
566 | 1681 | ck_assert_int_eq (g_list_length (list), 1); | ||
567 | 1682 | |||
568 | 1683 | email_service = list->data; | ||
569 | 1684 | ck_assert (email_service != NULL); | ||
570 | 1685 | ck_assert_str_eq (ag_service_get_name (email_service), "MyService"); | ||
571 | 1686 | |||
572 | 1687 | ag_application_unref (application); | ||
573 | 1688 | ag_service_list_free (list); | ||
574 | 1689 | |||
575 | 1690 | application = ag_manager_get_application (manager, "Gallery"); | ||
576 | 1691 | ck_assert (application != NULL); | ||
577 | 1692 | |||
578 | 1693 | list = ag_manager_list_services_by_application (manager, application); | ||
579 | 1694 | ck_assert (list != NULL); | ||
580 | 1695 | ck_assert_int_eq (g_list_length (list), 1); | ||
581 | 1696 | |||
582 | 1697 | email_service = list->data; | ||
583 | 1698 | ck_assert_str_eq (ag_service_get_name (email_service), "OtherService"); | ||
584 | 1699 | |||
585 | 1700 | ag_application_unref (application); | ||
586 | 1701 | ag_service_list_free (list); | ||
587 | 1702 | |||
588 | 1703 | end_test (); | ||
589 | 1704 | } | ||
590 | 1705 | END_TEST | ||
591 | 1706 | |||
592 | 1663 | START_TEST(test_service) | 1707 | START_TEST(test_service) |
593 | 1664 | { | 1708 | { |
594 | 1665 | GValue value = { 0 }; | 1709 | GValue value = { 0 }; |
595 | @@ -4039,6 +4083,7 @@ | |||
596 | 4039 | 4083 | ||
597 | 4040 | tc = tcase_create("Application"); | 4084 | tc = tcase_create("Application"); |
598 | 4041 | tcase_add_test (tc, test_application); | 4085 | tcase_add_test (tc, test_application); |
599 | 4086 | tcase_add_test (tc, test_application_supported_services); | ||
600 | 4042 | IF_TEST_CASE_ENABLED("Application") | 4087 | IF_TEST_CASE_ENABLED("Application") |
601 | 4043 | suite_add_tcase (s, tc); | 4088 | suite_add_tcase (s, tc); |
602 | 4044 | 4089 | ||
603 | 4045 | 4090 | ||
604 | === modified file 'tests/data/accounts/applications/Mailer.application' | |||
605 | --- tests/data/accounts/applications/Mailer.application 2016-02-18 09:45:53 +0000 | |||
606 | +++ tests/data/accounts/applications/Mailer.application 2016-09-28 08:05:28 +0000 | |||
607 | @@ -3,10 +3,20 @@ | |||
608 | 3 | <description>Mailer application</description> | 3 | <description>Mailer application</description> |
609 | 4 | <translations>mailer-catalog</translations> | 4 | <translations>mailer-catalog</translations> |
610 | 5 | 5 | ||
611 | 6 | <!-- This file refers to "missing-service" and "missing-service-type" which, | ||
612 | 7 | as their name hints, do not exist. The only valid reference contained in | ||
613 | 8 | this file is the "e-mail" service type. --> | ||
614 | 9 | <services> | ||
615 | 10 | <service id="missing-service" /> | ||
616 | 11 | </services> | ||
617 | 12 | |||
618 | 6 | <service-types> | 13 | <service-types> |
619 | 7 | <service-type id="e-mail"> | 14 | <service-type id="e-mail"> |
620 | 8 | <description>Mailer can retrieve your e-mails</description> | 15 | <description>Mailer can retrieve your e-mails</description> |
621 | 9 | </service-type> | 16 | </service-type> |
622 | 17 | <service-type id="missing-service-type"> | ||
623 | 18 | <description>I wish I could do something with it</description> | ||
624 | 19 | </service-type> | ||
625 | 10 | </service-types> | 20 | </service-types> |
626 | 11 | 21 | ||
627 | 12 | </application> | 22 | </application> |