Merge lp:~online-accounts/libaccounts-glib/packaging into lp:libaccounts-glib

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
Reviewer Review Type Date Requested Status
Online Accounts Pending
Review via email: mp+306991@code.launchpad.net

Description of the change

New upstream release

Add a couple of methods related to .application files:
ag_manager_list_services_by_application() and
ag_application_supports_service().

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
=== modified file 'NEWS'
--- NEWS 2016-05-20 08:30:26 +0000
+++ NEWS 2016-09-28 08:05:28 +0000
@@ -1,5 +1,12 @@
1libaccounts-glib NEWS1libaccounts-glib NEWS
22
3Version 1.23
4------------
5
6* Add a couple of methods related to .application files:
7 ag_manager_list_services_by_application() and
8 ag_application_supports_service().
9
3Version 1.2210Version 1.22
4------------11------------
512
613
=== modified file 'configure.ac'
--- configure.ac 2016-05-20 08:30:26 +0000
+++ configure.ac 2016-09-28 08:05:28 +0000
@@ -1,7 +1,7 @@
1dnl Process this file with autoconf to produce a configure script.1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ([2.64])2AC_PREREQ([2.64])
3AC_INIT([libaccounts-glib],3AC_INIT([libaccounts-glib],
4 [1.22],4 [1.23],
5 [https://gitlab.com/accounts-sso/libaccounts-glib/issues],5 [https://gitlab.com/accounts-sso/libaccounts-glib/issues],
6 [libaccounts-glib],6 [libaccounts-glib],
7 [https://gitlab.com/accounts-sso/libaccounts-glib])7 [https://gitlab.com/accounts-sso/libaccounts-glib])
88
=== modified file 'debian/changelog'
--- debian/changelog 2016-05-20 13:28:05 +0000
+++ debian/changelog 2016-09-28 08:05:28 +0000
@@ -1,3 +1,12 @@
1libaccounts-glib (1.23-0ubuntu1) UNRELEASED; urgency=medium
2
3 * New upstream release
4 - Add a couple of methods related to .application files:
5 ag_manager_list_services_by_application() and
6 ag_application_supports_service().
7
8 -- Alberto Mardegan <alberto.mardegan@canonical.com> Wed, 28 Sep 2016 10:55:30 +0300
9
1libaccounts-glib (1.22+16.10.20160520.2-0ubuntu1) yakkety; urgency=medium10libaccounts-glib (1.22+16.10.20160520.2-0ubuntu1) yakkety; urgency=medium
211
3 [ Alberto Mardegan ]12 [ Alberto Mardegan ]
413
=== modified file 'debian/libaccounts-glib0.symbols'
--- debian/libaccounts-glib0.symbols 2013-10-15 14:14:06 +0000
+++ debian/libaccounts-glib0.symbols 2016-09-28 08:05:28 +0000
@@ -55,6 +55,7 @@
55 ag_application_get_service_usage@Base 1.055 ag_application_get_service_usage@Base 1.0
56 ag_application_get_type@Base 1.056 ag_application_get_type@Base 1.0
57 ag_application_ref@Base 1.057 ag_application_ref@Base 1.0
58 ag_application_supports_service@Base 1.23
58 ag_application_unref@Base 1.059 ag_application_unref@Base 1.0
59 ag_auth_data_get_credentials_id@Base 1.060 ag_auth_data_get_credentials_id@Base 1.0
60 ag_auth_data_get_login_parameters@Base 1.461 ag_auth_data_get_login_parameters@Base 1.4
@@ -86,6 +87,7 @@
86 ag_manager_list_providers@Base 1.087 ag_manager_list_providers@Base 1.0
87 ag_manager_list_service_types@Base 1.088 ag_manager_list_service_types@Base 1.0
88 ag_manager_list_services@Base 1.089 ag_manager_list_services@Base 1.0
90 ag_manager_list_services_by_application@Base 1.23
89 ag_manager_list_services_by_type@Base 1.091 ag_manager_list_services_by_type@Base 1.0
90 ag_manager_load_account@Base 1.092 ag_manager_load_account@Base 1.0
91 ag_manager_load_service_type@Base 1.093 ag_manager_load_service_type@Base 1.0
9294
=== modified file 'libaccounts-glib/Makefile.am'
--- libaccounts-glib/Makefile.am 2015-12-01 10:34:17 +0000
+++ libaccounts-glib/Makefile.am 2016-09-28 08:05:28 +0000
@@ -14,7 +14,7 @@
14 $(LIBACCOUNTS_LIBS)14 $(LIBACCOUNTS_LIBS)
15libaccounts_glib_la_LDFLAGS = \15libaccounts_glib_la_LDFLAGS = \
16 $(COVERAGE_LDFLAGS) \16 $(COVERAGE_LDFLAGS) \
17 -version-info 1:3:1 \17 -version-info 2:0:2 \
18 --no-allow-shlib-undefined \18 --no-allow-shlib-undefined \
19 -export-symbols-regex '^ag_'19 -export-symbols-regex '^ag_'
2020
2121
=== modified file 'libaccounts-glib/accounts-glib.h'
--- libaccounts-glib/accounts-glib.h 2013-01-03 09:13:14 +0000
+++ libaccounts-glib/accounts-glib.h 2016-09-28 08:05:28 +0000
@@ -3,7 +3,7 @@
3/*3/*
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2011 Canonical Ltd.6 * Copyright (C) 2011-2016 Canonical Ltd.
7 *7 *
8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9 *9 *
1010
=== modified file 'libaccounts-glib/ag-account-service.c'
--- libaccounts-glib/ag-account-service.c 2012-10-24 12:58:32 +0000
+++ libaccounts-glib/ag-account-service.c 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2011 Nokia Corporation.6 * Copyright (C) 2011 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 *8 *
9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
10 *10 *
1111
=== modified file 'libaccounts-glib/ag-account-service.h'
--- libaccounts-glib/ag-account-service.h 2012-10-17 14:02:06 +0000
+++ libaccounts-glib/ag-account-service.h 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2011 Nokia Corporation.6 * Copyright (C) 2009-2011 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 *8 *
9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
10 *10 *
1111
=== modified file 'libaccounts-glib/ag-account.h'
--- libaccounts-glib/ag-account.h 2012-10-22 13:03:16 +0000
+++ libaccounts-glib/ag-account.h 2016-09-28 08:05:28 +0000
@@ -4,6 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012-2016 Canonical Ltd.
7 *8 *
8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9 *10 *
1011
=== modified file 'libaccounts-glib/ag-application.c'
--- libaccounts-glib/ag-application.c 2013-06-14 08:26:06 +0000
+++ libaccounts-glib/ag-application.c 2016-09-28 08:05:28 +0000
@@ -3,7 +3,7 @@
3/*3/*
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2012 Canonical Ltd.6 * Copyright (C) 2012-2016 Canonical Ltd.
7 *7 *
8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9 *9 *
@@ -158,6 +158,8 @@
158 item = g_slice_new0 (AgApplicationItem);158 item = g_slice_new0 (AgApplicationItem);
159 g_hash_table_insert (hash_table, item_id, item);159 g_hash_table_insert (hash_table, item_id, item);
160160
161 if (xmlTextReaderIsEmptyElement (reader)) return TRUE;
162
161 ret = xmlTextReaderRead (reader);163 ret = xmlTextReaderRead (reader);
162 while (ret == 1)164 while (ret == 1)
163 {165 {
@@ -365,6 +367,13 @@
365 return ret;367 return ret;
366}368}
367369
370static gint compare_service_name (gconstpointer a, gconstpointer b)
371{
372 AgService *service = (AgService *)a;
373 const gchar *name = b;
374 return g_strcmp0 (ag_service_get_name (service), name);
375}
376
368AgApplication *377AgApplication *
369_ag_application_new_from_file (const gchar *application_name)378_ag_application_new_from_file (const gchar *application_name)
370{379{
@@ -383,10 +392,42 @@
383 return application;392 return application;
384}393}
385394
386gboolean395GList *
387_ag_application_supports_service (AgApplication *self, AgService *service)396_ag_application_list_supported_services (AgApplication *self, AgManager *manager)
388{397{
389 return _ag_application_get_service_item (self, service) != NULL;398 GHashTableIter iter;
399 GList *ret = NULL;
400 gchar *key;
401 AgService *service;
402
403 g_return_val_if_fail (self != NULL, NULL);
404
405 if (self->service_types)
406 {
407 g_hash_table_iter_init (&iter, self->service_types);
408 while (g_hash_table_iter_next (&iter, (gpointer)&key, NULL))
409 {
410 GList *services = ag_manager_list_services_by_type (manager, key);
411 ret = g_list_concat (ret, services);
412 }
413 }
414
415 if (self->services)
416 {
417 g_hash_table_iter_init (&iter, self->services);
418 while (g_hash_table_iter_next (&iter, (gpointer)&key, NULL))
419 {
420 if (g_list_find_custom (ret, key, compare_service_name)) continue;
421
422 service = ag_manager_get_service (manager, key);
423 if (service)
424 {
425 ret = g_list_prepend (ret, service);
426 }
427 }
428 }
429
430 return ret;
390}431}
391432
392/**433/**
@@ -463,6 +504,28 @@
463}504}
464505
465/**506/**
507 * ag_application_supports_service:
508 * @self: the #AgApplication.
509 * @service: an #AgService.
510 *
511 * Check whether the application supports the given service.
512 *
513 * Returns: %TRUE if @service is supported, %FALSE otherwise.
514 */
515gboolean
516ag_application_supports_service (AgApplication *self, AgService *service)
517{
518 AgApplicationItem *item;
519
520 g_return_val_if_fail (self != NULL, FALSE);
521 g_return_val_if_fail (service != NULL, FALSE);
522
523 item = _ag_application_get_service_item (self, service);
524
525 return item != NULL;
526}
527
528/**
466 * ag_application_get_service_usage:529 * ag_application_get_service_usage:
467 * @self: the #AgApplication.530 * @self: the #AgApplication.
468 * @service: an #AgService.531 * @service: an #AgService.
469532
=== modified file 'libaccounts-glib/ag-application.h'
--- libaccounts-glib/ag-application.h 2012-07-06 13:09:23 +0000
+++ libaccounts-glib/ag-application.h 2016-09-28 08:05:28 +0000
@@ -3,7 +3,7 @@
3/*3/*
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2012 Canonical Ltd.6 * Copyright (C) 2012-2016 Canonical Ltd.
7 *7 *
8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9 *9 *
@@ -39,6 +39,8 @@
3939
40GDesktopAppInfo *ag_application_get_desktop_app_info (AgApplication *self);40GDesktopAppInfo *ag_application_get_desktop_app_info (AgApplication *self);
4141
42gboolean ag_application_supports_service (AgApplication *self,
43 AgService *service);
42const gchar *ag_application_get_service_usage(AgApplication *self,44const gchar *ag_application_get_service_usage(AgApplication *self,
43 AgService *service);45 AgService *service);
4446
4547
=== modified file 'libaccounts-glib/ag-auth-data.c'
--- libaccounts-glib/ag-auth-data.c 2014-11-04 08:18:31 +0000
+++ libaccounts-glib/ag-auth-data.c 2016-09-28 08:05:28 +0000
@@ -3,7 +3,7 @@
3/*3/*
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2012 Canonical Ltd.6 * Copyright (C) 2012-2016 Canonical Ltd.
7 *7 *
8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9 *9 *
1010
=== modified file 'libaccounts-glib/ag-auth-data.h'
--- libaccounts-glib/ag-auth-data.h 2012-10-16 07:40:27 +0000
+++ libaccounts-glib/ag-auth-data.h 2016-09-28 08:05:28 +0000
@@ -3,7 +3,7 @@
3/*3/*
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2012 Canonical Ltd.6 * Copyright (C) 2012-2016 Canonical Ltd.
7 *7 *
8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9 *9 *
1010
=== modified file 'libaccounts-glib/ag-debug.c'
--- libaccounts-glib/ag-debug.c 2012-07-13 06:21:13 +0000
+++ libaccounts-glib/ag-debug.c 2016-09-28 08:05:28 +0000
@@ -4,6 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2010 Nokia Corporation.6 * Copyright (C) 2010 Nokia Corporation.
7 * Copyright (C) 2012-2016 Canonical Ltd.
7 *8 *
8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9 *10 *
1011
=== modified file 'libaccounts-glib/ag-debug.h'
--- libaccounts-glib/ag-debug.h 2012-07-13 06:21:13 +0000
+++ libaccounts-glib/ag-debug.h 2016-09-28 08:05:28 +0000
@@ -4,6 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012-2016 Canonical Ltd.
7 *8 *
8 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9 *10 *
1011
=== modified file 'libaccounts-glib/ag-errors.h'
--- libaccounts-glib/ag-errors.h 2013-09-05 09:10:38 +0000
+++ libaccounts-glib/ag-errors.h 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012-2013 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 *8 *
9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
10 *10 *
1111
=== modified file 'libaccounts-glib/ag-internals.h'
--- libaccounts-glib/ag-internals.h 2016-05-02 14:35:01 +0000
+++ libaccounts-glib/ag-internals.h 2016-09-28 08:05:28 +0000
@@ -222,9 +222,8 @@
222G_GNUC_INTERNAL222G_GNUC_INTERNAL
223AgApplication *_ag_application_new_from_file (const gchar *application_name);223AgApplication *_ag_application_new_from_file (const gchar *application_name);
224224
225/* Application functions */
226G_GNUC_INTERNAL225G_GNUC_INTERNAL
227gboolean _ag_application_supports_service (AgApplication *self,226GList *_ag_application_list_supported_services (AgApplication *self,
228 AgService *service);227 AgManager *manager);
229228
230#endif /* _AG_INTERNALS_H_ */229#endif /* _AG_INTERNALS_H_ */
231230
=== modified file 'libaccounts-glib/ag-manager.c'
--- libaccounts-glib/ag-manager.c 2016-05-02 14:35:01 +0000
+++ libaccounts-glib/ag-manager.c 2016-09-28 08:05:28 +0000
@@ -2839,7 +2839,7 @@
2839 for (list = all_applications; list != NULL; list = list->next)2839 for (list = all_applications; list != NULL; list = list->next)
2840 {2840 {
2841 AgApplication *application = list->data;2841 AgApplication *application = list->data;
2842 if (_ag_application_supports_service (application, service))2842 if (ag_application_supports_service (application, service))
2843 {2843 {
2844 applications = g_list_prepend (applications, application);2844 applications = g_list_prepend (applications, application);
2845 }2845 }
@@ -2853,3 +2853,21 @@
2853 return applications;2853 return applications;
2854}2854}
28552855
2856/**
2857 * ag_manager_list_services_by_application:
2858 * @manager: the #AgManager.
2859 * @application: a #AgApplication.
2860 *
2861 * Get the list of services that are supported by @application.
2862 *
2863 * Returns: (transfer full) (element-type AgService): a #GList of #AgService
2864 * items representing all the services which are supported. Must be free'd with
2865 * ag_service_list_free().
2866 */
2867GList *
2868ag_manager_list_services_by_application (AgManager *manager,
2869 AgApplication *application)
2870{
2871 g_return_val_if_fail (AG_IS_MANAGER (manager), NULL);
2872 return _ag_application_list_supported_services (application, manager);
2873}
28562874
=== modified file 'libaccounts-glib/ag-manager.h'
--- libaccounts-glib/ag-manager.h 2012-10-17 14:02:06 +0000
+++ libaccounts-glib/ag-manager.h 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 * Copyright (C) 2012 Intel Corporation.8 * Copyright (C) 2012 Intel Corporation.
9 *9 *
10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
@@ -95,6 +95,8 @@
95GList *ag_manager_list_services (AgManager *manager);95GList *ag_manager_list_services (AgManager *manager);
96GList *ag_manager_list_services_by_type (AgManager *manager,96GList *ag_manager_list_services_by_type (AgManager *manager,
97 const gchar *service_type);97 const gchar *service_type);
98GList *ag_manager_list_services_by_application (AgManager *manager,
99 AgApplication *application);
98GList *ag_manager_list_enabled (AgManager *manager);100GList *ag_manager_list_enabled (AgManager *manager);
99GList *ag_manager_list_enabled_by_service_type (AgManager *manager,101GList *ag_manager_list_enabled_by_service_type (AgManager *manager,
100 const gchar *service_type);102 const gchar *service_type);
101103
=== modified file 'libaccounts-glib/ag-provider.c'
--- libaccounts-glib/ag-provider.c 2014-03-05 08:15:15 +0000
+++ libaccounts-glib/ag-provider.c 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012-2013 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 *8 *
9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
10 *10 *
1111
=== modified file 'libaccounts-glib/ag-provider.h'
--- libaccounts-glib/ag-provider.h 2013-10-10 11:28:53 +0000
+++ libaccounts-glib/ag-provider.h 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012-2013 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 *8 *
9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
10 *10 *
1111
=== modified file 'libaccounts-glib/ag-service-type.c'
--- libaccounts-glib/ag-service-type.c 2012-10-16 14:25:19 +0000
+++ libaccounts-glib/ag-service-type.c 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2010 Nokia Corporation.6 * Copyright (C) 2010 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 * Copyright (C) 2012 Intel Corporation.8 * Copyright (C) 2012 Intel Corporation.
9 *9 *
10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
1111
=== modified file 'libaccounts-glib/ag-service-type.h'
--- libaccounts-glib/ag-service-type.h 2012-07-13 06:21:13 +0000
+++ libaccounts-glib/ag-service-type.h 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2010 Nokia Corporation.6 * Copyright (C) 2010 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 * Copyright (C) 2012 Intel Corporation.8 * Copyright (C) 2012 Intel Corporation.
9 *9 *
10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
1111
=== modified file 'libaccounts-glib/ag-service.c'
--- libaccounts-glib/ag-service.c 2013-06-05 06:38:48 +0000
+++ libaccounts-glib/ag-service.c 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 * Copyright (C) 2012 Intel Corporation.8 * Copyright (C) 2012 Intel Corporation.
9 *9 *
10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
1111
=== modified file 'libaccounts-glib/ag-service.h'
--- libaccounts-glib/ag-service.h 2012-07-13 06:21:13 +0000
+++ libaccounts-glib/ag-service.h 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 * Copyright (C) 2012 Intel Corporation.8 * Copyright (C) 2012 Intel Corporation.
9 *9 *
10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
1111
=== modified file 'libaccounts-glib/ag-types.h'
--- libaccounts-glib/ag-types.h 2013-12-23 15:22:56 +0000
+++ libaccounts-glib/ag-types.h 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 *8 *
9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
10 *10 *
1111
=== modified file 'libaccounts-glib/ag-util.c'
--- libaccounts-glib/ag-util.c 2016-02-18 19:37:45 +0000
+++ libaccounts-glib/ag-util.c 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 * Copyright (C) 2012 Intel Corporation.8 * Copyright (C) 2012 Intel Corporation.
9 *9 *
10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
1111
=== modified file 'libaccounts-glib/ag-util.h'
--- libaccounts-glib/ag-util.h 2013-10-10 11:28:53 +0000
+++ libaccounts-glib/ag-util.h 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 * Copyright (C) 2012 Intel Corporation.8 * Copyright (C) 2012 Intel Corporation.
9 *9 *
10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
1111
=== modified file 'tests/check_ag.c'
--- tests/check_ag.c 2016-02-19 10:05:07 +0000
+++ tests/check_ag.c 2016-09-28 08:05:28 +0000
@@ -4,7 +4,7 @@
4 * This file is part of libaccounts-glib4 * This file is part of libaccounts-glib
5 *5 *
6 * Copyright (C) 2009-2010 Nokia Corporation.6 * Copyright (C) 2009-2010 Nokia Corporation.
7 * Copyright (C) 2012-2013 Canonical Ltd.7 * Copyright (C) 2012-2016 Canonical Ltd.
8 * Copyright (C) 2012 Intel Corporation.8 * Copyright (C) 2012 Intel Corporation.
9 *9 *
10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>10 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
@@ -1625,6 +1625,8 @@
1625 "mailer-catalog") == 0);1625 "mailer-catalog") == 0);
1626 fail_unless (g_strcmp0 (ag_application_get_description (application),1626 fail_unless (g_strcmp0 (ag_application_get_description (application),
1627 "Mailer application") == 0);1627 "Mailer application") == 0);
1628 ck_assert (ag_application_supports_service (application, email_service));
1629 ck_assert (!ag_application_supports_service (application, sharing_service));
1628 fail_unless (g_strcmp0 (ag_application_get_service_usage (application,1630 fail_unless (g_strcmp0 (ag_application_get_service_usage (application,
1629 email_service),1631 email_service),
1630 "Mailer can retrieve your e-mails") == 0);1632 "Mailer can retrieve your e-mails") == 0);
@@ -1647,6 +1649,8 @@
1647 "Gallery") == 0);1649 "Gallery") == 0);
1648 fail_unless (g_strcmp0 (ag_application_get_description (application),1650 fail_unless (g_strcmp0 (ag_application_get_description (application),
1649 "Image gallery") == 0);1651 "Image gallery") == 0);
1652 ck_assert (!ag_application_supports_service (application, email_service));
1653 ck_assert (ag_application_supports_service (application, sharing_service));
1650 fail_unless (g_strcmp0 (ag_application_get_service_usage (application,1654 fail_unless (g_strcmp0 (ag_application_get_service_usage (application,
1651 sharing_service),1655 sharing_service),
1652 "Publish images on OtherService") == 0);1656 "Publish images on OtherService") == 0);
@@ -1660,6 +1664,46 @@
1660}1664}
1661END_TEST1665END_TEST
16621666
1667START_TEST(test_application_supported_services)
1668{
1669 AgService *email_service, *sharing_service;
1670 AgApplication *application;
1671 GList *list;
1672 gint i;
1673
1674 manager = ag_manager_new ();
1675
1676 application = ag_manager_get_application (manager, "Mailer");
1677 ck_assert (application != NULL);
1678
1679 list = ag_manager_list_services_by_application (manager, application);
1680 ck_assert (list != NULL);
1681 ck_assert_int_eq (g_list_length (list), 1);
1682
1683 email_service = list->data;
1684 ck_assert (email_service != NULL);
1685 ck_assert_str_eq (ag_service_get_name (email_service), "MyService");
1686
1687 ag_application_unref (application);
1688 ag_service_list_free (list);
1689
1690 application = ag_manager_get_application (manager, "Gallery");
1691 ck_assert (application != NULL);
1692
1693 list = ag_manager_list_services_by_application (manager, application);
1694 ck_assert (list != NULL);
1695 ck_assert_int_eq (g_list_length (list), 1);
1696
1697 email_service = list->data;
1698 ck_assert_str_eq (ag_service_get_name (email_service), "OtherService");
1699
1700 ag_application_unref (application);
1701 ag_service_list_free (list);
1702
1703 end_test ();
1704}
1705END_TEST
1706
1663START_TEST(test_service)1707START_TEST(test_service)
1664{1708{
1665 GValue value = { 0 };1709 GValue value = { 0 };
@@ -4039,6 +4083,7 @@
40394083
4040 tc = tcase_create("Application");4084 tc = tcase_create("Application");
4041 tcase_add_test (tc, test_application);4085 tcase_add_test (tc, test_application);
4086 tcase_add_test (tc, test_application_supported_services);
4042 IF_TEST_CASE_ENABLED("Application")4087 IF_TEST_CASE_ENABLED("Application")
4043 suite_add_tcase (s, tc);4088 suite_add_tcase (s, tc);
40444089
40454090
=== modified file 'tests/data/accounts/applications/Mailer.application'
--- tests/data/accounts/applications/Mailer.application 2016-02-18 09:45:53 +0000
+++ tests/data/accounts/applications/Mailer.application 2016-09-28 08:05:28 +0000
@@ -3,10 +3,20 @@
3 <description>Mailer application</description>3 <description>Mailer application</description>
4 <translations>mailer-catalog</translations>4 <translations>mailer-catalog</translations>
55
6 <!-- This file refers to "missing-service" and "missing-service-type" which,
7 as their name hints, do not exist. The only valid reference contained in
8 this file is the "e-mail" service type. -->
9 <services>
10 <service id="missing-service" />
11 </services>
12
6 <service-types>13 <service-types>
7 <service-type id="e-mail">14 <service-type id="e-mail">
8 <description>Mailer can retrieve your e-mails</description>15 <description>Mailer can retrieve your e-mails</description>
9 </service-type>16 </service-type>
17 <service-type id="missing-service-type">
18 <description>I wish I could do something with it</description>
19 </service-type>
10 </service-types>20 </service-types>
1121
12</application>22</application>

Subscribers

No one subscribed via source and target branches