Merge lp:~online-accounts/libaccounts-glib/packaging into lp:libaccounts-glib
- packaging
- Merge into trunk
Proposed by
Alberto Mardegan
Status: | Merged |
---|---|
Approved by: | David Barth |
Approved revision: | no longer in the source branch. |
Merged at revision: | 196 |
Proposed branch: | lp:~online-accounts/libaccounts-glib/packaging |
Merge into: | lp:libaccounts-glib |
Diff against target: |
543 lines (+145/-108) 9 files modified
.gitlab-ci.yml (+51/-0) NEWS (+7/-0) README.md (+12/-2) configure.ac (+2/-2) debian/changelog (+9/-0) libaccounts-glib/ag-account.c (+19/-38) libaccounts-glib/ag-internals.h (+3/-5) libaccounts-glib/ag-manager.c (+41/-60) m4/gcov.m4 (+1/-1) |
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+294013@code.launchpad.net |
Commit message
Description of the change
Migrate to GTask
To post a comment you must log in.
- 196. By Alberto Mardegan
-
Migrate to GTask Fixes: #1451728
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file '.gitlab-ci.yml' | |||
2 | --- .gitlab-ci.yml 1970-01-01 00:00:00 +0000 | |||
3 | +++ .gitlab-ci.yml 2016-05-20 08:55:52 +0000 | |||
4 | @@ -0,0 +1,51 @@ | |||
5 | 1 | image: ubuntu:xenial | ||
6 | 2 | |||
7 | 3 | cache: | ||
8 | 4 | key: apt-cache | ||
9 | 5 | paths: | ||
10 | 6 | - apt-cache/ | ||
11 | 7 | |||
12 | 8 | before_script: | ||
13 | 9 | - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR | ||
14 | 10 | - apt-get update -yq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -yq automake autotools-dev gobject-introspection gtk-doc-tools intltool libgirepository1.0-dev libglib2.0-dev libsqlite3-dev libtool libxml2-dev libxml2-utils python3 python3-gi python-gi-dev | ||
15 | 11 | - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -yq check dbus-test-runner lcov gcovr | ||
16 | 12 | - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -yq sudo | ||
17 | 13 | - useradd -m tester | ||
18 | 14 | - adduser tester sudo | ||
19 | 15 | |||
20 | 16 | build_amd64: | ||
21 | 17 | stage: build | ||
22 | 18 | script: | ||
23 | 19 | - export PYTHON=python3 | ||
24 | 20 | - mkdir build | ||
25 | 21 | - cd build | ||
26 | 22 | - ../autogen.sh --enable-gtk-doc --enable-gcov --enable-debug --enable-python --disable-wal | ||
27 | 23 | - make -j 4 | ||
28 | 24 | artifacts: | ||
29 | 25 | paths: | ||
30 | 26 | - ./ | ||
31 | 27 | |||
32 | 28 | test_amd64: | ||
33 | 29 | stage: test | ||
34 | 30 | script: | ||
35 | 31 | - cd build | ||
36 | 32 | - chmod a+rw -R . | ||
37 | 33 | - sudo -u tester make check || (cat tests/test-suite.log && /bin/false) | ||
38 | 34 | - sudo -u tester make coverage-html | ||
39 | 35 | dependencies: | ||
40 | 36 | - build_amd64 | ||
41 | 37 | artifacts: | ||
42 | 38 | paths: | ||
43 | 39 | - ./ | ||
44 | 40 | |||
45 | 41 | pages: | ||
46 | 42 | stage: deploy | ||
47 | 43 | script: | ||
48 | 44 | - mkdir public | ||
49 | 45 | - cp -a build/coveragereport public/coverage | ||
50 | 46 | - cp -a build/docs/reference/html/* public/ | ||
51 | 47 | dependencies: | ||
52 | 48 | - test_amd64 | ||
53 | 49 | artifacts: | ||
54 | 50 | paths: | ||
55 | 51 | - public | ||
56 | 0 | 52 | ||
57 | === modified file 'NEWS' | |||
58 | --- NEWS 2016-02-19 09:42:37 +0000 | |||
59 | +++ NEWS 2016-05-20 08:55:52 +0000 | |||
60 | @@ -1,5 +1,12 @@ | |||
61 | 1 | libaccounts-glib NEWS | 1 | libaccounts-glib NEWS |
62 | 2 | 2 | ||
63 | 3 | Version 1.22 | ||
64 | 4 | ------------ | ||
65 | 5 | |||
66 | 6 | * Lib: migrate to GTask | ||
67 | 7 | * Build: enable CI in gitlab | ||
68 | 8 | * Build: add support for lcov 1.12 | ||
69 | 9 | |||
70 | 3 | Version 1.21 | 10 | Version 1.21 |
71 | 4 | ------------ | 11 | ------------ |
72 | 5 | 12 | ||
73 | 6 | 13 | ||
74 | === modified file 'README.md' | |||
75 | --- README.md 2015-09-11 15:07:12 +0000 | |||
76 | +++ README.md 2016-05-20 08:55:52 +0000 | |||
77 | @@ -2,7 +2,7 @@ | |||
78 | 2 | ================================================= | 2 | ================================================= |
79 | 3 | 3 | ||
80 | 4 | This project is a library for managing accounts which can be used from GLib | 4 | This project is a library for managing accounts which can be used from GLib |
82 | 5 | applications. It is part of the @accounts-sso project. | 5 | applications. It is part of the [accounts-sso project][accounts-sso]. |
83 | 6 | 6 | ||
84 | 7 | 7 | ||
85 | 8 | License | 8 | License |
86 | @@ -15,7 +15,7 @@ | |||
87 | 15 | ------------------ | 15 | ------------------ |
88 | 16 | 16 | ||
89 | 17 | The project depends on GLib (including GIO and GObject), libxml2, sqlite3 and | 17 | The project depends on GLib (including GIO and GObject), libxml2, sqlite3 and |
91 | 18 | check. | 18 | [check][]. |
92 | 19 | To build it, run: | 19 | To build it, run: |
93 | 20 | ``` | 20 | ``` |
94 | 21 | ./autogen.sh | 21 | ./autogen.sh |
95 | @@ -23,3 +23,13 @@ | |||
96 | 23 | make | 23 | make |
97 | 24 | make install | 24 | make install |
98 | 25 | ``` | 25 | ``` |
99 | 26 | |||
100 | 27 | Resources | ||
101 | 28 | --------- | ||
102 | 29 | |||
103 | 30 | [API reference documentation](http://accounts-sso.gitlab.io/libaccounts-glib/) | ||
104 | 31 | |||
105 | 32 | [Official source code repository](https://gitlab.com/accounts-sso/libaccounts-glib) | ||
106 | 33 | |||
107 | 34 | [accounts-sso]: https://gitlab.com/groups/accounts-sso | ||
108 | 35 | [check]: https://github.com/libcheck/check | ||
109 | 26 | 36 | ||
110 | === modified file 'configure.ac' | |||
111 | --- configure.ac 2016-02-19 09:42:37 +0000 | |||
112 | +++ configure.ac 2016-05-20 08:55:52 +0000 | |||
113 | @@ -1,7 +1,7 @@ | |||
114 | 1 | dnl Process this file with autoconf to produce a configure script. | 1 | dnl Process this file with autoconf to produce a configure script. |
115 | 2 | AC_PREREQ([2.64]) | 2 | AC_PREREQ([2.64]) |
116 | 3 | AC_INIT([libaccounts-glib], | 3 | AC_INIT([libaccounts-glib], |
118 | 4 | [1.21], | 4 | [1.22], |
119 | 5 | [https://gitlab.com/accounts-sso/libaccounts-glib/issues], | 5 | [https://gitlab.com/accounts-sso/libaccounts-glib/issues], |
120 | 6 | [libaccounts-glib], | 6 | [libaccounts-glib], |
121 | 7 | [https://gitlab.com/accounts-sso/libaccounts-glib]) | 7 | [https://gitlab.com/accounts-sso/libaccounts-glib]) |
122 | @@ -25,7 +25,7 @@ | |||
123 | 25 | GOBJECT_INTROSPECTION_CHECK([1.30.0]) | 25 | GOBJECT_INTROSPECTION_CHECK([1.30.0]) |
124 | 26 | 26 | ||
125 | 27 | LIBACCOUNTS_REQUIRED="glib-2.0 >= 2.26 | 27 | LIBACCOUNTS_REQUIRED="glib-2.0 >= 2.26 |
127 | 28 | gio-2.0 >= 2.30 | 28 | gio-2.0 >= 2.36 |
128 | 29 | gio-unix-2.0 | 29 | gio-unix-2.0 |
129 | 30 | gobject-2.0 >= 2.35.1 | 30 | gobject-2.0 >= 2.35.1 |
130 | 31 | libxml-2.0 | 31 | libxml-2.0 |
131 | 32 | 32 | ||
132 | === modified file 'debian/changelog' | |||
133 | --- debian/changelog 2016-02-22 09:12:59 +0000 | |||
134 | +++ debian/changelog 2016-05-20 08:55:52 +0000 | |||
135 | @@ -1,3 +1,12 @@ | |||
136 | 1 | libaccounts-glib (1.22-0ubuntu1) UNRELEASED; urgency=medium | ||
137 | 2 | |||
138 | 3 | * New upstream release | ||
139 | 4 | - Lib: migrate to GTask (LP: #1577373) | ||
140 | 5 | - Build: enable CI in gitlab | ||
141 | 6 | - Build: add support for lcov 1.12 | ||
142 | 7 | |||
143 | 8 | -- Alberto Mardegan <alberto.mardegan@canonical.com> Fri, 20 May 2016 11:54:22 +0300 | ||
144 | 9 | |||
145 | 1 | libaccounts-glib (1.21+16.04.20160222-0ubuntu1) xenial; urgency=medium | 10 | libaccounts-glib (1.21+16.04.20160222-0ubuntu1) xenial; urgency=medium |
146 | 2 | 11 | ||
147 | 3 | [ Alberto Mardegan ] | 12 | [ Alberto Mardegan ] |
148 | 4 | 13 | ||
149 | === modified file 'libaccounts-glib/ag-account.c' | |||
150 | --- libaccounts-glib/ag-account.c 2015-12-18 15:16:14 +0000 | |||
151 | +++ libaccounts-glib/ag-account.c 2016-05-20 08:55:52 +0000 | |||
152 | @@ -4,7 +4,7 @@ | |||
153 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
154 | 5 | * | 5 | * |
155 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
157 | 7 | * Copyright (C) 2012 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
158 | 8 | * | 8 | * |
159 | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 9 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
160 | 10 | * | 10 | * |
161 | @@ -185,8 +185,8 @@ | |||
162 | 185 | */ | 185 | */ |
163 | 186 | GHashTable *changes_for_watches; | 186 | GHashTable *changes_for_watches; |
164 | 187 | 187 | ||
167 | 188 | /* GSimpleAsyncResult for the ag_account_store_async operation. */ | 188 | /* GTask for the ag_account_store_async operation. */ |
168 | 189 | GSimpleAsyncResult *store_async_result; | 189 | GTask *store_task; |
169 | 190 | 190 | ||
170 | 191 | /* The "foreign" flag means that the account has been created by another | 191 | /* The "foreign" flag means that the account has been created by another |
171 | 192 | * instance and we got informed about it from D-Bus. In this case, all the | 192 | * instance and we got informed about it from D-Bus. In this case, all the |
172 | @@ -697,10 +697,7 @@ | |||
173 | 697 | { | 697 | { |
174 | 698 | AgAccountPrivate *priv = account->priv; | 698 | AgAccountPrivate *priv = account->priv; |
175 | 699 | 699 | ||
180 | 700 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | 700 | g_clear_object (&priv->store_task); |
177 | 701 | g_simple_async_result_complete_in_idle (priv->store_async_result); | ||
178 | 702 | G_GNUC_END_IGNORE_DEPRECATIONS | ||
179 | 703 | g_clear_object (&priv->store_async_result); | ||
181 | 704 | 701 | ||
182 | 705 | _ag_account_changes_free (changes); | 702 | _ag_account_changes_free (changes); |
183 | 706 | } | 703 | } |
184 | @@ -2486,43 +2483,32 @@ | |||
185 | 2486 | g_return_if_fail (AG_IS_ACCOUNT (account)); | 2483 | g_return_if_fail (AG_IS_ACCOUNT (account)); |
186 | 2487 | priv = account->priv; | 2484 | priv = account->priv; |
187 | 2488 | 2485 | ||
189 | 2489 | if (G_UNLIKELY (priv->store_async_result != NULL)) | 2486 | if (G_UNLIKELY (priv->store_task != NULL)) |
190 | 2490 | { | 2487 | { |
191 | 2491 | g_critical ("ag_account_store_async called again before completion"); | 2488 | g_critical ("ag_account_store_async called again before completion"); |
200 | 2492 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | 2489 | g_task_report_new_error (account, |
201 | 2493 | g_simple_async_report_error_in_idle ((GObject *)account, | 2490 | callback, user_data, |
202 | 2494 | callback, user_data, | 2491 | ag_account_store_async, |
203 | 2495 | AG_ACCOUNTS_ERROR, | 2492 | AG_ACCOUNTS_ERROR, |
204 | 2496 | AG_ACCOUNTS_ERROR_STORE_IN_PROGRESS, | 2493 | AG_ACCOUNTS_ERROR_STORE_IN_PROGRESS, |
205 | 2497 | "Store operation already " | 2494 | "Store operation already in progress"); |
198 | 2498 | "in progress"); | ||
199 | 2499 | G_GNUC_END_IGNORE_DEPRECATIONS | ||
206 | 2500 | return; | 2495 | return; |
207 | 2501 | } | 2496 | } |
208 | 2502 | 2497 | ||
219 | 2503 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | 2498 | priv->store_task = |
220 | 2504 | priv->store_async_result = | 2499 | g_task_new (account, cancellable, callback, user_data); |
221 | 2505 | g_simple_async_result_new ((GObject *)account, | 2500 | g_object_add_weak_pointer ((GObject *)priv->store_task, |
222 | 2506 | callback, user_data, | 2501 | (gpointer *)&priv->store_task); |
213 | 2507 | ag_account_store_async); | ||
214 | 2508 | g_simple_async_result_set_check_cancellable (priv->store_async_result, | ||
215 | 2509 | cancellable); | ||
216 | 2510 | G_GNUC_END_IGNORE_DEPRECATIONS | ||
217 | 2511 | g_object_add_weak_pointer ((GObject *)priv->store_async_result, | ||
218 | 2512 | (gpointer *)&priv->store_async_result); | ||
223 | 2513 | 2502 | ||
224 | 2514 | if (G_UNLIKELY (priv->changes == NULL)) | 2503 | if (G_UNLIKELY (priv->changes == NULL)) |
225 | 2515 | { | 2504 | { |
226 | 2516 | /* Nothing to do: invoke the callback immediately */ | 2505 | /* Nothing to do: invoke the callback immediately */ |
231 | 2517 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | 2506 | g_task_return_boolean (priv->store_task, TRUE); |
232 | 2518 | g_simple_async_result_complete_in_idle (priv->store_async_result); | 2507 | g_clear_object (&priv->store_task); |
229 | 2519 | G_GNUC_END_IGNORE_DEPRECATIONS | ||
230 | 2520 | g_clear_object (&priv->store_async_result); | ||
233 | 2521 | return; | 2508 | return; |
234 | 2522 | } | 2509 | } |
235 | 2523 | 2510 | ||
238 | 2524 | _ag_manager_store_async (priv->manager, account, | 2511 | _ag_manager_store_async (priv->manager, account, priv->store_task); |
237 | 2525 | priv->store_async_result, cancellable); | ||
239 | 2526 | } | 2512 | } |
240 | 2527 | 2513 | ||
241 | 2528 | /** | 2514 | /** |
242 | @@ -2542,14 +2528,9 @@ | |||
243 | 2542 | ag_account_store_finish (AgAccount *account, GAsyncResult *res, | 2528 | ag_account_store_finish (AgAccount *account, GAsyncResult *res, |
244 | 2543 | GError **error) | 2529 | GError **error) |
245 | 2544 | { | 2530 | { |
246 | 2545 | GSimpleAsyncResult *async_result; | ||
247 | 2546 | |||
248 | 2547 | g_return_val_if_fail (AG_IS_ACCOUNT (account), FALSE); | 2531 | g_return_val_if_fail (AG_IS_ACCOUNT (account), FALSE); |
249 | 2548 | 2532 | ||
254 | 2549 | async_result = (GSimpleAsyncResult *)res; | 2533 | return g_task_propagate_boolean (G_TASK (res), error); |
251 | 2550 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | ||
252 | 2551 | return !g_simple_async_result_propagate_error (async_result, error); | ||
253 | 2552 | G_GNUC_END_IGNORE_DEPRECATIONS | ||
255 | 2553 | } | 2534 | } |
256 | 2554 | 2535 | ||
257 | 2555 | /** | 2536 | /** |
258 | 2556 | 2537 | ||
259 | === modified file 'libaccounts-glib/ag-internals.h' | |||
260 | --- libaccounts-glib/ag-internals.h 2013-12-23 15:22:56 +0000 | |||
261 | +++ libaccounts-glib/ag-internals.h 2016-05-20 08:55:52 +0000 | |||
262 | @@ -4,7 +4,7 @@ | |||
263 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
264 | 5 | * | 5 | * |
265 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
267 | 7 | * Copyright (C) 2012-2013 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
268 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
269 | 9 | * | 9 | * |
270 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
271 | @@ -95,8 +95,7 @@ | |||
272 | 95 | void _ag_manager_exec_transaction (AgManager *manager, const gchar *sql, | 95 | void _ag_manager_exec_transaction (AgManager *manager, const gchar *sql, |
273 | 96 | AgAccountChanges *changes, | 96 | AgAccountChanges *changes, |
274 | 97 | AgAccount *account, | 97 | AgAccount *account, |
277 | 98 | GSimpleAsyncResult *async_result, | 98 | GTask *task); |
276 | 99 | GCancellable *cancellable); | ||
278 | 100 | 99 | ||
279 | 101 | typedef gboolean (*AgQueryCallback) (sqlite3_stmt *stmt, gpointer user_data); | 100 | typedef gboolean (*AgQueryCallback) (sqlite3_stmt *stmt, gpointer user_data); |
280 | 102 | 101 | ||
281 | @@ -125,8 +124,7 @@ | |||
282 | 125 | 124 | ||
283 | 126 | G_GNUC_INTERNAL | 125 | G_GNUC_INTERNAL |
284 | 127 | void _ag_manager_store_async (AgManager *manager, AgAccount *account, | 126 | void _ag_manager_store_async (AgManager *manager, AgAccount *account, |
287 | 128 | GSimpleAsyncResult *async_result, | 127 | GTask *task); |
286 | 129 | GCancellable *cancellable); | ||
288 | 130 | G_GNUC_INTERNAL | 128 | G_GNUC_INTERNAL |
289 | 131 | gboolean _ag_manager_store_sync (AgManager *manager, AgAccount *account, | 129 | gboolean _ag_manager_store_sync (AgManager *manager, AgAccount *account, |
290 | 132 | GError **error); | 130 | GError **error); |
291 | 133 | 131 | ||
292 | === modified file 'libaccounts-glib/ag-manager.c' | |||
293 | --- libaccounts-glib/ag-manager.c 2016-02-18 19:37:45 +0000 | |||
294 | +++ libaccounts-glib/ag-manager.c 2016-05-20 08:55:52 +0000 | |||
295 | @@ -4,7 +4,7 @@ | |||
296 | 4 | * This file is part of libaccounts-glib | 4 | * This file is part of libaccounts-glib |
297 | 5 | * | 5 | * |
298 | 6 | * Copyright (C) 2009-2010 Nokia Corporation. | 6 | * Copyright (C) 2009-2010 Nokia Corporation. |
300 | 7 | * Copyright (C) 2012-2013 Canonical Ltd. | 7 | * Copyright (C) 2012-2016 Canonical Ltd. |
301 | 8 | * Copyright (C) 2012 Intel Corporation. | 8 | * Copyright (C) 2012 Intel Corporation. |
302 | 9 | * | 9 | * |
303 | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> | 10 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
304 | @@ -148,8 +148,7 @@ | |||
305 | 148 | gchar *sql; | 148 | gchar *sql; |
306 | 149 | AgAccountChanges *changes; | 149 | AgAccountChanges *changes; |
307 | 150 | guint id; | 150 | guint id; |
310 | 151 | GSimpleAsyncResult *async_result; | 151 | GTask *task; |
309 | 152 | GCancellable *cancellable; | ||
311 | 153 | } StoreCbData; | 152 | } StoreCbData; |
312 | 154 | 153 | ||
313 | 155 | typedef struct { | 154 | typedef struct { |
314 | @@ -183,27 +182,23 @@ | |||
315 | 183 | gpointer user_data) | 182 | gpointer user_data) |
316 | 184 | { | 183 | { |
317 | 185 | GDBusConnection *conn = G_DBUS_CONNECTION (object); | 184 | GDBusConnection *conn = G_DBUS_CONNECTION (object); |
319 | 186 | GSimpleAsyncResult *async_result = user_data; | 185 | GTask *task = user_data; |
320 | 187 | GVariant *result; | 186 | GVariant *result; |
321 | 188 | GError *error_int = NULL; | 187 | GError *error_int = NULL; |
322 | 189 | 188 | ||
323 | 190 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | ||
324 | 191 | result = g_dbus_connection_call_finish (conn, res, &error_int); | 189 | result = g_dbus_connection_call_finish (conn, res, &error_int); |
325 | 192 | if (G_UNLIKELY (error_int)) | 190 | if (G_UNLIKELY (error_int)) |
326 | 193 | { | 191 | { |
327 | 194 | /* We always report a read-only error here */ | 192 | /* We always report a read-only error here */ |
334 | 195 | GError error = { | 193 | g_task_return_new_error (task, |
335 | 196 | AG_ACCOUNTS_ERROR, | 194 | AG_ACCOUNTS_ERROR, |
336 | 197 | AG_ACCOUNTS_ERROR_READONLY, | 195 | AG_ACCOUNTS_ERROR_READONLY, |
337 | 198 | error_int->message | 196 | "%s", error_int->message); |
332 | 199 | }; | ||
333 | 200 | g_simple_async_result_set_from_error (async_result, &error); | ||
338 | 201 | g_error_free (error_int); | 197 | g_error_free (error_int); |
339 | 202 | } | 198 | } |
340 | 203 | else | 199 | else |
341 | 204 | { | 200 | { |
344 | 205 | GObject *source = | 201 | GObject *source = g_task_get_source_object (task); |
343 | 206 | g_async_result_get_source_object ((GAsyncResult *)async_result); | ||
345 | 207 | AgAccount *account = AG_ACCOUNT (source); | 202 | AgAccount *account = AG_ACCOUNT (source); |
346 | 208 | /* If this was a new account, we must update the local data | 203 | /* If this was a new account, we must update the local data |
347 | 209 | * structure */ | 204 | * structure */ |
348 | @@ -213,42 +208,37 @@ | |||
349 | 213 | AgAccountChanges *changes; | 208 | AgAccountChanges *changes; |
350 | 214 | 209 | ||
351 | 215 | g_variant_get_child (result, 0, "u", &account->id); | 210 | g_variant_get_child (result, 0, "u", &account->id); |
353 | 216 | changes = g_object_get_data ((GObject *)async_result, | 211 | changes = g_object_get_data ((GObject *)task, |
354 | 217 | key_remote_changes); | 212 | key_remote_changes); |
355 | 218 | _ag_account_done_changes (account, changes); | 213 | _ag_account_done_changes (account, changes); |
356 | 219 | } | 214 | } |
357 | 220 | g_variant_unref (result); | 215 | g_variant_unref (result); |
358 | 216 | g_task_return_boolean (task, TRUE); | ||
359 | 221 | } | 217 | } |
360 | 222 | 218 | ||
364 | 223 | g_simple_async_result_complete_in_idle (async_result); | 219 | g_object_unref (task); |
362 | 224 | g_object_unref (async_result); | ||
363 | 225 | G_GNUC_END_IGNORE_DEPRECATIONS | ||
365 | 226 | } | 220 | } |
366 | 227 | 221 | ||
367 | 228 | static void | 222 | static void |
368 | 229 | ag_manager_store_dbus_async (AgManager *manager, AgAccount *account, | 223 | ag_manager_store_dbus_async (AgManager *manager, AgAccount *account, |
371 | 230 | GSimpleAsyncResult *async_result, | 224 | GTask *task) |
370 | 231 | GCancellable *cancellable) | ||
372 | 232 | { | 225 | { |
373 | 233 | AgManagerPrivate *priv = manager->priv; | 226 | AgManagerPrivate *priv = manager->priv; |
374 | 234 | AgAccountChanges *changes; | 227 | AgAccountChanges *changes; |
375 | 235 | GVariant *dbus_changes; | 228 | GVariant *dbus_changes; |
376 | 236 | 229 | ||
377 | 237 | if (G_UNLIKELY (!priv->use_dbus)) { | 230 | if (G_UNLIKELY (!priv->use_dbus)) { |
386 | 238 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | 231 | g_task_return_new_error (task, |
387 | 239 | g_simple_async_result_set_error (async_result, | 232 | AG_ACCOUNTS_ERROR, |
388 | 240 | AG_ACCOUNTS_ERROR, | 233 | AG_ACCOUNTS_ERROR_READONLY, |
389 | 241 | AG_ACCOUNTS_ERROR_READONLY, | 234 | "DB read-only and D-Bus disabled"); |
390 | 242 | "DB read-only and D-Bus disabled"); | 235 | g_object_unref (task); |
383 | 243 | g_simple_async_result_complete_in_idle (async_result); | ||
384 | 244 | G_GNUC_END_IGNORE_DEPRECATIONS | ||
385 | 245 | g_object_unref (async_result); | ||
391 | 246 | return; | 236 | return; |
392 | 247 | } | 237 | } |
393 | 248 | 238 | ||
394 | 249 | changes = _ag_account_steal_changes (account); | 239 | changes = _ag_account_steal_changes (account); |
395 | 250 | dbus_changes = _ag_account_build_dbus_changes (account, changes, NULL); | 240 | dbus_changes = _ag_account_build_dbus_changes (account, changes, NULL); |
397 | 251 | g_object_set_data_full ((GObject *)async_result, | 241 | g_object_set_data_full ((GObject *)task, |
398 | 252 | key_remote_changes, changes, | 242 | key_remote_changes, changes, |
399 | 253 | (GDestroyNotify) _ag_account_changes_free); | 243 | (GDestroyNotify) _ag_account_changes_free); |
400 | 254 | 244 | ||
401 | @@ -261,9 +251,9 @@ | |||
402 | 261 | NULL, | 251 | NULL, |
403 | 262 | G_DBUS_CALL_FLAGS_NONE, | 252 | G_DBUS_CALL_FLAGS_NONE, |
404 | 263 | -1, | 253 | -1, |
406 | 264 | cancellable, | 254 | g_task_get_cancellable (task), |
407 | 265 | (GAsyncReadyCallback)on_dbus_store_done, | 255 | (GAsyncReadyCallback)on_dbus_store_done, |
409 | 266 | async_result); | 256 | task); |
410 | 267 | } | 257 | } |
411 | 268 | 258 | ||
412 | 269 | static gboolean | 259 | static gboolean |
413 | @@ -1095,11 +1085,9 @@ | |||
414 | 1095 | g_object_ref (account); | 1085 | g_object_ref (account); |
415 | 1096 | 1086 | ||
416 | 1097 | /* If the operation was cancelled, abort it. */ | 1087 | /* If the operation was cancelled, abort it. */ |
418 | 1098 | if (sd->cancellable != NULL) | 1088 | if (g_task_return_error_if_cancelled (sd->task)) |
419 | 1099 | { | 1089 | { |
423 | 1100 | g_cancellable_set_error_if_cancelled (sd->cancellable, &error); | 1090 | goto finish; |
421 | 1101 | if (error != NULL) | ||
422 | 1102 | goto finish; | ||
424 | 1103 | } | 1091 | } |
425 | 1104 | 1092 | ||
426 | 1105 | g_return_val_if_fail (priv->begin_stmt != NULL, FALSE); | 1093 | g_return_val_if_fail (priv->begin_stmt != NULL, FALSE); |
427 | @@ -1125,9 +1113,11 @@ | |||
428 | 1125 | finish: | 1113 | finish: |
429 | 1126 | if (error != NULL) | 1114 | if (error != NULL) |
430 | 1127 | { | 1115 | { |
434 | 1128 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | 1116 | g_task_return_error (sd->task, error); |
435 | 1129 | g_simple_async_result_take_error (sd->async_result, error); | 1117 | } |
436 | 1130 | G_GNUC_END_IGNORE_DEPRECATIONS | 1118 | else |
437 | 1119 | { | ||
438 | 1120 | g_task_return_boolean (sd->task, TRUE); | ||
439 | 1131 | } | 1121 | } |
440 | 1132 | 1122 | ||
441 | 1133 | _ag_account_store_completed (account, sd->changes); | 1123 | _ag_account_store_completed (account, sd->changes); |
442 | @@ -2390,8 +2380,7 @@ | |||
443 | 2390 | void | 2380 | void |
444 | 2391 | _ag_manager_exec_transaction (AgManager *manager, const gchar *sql, | 2381 | _ag_manager_exec_transaction (AgManager *manager, const gchar *sql, |
445 | 2392 | AgAccountChanges *changes, AgAccount *account, | 2382 | AgAccountChanges *changes, AgAccount *account, |
448 | 2393 | GSimpleAsyncResult *async_result, | 2383 | GTask *task) |
447 | 2394 | GCancellable *cancellable) | ||
449 | 2395 | { | 2384 | { |
450 | 2396 | AgManagerPrivate *priv = manager->priv; | 2385 | AgManagerPrivate *priv = manager->priv; |
451 | 2397 | GError *error = NULL; | 2386 | GError *error = NULL; |
452 | @@ -2413,8 +2402,7 @@ | |||
453 | 2413 | sd->manager = manager; | 2402 | sd->manager = manager; |
454 | 2414 | sd->account = account; | 2403 | sd->account = account; |
455 | 2415 | sd->changes = changes; | 2404 | sd->changes = changes; |
458 | 2416 | sd->async_result = async_result; | 2405 | sd->task = task; |
457 | 2417 | sd->cancellable = cancellable; | ||
459 | 2418 | sd->sql = g_strdup (sql); | 2406 | sd->sql = g_strdup (sql); |
460 | 2419 | sd->id = g_idle_add ((GSourceFunc)exec_transaction_idle, sd); | 2407 | sd->id = g_idle_add ((GSourceFunc)exec_transaction_idle, sd); |
461 | 2420 | priv->locks = g_list_prepend (priv->locks, sd); | 2408 | priv->locks = g_list_prepend (priv->locks, sd); |
462 | @@ -2432,9 +2420,11 @@ | |||
463 | 2432 | finish: | 2420 | finish: |
464 | 2433 | if (error != NULL) | 2421 | if (error != NULL) |
465 | 2434 | { | 2422 | { |
469 | 2435 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | 2423 | g_task_return_error (task, error); |
470 | 2436 | g_simple_async_result_take_error (async_result, error); | 2424 | } |
471 | 2437 | G_GNUC_END_IGNORE_DEPRECATIONS | 2425 | else |
472 | 2426 | { | ||
473 | 2427 | g_task_return_boolean (task, TRUE); | ||
474 | 2438 | } | 2428 | } |
475 | 2439 | 2429 | ||
476 | 2440 | _ag_account_store_completed (account, changes); | 2430 | _ag_account_store_completed (account, changes); |
477 | @@ -2485,8 +2475,7 @@ | |||
478 | 2485 | 2475 | ||
479 | 2486 | static void | 2476 | static void |
480 | 2487 | ag_manager_store_local_async (AgManager *manager, AgAccount *account, | 2477 | ag_manager_store_local_async (AgManager *manager, AgAccount *account, |
483 | 2488 | GSimpleAsyncResult *async_result, | 2478 | GTask *task) |
482 | 2489 | GCancellable *cancellable) | ||
484 | 2490 | { | 2479 | { |
485 | 2491 | AgAccountChanges *changes; | 2480 | AgAccountChanges *changes; |
486 | 2492 | GError *error = NULL; | 2481 | GError *error = NULL; |
487 | @@ -2495,19 +2484,14 @@ | |||
488 | 2495 | sql = _ag_account_get_store_sql (account, &error); | 2484 | sql = _ag_account_get_store_sql (account, &error); |
489 | 2496 | if (G_UNLIKELY (error)) | 2485 | if (G_UNLIKELY (error)) |
490 | 2497 | { | 2486 | { |
497 | 2498 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | 2487 | g_task_return_error (task, error); |
498 | 2499 | g_simple_async_result_take_error (async_result, | 2488 | g_object_unref (task); |
493 | 2500 | error); | ||
494 | 2501 | g_simple_async_result_complete_in_idle (async_result); | ||
495 | 2502 | G_GNUC_END_IGNORE_DEPRECATIONS | ||
496 | 2503 | g_object_unref (async_result); | ||
499 | 2504 | return; | 2489 | return; |
500 | 2505 | } | 2490 | } |
501 | 2506 | 2491 | ||
502 | 2507 | changes = _ag_account_steal_changes (account); | 2492 | changes = _ag_account_steal_changes (account); |
503 | 2508 | 2493 | ||
506 | 2509 | _ag_manager_exec_transaction (manager, sql, changes, account, | 2494 | _ag_manager_exec_transaction (manager, sql, changes, account, task); |
505 | 2510 | async_result, cancellable); | ||
507 | 2511 | g_free (sql); | 2495 | g_free (sql); |
508 | 2512 | } | 2496 | } |
509 | 2513 | 2497 | ||
510 | @@ -2547,18 +2531,15 @@ | |||
511 | 2547 | 2531 | ||
512 | 2548 | void | 2532 | void |
513 | 2549 | _ag_manager_store_async (AgManager *manager, AgAccount *account, | 2533 | _ag_manager_store_async (AgManager *manager, AgAccount *account, |
516 | 2550 | GSimpleAsyncResult *async_result, | 2534 | GTask *task) |
515 | 2551 | GCancellable *cancellable) | ||
517 | 2552 | { | 2535 | { |
518 | 2553 | if (manager->priv->is_readonly) | 2536 | if (manager->priv->is_readonly) |
519 | 2554 | { | 2537 | { |
522 | 2555 | ag_manager_store_dbus_async (manager, account, async_result, | 2538 | ag_manager_store_dbus_async (manager, account, task); |
521 | 2556 | cancellable); | ||
523 | 2557 | } | 2539 | } |
524 | 2558 | else | 2540 | else |
525 | 2559 | { | 2541 | { |
528 | 2560 | ag_manager_store_local_async (manager, account, async_result, | 2542 | ag_manager_store_local_async (manager, account, task); |
527 | 2561 | cancellable); | ||
529 | 2562 | } | 2543 | } |
530 | 2563 | } | 2544 | } |
531 | 2564 | 2545 | ||
532 | 2565 | 2546 | ||
533 | === modified file 'm4/gcov.m4' | |||
534 | --- m4/gcov.m4 2015-07-09 10:16:42 +0000 | |||
535 | +++ m4/gcov.m4 2016-05-20 08:55:52 +0000 | |||
536 | @@ -46,7 +46,7 @@ | |||
537 | 46 | AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) | 46 | AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) |
538 | 47 | fi | 47 | fi |
539 | 48 | 48 | ||
541 | 49 | lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11" | 49 | lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12" |
542 | 50 | AC_CHECK_PROG(LCOV, lcov, lcov) | 50 | AC_CHECK_PROG(LCOV, lcov, lcov) |
543 | 51 | AC_CHECK_PROG(GENHTML, genhtml, genhtml) | 51 | AC_CHECK_PROG(GENHTML, genhtml, genhtml) |
544 | 52 | 52 |