Merge lp:~mardy/online-accounts-api/update into lp:online-accounts-api
- update
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | David Barth |
Approved revision: | 71 |
Merged at revision: | 13 |
Proposed branch: | lp:~mardy/online-accounts-api/update |
Merge into: | lp:online-accounts-api |
Diff against target: |
3145 lines (+2121/-306) 44 files modified
.bzrignore (+2/-2) CMakeLists.txt (+3/-0) debian/control (+19/-4) debian/libonline-accounts-daemon1.install (+1/-2) debian/qml-module-ubuntu-onlineaccounts2-doc.install (+1/-0) debian/rules (+2/-0) doc/CMakeLists.txt (+13/-0) doc/css/base.css (+638/-0) doc/css/breadcrumbs.js (+21/-0) doc/css/custom.css (+11/-0) doc/css/qtquick.css (+788/-0) doc/css/reset.css (+8/-0) doc/css/scratch.css (+104/-0) doc/ubuntu-onlineaccounts2.qdocconf (+21/-0) src/daemon/CMakeLists.txt (+27/-0) src/daemon/main.cpp (+2/-2) src/lib/OnlineAccounts/CMakeLists.txt (+1/-0) src/lib/OnlineAccounts/account.cpp (+6/-0) src/lib/OnlineAccounts/account.h (+1/-0) src/lib/OnlineAccounts/account_info.h (+10/-1) src/lib/OnlineAccounts/authentication_data.cpp (+16/-1) src/lib/OnlineAccounts/authentication_data.h (+6/-1) src/lib/OnlineAccounts/authentication_reply.cpp (+7/-1) src/lib/OnlineAccounts/error.cpp (+1/-1) src/lib/OnlineAccounts/manager.cpp (+1/-1) src/lib/OnlineAccountsDaemon/CMakeLists.txt (+17/-17) src/lib/OnlineAccountsDaemon/Manager (+1/-0) src/lib/OnlineAccountsDaemon/OnlineAccountsDaemon.pc.in (+3/-1) src/lib/OnlineAccountsDaemon/global.h (+32/-0) src/lib/OnlineAccountsDaemon/manager.cpp (+15/-0) src/lib/OnlineAccountsDaemon/manager.h (+7/-1) src/lib/OnlineAccountsDaemon/manager_adaptor.h (+1/-0) src/lib/Ubuntu/OnlineAccounts.2/account.cpp (+137/-4) src/lib/Ubuntu/OnlineAccounts.2/account.h (+11/-1) src/lib/Ubuntu/OnlineAccounts.2/account_model.cpp (+116/-2) src/lib/Ubuntu/OnlineAccounts.2/account_model.h (+2/-0) src/lib/Ubuntu/OnlineAccounts.2/authentication_data.cpp (+16/-84) src/lib/Ubuntu/OnlineAccounts.2/authentication_data.h (+1/-2) tests/daemon/functional_tests/daemon_interface.h (+1/-1) tests/daemon/functional_tests/data/com.ubuntu.OnlineAccounts.Manager.service.in (+1/-1) tests/daemon/functional_tests/functional_tests.cpp (+4/-1) tests/lib/OnlineAccounts/functional_tests/functional_tests.cpp (+22/-3) tests/lib/OnlineAccounts/tst_authentication_data/tst_authentication_data.cpp (+11/-0) tests/lib/qml_module/tst_qml_module.cpp (+13/-172) |
To merge this branch: | bzr merge lp:~mardy/online-accounts-api/update |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Online Accounts | Pending | ||
Review via email: mp+270037@code.launchpad.net |
Commit message
Docs, fixes, library install
- Docs
- Couple of bugfixes
- Package the daemon as a library
Description of the change
Docs, fixes, library install
- Docs
- Couple of bugfixes
- Package the daemon as a library
Testing instructions
=======
When installing the silo, for some reason not all packages get installed. You'll need to manually run
sudo apt-get install qml-module-
To test the new API, you can use this click package: www.mardy.
(the source code can be found at https:/
This test is important because it tests the full stack: QML bindings, Qt bindings (the QML bindings are built on top of the Qt ones), and D-Bus service.
Install the package in the device, then run:
sudo vi /var/lib/
insert these lines before the last "}":
dbus (receive, send)
bus=session
and rebuild the rules:
sudo apparmor_parser -r /var/lib/
Once that is done, start the tool (it has a big ugly "V2" icon), click the request access button to add an account, and then once the account appears in the application you can click on the button to authenticate.
- 68. By Alberto Mardegan
-
Hide library symbols
- 69. By Alberto Mardegan
-
Install .so file
- 70. By Alberto Mardegan
-
Add get() method to model
- 71. By Alberto Mardegan
-
Also read provider settings
Preview Diff
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2015-07-31 12:44:30 +0000 |
3 | +++ .bzrignore 2015-09-23 12:41:07 +0000 |
4 | @@ -2,10 +2,10 @@ |
5 | /debian/files |
6 | /debian/*.debhelper* |
7 | /debian/*.substvars |
8 | +/debian/libonline-accounts-daemon1/ |
9 | /debian/libonline-accounts-daemon-dev/ |
10 | /debian/libonline-accounts-qt-dev/ |
11 | /debian/libonline-accounts-qt1/ |
12 | -/debian/online-accounts-daemon/ |
13 | -/debian/online-accounts-daemon-dev/ |
14 | /debian/qml-module-ubuntu-onlineaccounts2/ |
15 | +/debian/qml-module-ubuntu-onlineaccounts2-doc/ |
16 | /debian/tmp/ |
17 | |
18 | === modified file 'CMakeLists.txt' |
19 | --- CMakeLists.txt 2015-08-06 12:22:06 +0000 |
20 | +++ CMakeLists.txt 2015-09-23 12:41:07 +0000 |
21 | @@ -17,10 +17,13 @@ |
22 | |
23 | set(CMAKE_AUTOMOC ON) |
24 | |
25 | +add_subdirectory(src/lib/OnlineAccountsDaemon) |
26 | add_subdirectory(src/daemon) |
27 | add_subdirectory(src/lib/OnlineAccounts) |
28 | add_subdirectory(src/lib/Ubuntu/OnlineAccounts.2) |
29 | |
30 | +add_subdirectory(doc) |
31 | + |
32 | if(cmake_build_type_lower MATCHES coverage) |
33 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" ) |
34 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" ) |
35 | |
36 | === modified file 'debian/control' |
37 | --- debian/control 2015-08-04 13:55:17 +0000 |
38 | +++ debian/control 2015-09-23 12:41:07 +0000 |
39 | @@ -24,22 +24,26 @@ |
40 | # code again. |
41 | Vcs-Bzr: https://code.launchpad.net/~online-accounts/online-accounts-api/trunk |
42 | |
43 | -Package: online-accounts-daemon |
44 | +Package: libonline-accounts-daemon1 |
45 | +Section: libs |
46 | Architecture: any |
47 | Depends: ${misc:Depends}, |
48 | ${shlibs:Depends}, |
49 | - signond, |
50 | +Pre-Depends: ${misc:Pre-Depends}, |
51 | Description: Online Accounts simplified API (D-Bus service) |
52 | D-Bus service implementing the simplified Online Accounts API. |
53 | |
54 | -Package: online-accounts-daemon-dev |
55 | +Package: libonline-accounts-daemon-dev |
56 | Section: libdevel |
57 | Architecture: any |
58 | Multi-Arch: same |
59 | Depends: ${misc:Depends}, |
60 | ${shlibs:Depends}, |
61 | - online-accounts-daemon (= ${binary:Version}), |
62 | + libonline-accounts-daemon1 (= ${binary:Version}), |
63 | Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends}, |
64 | +Breaks: online-accounts-daemon-dev |
65 | +Provides: online-accounts-daemon-dev |
66 | +Replaces: online-accounts-daemon-dev |
67 | Description: Online Accounts simplified API (bindings development files) |
68 | This module contains the necessary files for developing client libraries |
69 | interfacing with the simplified Online Accounts API. |
70 | @@ -76,3 +80,14 @@ |
71 | Description: Online Accounts API for QML applications |
72 | This module provides access to the new Online Accounts API from QML |
73 | applications. |
74 | + |
75 | +Package: qml-module-ubuntu-onlineaccounts2-doc |
76 | +Section: doc |
77 | +Architecture: all |
78 | +Multi-Arch: foreign |
79 | +Depends: ${misc:Depends}, |
80 | +Description: Online Accounts API, HTML documentation |
81 | + This module provides access to the new Online Accounts API from QML |
82 | + applications. |
83 | + . |
84 | + This package contains the HTML documentation. |
85 | |
86 | === renamed file 'debian/online-accounts-daemon-dev.install' => 'debian/libonline-accounts-daemon-dev.install' |
87 | === renamed file 'debian/online-accounts-daemon.install' => 'debian/libonline-accounts-daemon1.install' |
88 | --- debian/online-accounts-daemon.install 2015-07-15 14:49:26 +0000 |
89 | +++ debian/libonline-accounts-daemon1.install 2015-09-23 12:41:07 +0000 |
90 | @@ -1,2 +1,1 @@ |
91 | -usr/bin/accountd |
92 | -usr/share/dbus-1/services/com.ubuntu.OnlineAccounts.Manager.service |
93 | +usr/lib/*/libOnlineAccountsDaemon.so |
94 | |
95 | === added file 'debian/qml-module-ubuntu-onlineaccounts2-doc.install' |
96 | --- debian/qml-module-ubuntu-onlineaccounts2-doc.install 1970-01-01 00:00:00 +0000 |
97 | +++ debian/qml-module-ubuntu-onlineaccounts2-doc.install 2015-09-23 12:41:07 +0000 |
98 | @@ -0,0 +1,1 @@ |
99 | +usr/share/doc/ubuntu-onlineaccounts2 |
100 | |
101 | === modified file 'debian/rules' |
102 | --- debian/rules 2015-07-15 14:49:26 +0000 |
103 | +++ debian/rules 2015-09-23 12:41:07 +0000 |
104 | @@ -5,6 +5,8 @@ |
105 | #export DH_VERBOSE=1 |
106 | |
107 | override_dh_install: |
108 | + rm -rf debian/*/usr/bin/accountd |
109 | + rm -rf debian/*/usr/share/dbus-1/services/com.ubuntu.OnlineAccounts.Manager.service |
110 | dh_install --fail-missing |
111 | |
112 | %: |
113 | |
114 | === added directory 'doc' |
115 | === added file 'doc/CMakeLists.txt' |
116 | --- doc/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
117 | +++ doc/CMakeLists.txt 2015-09-23 12:41:07 +0000 |
118 | @@ -0,0 +1,13 @@ |
119 | +project(OnlineAccountsQML-doc) |
120 | + |
121 | +find_program(QDOC_EXECUTABLE qdoc) |
122 | +if(QDOC_EXECUTABLE STREQUAL "QDOC_EXECUTABLE-NOTFOUND") |
123 | + message(WARNING "qdoc not found, documentation cannot be built") |
124 | +else() |
125 | + add_custom_target(doc ALL |
126 | + COMMAND ${QDOC_EXECUTABLE} |
127 | + -outputdir ${CMAKE_CURRENT_BINARY_DIR}/html |
128 | + ${CMAKE_CURRENT_SOURCE_DIR}/ubuntu-onlineaccounts2.qdocconf) |
129 | + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html |
130 | + DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/ubuntu-onlineaccounts2) |
131 | +endif() |
132 | |
133 | === added directory 'doc/css' |
134 | === added file 'doc/css/base.css' |
135 | --- doc/css/base.css 1970-01-01 00:00:00 +0000 |
136 | +++ doc/css/base.css 2015-09-23 12:41:07 +0000 |
137 | @@ -0,0 +1,638 @@ |
138 | +/** |
139 | +* Ubuntu Developer base stylesheet |
140 | +* |
141 | +* A base stylesheet containing site-wide styles |
142 | +* |
143 | +* @project Ubuntu Developer |
144 | +* @version 1.0 |
145 | +* @author Canonical Web Team: Steve Edwards |
146 | +* @copyright 2011 Canonical Ltd. |
147 | +*/ |
148 | + |
149 | +/** |
150 | +* @section Global |
151 | +*/ |
152 | + |
153 | +body { |
154 | + font-family: 'Ubuntu', 'Ubuntu Beta', UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif; |
155 | + font-size: 13px; |
156 | + line-height: 1.4; |
157 | + color: #333; |
158 | +} |
159 | +a { |
160 | + color: #dd4814; |
161 | + text-decoration: none; |
162 | + outline: 0; |
163 | +} |
164 | +p, dl { |
165 | + margin-bottom: 10px; |
166 | +} |
167 | +strong { |
168 | + font-weight: bold; |
169 | +} |
170 | +em { |
171 | + font-style: italic; |
172 | +} |
173 | +code{ |
174 | + padding: 10px; |
175 | + font-family: 'Ubuntu Mono', 'Consolas', 'Monaco', 'DejaVu Sans Mono', Courier, monospace; |
176 | + background-color: #fdf6f2; |
177 | + display: inline-block; |
178 | + margin-bottom: 10px; |
179 | + -moz-border-radius: 4px; |
180 | + -webkit-border-radius: 4px; |
181 | + border-radius: 4px; |
182 | +} |
183 | +h1 { |
184 | + font-size: 36px; |
185 | + line-height: 1.1; |
186 | + margin-bottom: 20px; |
187 | +} |
188 | +article h1, |
189 | +h2 { |
190 | + font-size: 24px; |
191 | + line-height: 1.2; |
192 | + margin-bottom: 14px; |
193 | +} |
194 | +h3 { |
195 | + font-size: 16px; |
196 | + line-height: 1.3; |
197 | + margin-bottom: 8px; |
198 | +} |
199 | +h4 { |
200 | + font-weight: bold; |
201 | +} |
202 | + |
203 | +time { |
204 | + color:#999; |
205 | +} |
206 | + |
207 | +/** |
208 | +* @section Structure |
209 | +*/ |
210 | + |
211 | +.header-login, |
212 | +.header-navigation div, |
213 | +.header-content div { |
214 | + margin: 0 auto; |
215 | + width: 940px; |
216 | +} |
217 | + |
218 | +.header-content h1{ |
219 | + background-color:#ffffff; |
220 | + display:inline-block; |
221 | +} |
222 | + |
223 | +.header-content h2{ |
224 | + background-color:#ffffff; |
225 | + display:table; |
226 | +} |
227 | + |
228 | +.header-login ul { |
229 | + margin: 4px 0; |
230 | + float: right; |
231 | +} |
232 | +.header-login li { |
233 | + margin-right: 10px; |
234 | + float: left; |
235 | +} |
236 | +.header-login a { |
237 | + color: #333; |
238 | +} |
239 | +.header-navigation { |
240 | + border-top: 2px solid #dd4814; |
241 | + border-bottom: 2px solid #dd4814; |
242 | + background-color: #fff; |
243 | + height: 54px; |
244 | + clear: right; |
245 | + overflow: hidden; |
246 | +} |
247 | +.header-navigation nav ul { |
248 | + border-right: 1px solid #dd4814; |
249 | + float: right; |
250 | +} |
251 | +.header-navigation nav li { |
252 | + border-left: 1px solid #dd4814; |
253 | + float: left; |
254 | + height: 54px; |
255 | +} |
256 | +.header-navigation nav a { |
257 | + padding: 18px 14px 0; |
258 | + font-size: 14px; |
259 | + display: block; |
260 | + height: 36px; |
261 | +} |
262 | +.header-navigation nav a:hover { |
263 | + background-color: #fcece7; |
264 | +} |
265 | +.header-navigation nav .current_page_item a, |
266 | +.header-navigation nav .current_page_parent a, |
267 | +.header-navigation nav .current_page_ancestor a { |
268 | + background-color: #dd4814; |
269 | + color: #fff; |
270 | +} |
271 | +.header-navigation input { |
272 | + margin: 12px 10px 0 10px; |
273 | + padding: 5px; |
274 | + border-top: 1px solid #a1a1a1; |
275 | + border-right: 1px solid #e0e0e0; |
276 | + border-bottom: 1px solid #fff; |
277 | + border-left: 1px solid #e0e0e0; |
278 | + width: 90px; |
279 | + font-style: italic; |
280 | + color: #ccc; |
281 | + -moz-border-radius: 3px; |
282 | + -webkit-border-radius: 3px; |
283 | + border-radius: 3px; |
284 | + -moz-box-shadow: inset 0 1px 1px #e0e0e0; |
285 | + -webkit-box-shadow: inset 0 1px 1px #e0e0e0; |
286 | + box-shadow: inset 0 1px 1px #e0e0e0; |
287 | +} |
288 | +.header-navigation h2 { |
289 | + margin: 18px 0 0 6px; |
290 | + text-transform: lowercase; |
291 | + font-size: 22px; |
292 | + color: #dd4814; |
293 | + float: left; |
294 | +} |
295 | +.header-navigation .logo-ubuntu { |
296 | + margin-top: 12px; |
297 | + float: left; |
298 | +} |
299 | +.header-content .header-navigation-secondary { |
300 | + margin-bottom: 40px; |
301 | + padding: 0; |
302 | + position: relative; |
303 | + z-index: 2; |
304 | +} |
305 | +.header-navigation-secondary div { |
306 | + padding: 0; |
307 | + border: 2px solid #dd4814; |
308 | + -moz-border-radius: 0px 0px 4px 4px; |
309 | + -webkit-border-radius: 0px 0px 4px 4px; |
310 | + border-radius: 0px 0px 4px 4px; |
311 | + background: #fff; |
312 | + border-top: 0px; |
313 | + width: 936px; |
314 | +} |
315 | +.header-navigation-secondary nav li { |
316 | + float: left; |
317 | +} |
318 | +.header-navigation-secondary nav li a { |
319 | + color: #333; |
320 | + display: block; |
321 | + height: 25px; |
322 | + padding: 8px 8px 0; |
323 | +} |
324 | +.header-navigation-secondary nav li:hover, |
325 | +.header-navigation-secondary nav .current_page_item a { |
326 | + background: url("../img/sec-nav-hover.gif"); |
327 | +} |
328 | +.header-content { |
329 | + padding-bottom: 30px; |
330 | + border-bottom: 1px solid #e0e0e0; |
331 | + -moz-box-shadow: 0 1px 3px #e0e0e0; |
332 | + -webkit-box-shadow: 0 1px 3px #e0e0e0; |
333 | + box-shadow: 0 1px 3px #e0e0e0; |
334 | + margin-bottom: 3px; |
335 | + position: relative; |
336 | + overflow: hidden; |
337 | +} |
338 | +footer { |
339 | + padding: 10px 10px 40px 10px; |
340 | + position: relative; |
341 | + -moz-border-radius: 0 0 4px 4px; |
342 | + -webkit-border-radius: 0 0 4px 4px; |
343 | + border-radius: 0 0 4px 4px; |
344 | + font-size: 12px; |
345 | + background: url("../img/background-footer.png") repeat scroll 0 0 #f7f6f5; |
346 | +} |
347 | +footer div { |
348 | + margin: 0 auto; |
349 | + padding: 0 10px; |
350 | + width: 940px; |
351 | +} |
352 | +footer a { |
353 | + color: #000; |
354 | +} |
355 | +footer nav ul { |
356 | + margin: 10px 17px 30px 0; |
357 | + width: 172px; |
358 | + display: inline-block; |
359 | + vertical-align: top; |
360 | + height: auto; |
361 | + zoom: 1; |
362 | + *display: inline; |
363 | +} |
364 | +footer nav ul.last { |
365 | + margin-right: 0; |
366 | +} |
367 | +footer nav li { |
368 | + margin-bottom: 8px; |
369 | +} |
370 | +footer nav li:first-child { |
371 | + font-weight: bold; |
372 | +} |
373 | +footer p { |
374 | + margin-bottom: 0; |
375 | +} |
376 | +#content { |
377 | + padding-top: 35px; |
378 | +} |
379 | +.arrow-nav { |
380 | + display: none; |
381 | + position: absolute; |
382 | + top: -1px; |
383 | + z-index: 3; |
384 | +} |
385 | +.shadow { |
386 | + margin: 30px 0 3px 0; |
387 | + border-bottom: 1px solid #e0e0e0; |
388 | + -moz-box-shadow: 0 2px 3px #e0e0e0; |
389 | + -webkit-box-shadow: 0 2px 3px #e0e0e0; |
390 | + box-shadow: 0 2px 3px #e0e0e0; |
391 | + height: 3px; |
392 | +} |
393 | + |
394 | +/** |
395 | +* @section Site-wide |
396 | +*/ |
397 | + |
398 | +#content h2{ |
399 | + font-size:24px; |
400 | +} |
401 | + |
402 | +.box-orange { |
403 | + padding: 10px; |
404 | + border: 3px solid #dd4814; |
405 | + -moz-border-radius: 4px; |
406 | + -webkit-border-radius: 4px; |
407 | + border-radius: 4px; |
408 | +} |
409 | +.box-orange .link-action-small { |
410 | + float: right; |
411 | + margin: 0 0 0 20px; |
412 | +} |
413 | +.link-bug { |
414 | + margin-left: 10px; |
415 | + color: #999; |
416 | +} |
417 | +.link-action { |
418 | + float: left; |
419 | + margin-bottom: 20px; |
420 | + padding: 8px 12px; |
421 | + display: block; |
422 | + background-color: #dd4814; |
423 | + color: #fff; |
424 | + -moz-border-radius: 20px; |
425 | + -webkit-border-radius: 20px; |
426 | + border-radius: 20px; |
427 | + font-size: 16px; |
428 | + line-height: 1.3; |
429 | + border-top: 3px solid #e6633a; |
430 | + border-bottom: 3px solid #c03d14; |
431 | +} |
432 | +.link-action2 { |
433 | + float: left; |
434 | + display: block; |
435 | + color: #fff; |
436 | + font-size: 16px; |
437 | + line-height: 1.3; |
438 | +} |
439 | +.link-action2 span{ |
440 | + display:block; |
441 | + float:left; |
442 | +} |
443 | +.link-action2 .cta-left{ |
444 | + background:url(../img/button-cta-left.png) no-repeat; |
445 | + width:22px; |
446 | + height:48px; |
447 | +} |
448 | +.link-action2 .cta-center{ |
449 | + background:url(../img/button-cta-slice.png) repeat-x; |
450 | + line-height:45px; |
451 | + height:48px; |
452 | +} |
453 | +.link-action2 .cta-right{ |
454 | + background:url(../img/button-cta-right.png) no-repeat; |
455 | + width:22px; |
456 | + height:48px; |
457 | +} |
458 | + |
459 | +.link-action-small { |
460 | + float: left; |
461 | + display: block; |
462 | + color: #fff; |
463 | + font-size: 16px; |
464 | +} |
465 | +.link-action-small span{ |
466 | + display:block; |
467 | + float:left; |
468 | + height:42px; |
469 | +} |
470 | +.link-action-small .cta-left{ |
471 | + background:url(../img/button-cta-left-small.png) no-repeat; |
472 | + width:19px; |
473 | +} |
474 | +.link-action-small .cta-center{ |
475 | + background:url(../img/button-cta-slice-small.png) repeat-x; |
476 | + line-height:42px; |
477 | +} |
478 | +.link-action-small .cta-right{ |
479 | + background:url(../img/button-cta-right-small.png) no-repeat; |
480 | + width:19px; |
481 | +} |
482 | + |
483 | +.link-action:active { |
484 | + position: relative; |
485 | + top: 1px; |
486 | +} |
487 | +.link-action2:active { |
488 | + position: relative; |
489 | + top: 1px; |
490 | +} |
491 | +.link-action-small:active { |
492 | + position: relative; |
493 | + top: 1px; |
494 | +} |
495 | +.list-bullets li { |
496 | + margin-bottom: 10px; |
497 | + list-style: disc; |
498 | + list-style-position: inside; |
499 | +} |
500 | +.box { |
501 | + margin-bottom: 30px; |
502 | + padding: 15px; |
503 | + border: 1px solid #aea79f; |
504 | + -moz-border-radius: 4px; |
505 | + -webkit-border-radius: 4px; |
506 | + border-radius: 4px; |
507 | +} |
508 | +.box-padded { |
509 | + margin-bottom: 30px; |
510 | + padding: 5px; |
511 | + border: 2px solid #aea79f; |
512 | + -moz-border-radius: 4px; |
513 | + -webkit-border-radius: 4px; |
514 | + border-radius: 4px; |
515 | + background: url("../img/pattern-featured.gif") repeat scroll 0 0 #ebe9e7; |
516 | + overflow: hidden; |
517 | +} |
518 | +.box-padded h3 { |
519 | + margin: 5px 0 10px 5px; |
520 | +} |
521 | +.box-padded div { |
522 | + padding: 10px; |
523 | + border: 1px solid #aea79f; |
524 | + -moz-border-radius: 4px; |
525 | + -webkit-border-radius: 4px; |
526 | + border-radius: 4px; |
527 | + background-color: #fff; |
528 | + overflow: hidden; |
529 | +} |
530 | +.box-padded li { |
531 | + padding: 0 10px; |
532 | + float: left; |
533 | + width: 211px; |
534 | + border-right: 1px dotted #aea79f; |
535 | +} |
536 | +.box-padded li.first { |
537 | + padding: 0; |
538 | + margin-bottom: 0; |
539 | +} |
540 | +.box-padded li.last { |
541 | + border: 0; |
542 | + width: 217px; |
543 | +} |
544 | +.box-padded img { |
545 | + margin: 0 10px 50px 0; |
546 | + float: left; |
547 | + -moz-border-radius: 8px; |
548 | + -webkit-border-radius: 8px; |
549 | + border-radius: 8px; |
550 | +} |
551 | +.box-clear { |
552 | + margin-bottom: 40px; |
553 | +} |
554 | +.box-clear .grid-4.first { |
555 | + margin-right: 15px; |
556 | + padding-right: 15px; |
557 | +} |
558 | +.box-clear .grid-4 { |
559 | + margin-left: 0; |
560 | + margin-right: 10px; |
561 | + padding-right: 10px; |
562 | + width: 298px; |
563 | +} |
564 | +.box-clear time { |
565 | + display: block; |
566 | + border-bottom: 1px dotted #aea79f; |
567 | + padding-bottom: 10px; |
568 | + margin-bottom: 10px; |
569 | +} |
570 | +.box-clear div.first { |
571 | + border-right: 1px dotted #aea79f; |
572 | +} |
573 | +.box-clear a { |
574 | + display: block; |
575 | +} |
576 | +.box-clear .rss { |
577 | + background: url("../img/rss.jpg") no-repeat scroll 0 center; |
578 | + padding-left: 20px; |
579 | +} |
580 | +.box-clear .location { |
581 | + display: block; |
582 | + margin-bottom: 1px; |
583 | +} |
584 | +.box-clear .last { |
585 | + margin: 0; |
586 | + padding-right: 0; |
587 | + -moz-border-radius: 4px; |
588 | + -webkit-border-radius: 4px; |
589 | + border-radius: 4px; |
590 | + width: 293px; |
591 | +} |
592 | + |
593 | +/* Widgets */ |
594 | + |
595 | +.ui-state-focus { |
596 | + outline: none; |
597 | +} |
598 | +.ui-accordion { |
599 | + border-bottom: 1px dotted #aea79f; |
600 | +} |
601 | +.ui-accordion a { |
602 | + display: block; |
603 | +} |
604 | +.ui-accordion h3 { |
605 | + margin-bottom: 0; |
606 | + border-top: 1px dotted #aea79f; |
607 | + position: relative; |
608 | + font-size: 13px; |
609 | + font-weight: bold; |
610 | +} |
611 | +.ui-accordion h3 a { |
612 | + padding: 10px 0; |
613 | + color: #333; |
614 | +} |
615 | +.ui-accordion h4 { |
616 | + margin-bottom: 5px; |
617 | +} |
618 | +.ui-accordion div fieldset { |
619 | + padding-bottom: 5px; |
620 | +} |
621 | +.ui-accordion div li, |
622 | +.ui-accordion div input { |
623 | + margin-bottom: 10px; |
624 | +} |
625 | +.ui-accordion .ui-icon { |
626 | + position: absolute; |
627 | + top: 15px; |
628 | + right: 0; |
629 | + display: block; |
630 | + width: 8px; |
631 | + height: 8px; |
632 | + background: url("../img/icon-accordion-inactive.png") 0 0 no-repeat transparent; |
633 | +} |
634 | +.ui-accordion .ui-state-active .ui-icon { |
635 | + background-image: url("../img/icon-accordion-active.png"); |
636 | +} |
637 | +.ui-accordion .current_page_item a { |
638 | + color: #333; |
639 | +} |
640 | +.container-tweet { |
641 | + -moz-border-radius: 4px 4px 4px 4px; |
642 | + -webkit-border-radius: 4px 4px 4px 4px; |
643 | + border-radius: 4px 4px 4px 4px; |
644 | + padding: 10px 10px 10px; |
645 | + background-color: #f7f7f7; |
646 | +} |
647 | +.container-tweet .tweet-follow { |
648 | + margin-top: 10px; |
649 | + margin-bottom: -10px; |
650 | + padding-left: 55px; |
651 | + padding-bottom: 6px; |
652 | + background: url("../img/tweet-follow.png") 0 5px no-repeat; |
653 | + display: block; |
654 | +} |
655 | +.container-tweet .tweet-follow span { |
656 | + font-size: 16px; |
657 | + font-weight: bold; |
658 | + line-height: 1.2; |
659 | + display: block; |
660 | +} |
661 | +.tweet a { |
662 | + display: inline; |
663 | +} |
664 | +.tweet .tweet_text { |
665 | + padding: 10px; |
666 | + background-color: #fff; |
667 | + -moz-border-radius: 4px 4px 4px 4px; |
668 | + -webkit-border-radius: 4px 4px 4px 4px; |
669 | + border-radius: 4px 4px 4px 4px; |
670 | + border: 1px solid #dd4814; |
671 | + font-size: 16px; |
672 | + display: block; |
673 | + clear: both; |
674 | +} |
675 | +.tweet.tweet-small .tweet_text { |
676 | + font-size: inherit; |
677 | +} |
678 | +.tweet .tweet_text a { |
679 | + color: #333; |
680 | +} |
681 | +.tweet .tweet_time, |
682 | +.tweet .tweet_user_and_time { |
683 | + padding: 15px 0 10px 0; |
684 | + position: relative; |
685 | + top: -2px; |
686 | + background: url("../img/tweet-arrow.png") no-repeat; |
687 | + display: block; |
688 | +} |
689 | +.tweet .tweet_odd .tweet_time, |
690 | +.tweet .tweet_odd .tweet_user_and_time { |
691 | + background-position: right 0; |
692 | + float: right; |
693 | +} |
694 | +.tweet .tweet_even .tweet_time, |
695 | +.tweet .tweet_even .tweet_user_and_time { |
696 | + background-position: left 0; |
697 | + float: left; |
698 | +} |
699 | + |
700 | +/* Search */ |
701 | + |
702 | +#content .list-search li { |
703 | + list-style-type:none; |
704 | + border:0px; |
705 | + margin-bottom: 15px; |
706 | + padding-top: 15px; |
707 | +} |
708 | + |
709 | +/* Blog */ |
710 | + |
711 | +.blog-article #nav-single { |
712 | + margin-top: 30px; |
713 | + margin-bottom: 30px; |
714 | +} |
715 | +.blog-article #nav-single .nav-next { |
716 | + float: right; |
717 | +} |
718 | +.blog-article article header .entry-meta { |
719 | + margin-bottom: 20px; |
720 | +} |
721 | +.blog-article article .entry-meta { |
722 | + color: #999; |
723 | +} |
724 | +.blog-article #respond form input[type="submit"] { |
725 | + float: left; |
726 | + cursor: pointer; |
727 | + margin-bottom: 20px; |
728 | + padding: 8px 12px; |
729 | + display: block; |
730 | + background-color: #dd4814; |
731 | + color: #fff; |
732 | + -moz-border-radius: 20px; |
733 | + -webkit-border-radius: 20px; |
734 | + border-radius: 20px; |
735 | + font-size: 16px; |
736 | + line-height: 1.3; |
737 | + border-top: 3px solid #e6633a; |
738 | + border-left: 3px solid #e6633a; |
739 | + border-right: 3px solid #e6633a; |
740 | + border-bottom: 3px solid #c03d14; |
741 | +} |
742 | +.blog-article #respond form input[type="submit"]:active { |
743 | + position: relative; |
744 | + top: 1px; |
745 | +} |
746 | + |
747 | +.alignnone{ |
748 | + float:left; |
749 | + margin:10px 20px 10px 0; |
750 | +} |
751 | +.alignleft{ |
752 | + float:left; |
753 | + margin:10px 20px 10px 0; |
754 | +} |
755 | +.alignright{ |
756 | + float:right; |
757 | + margin:10px 0 10px 20px; |
758 | +} |
759 | + |
760 | +.aligncenter{ |
761 | + float:left; |
762 | + margin:10px 20px 10px 0; |
763 | +} |
764 | +.entry-content h2, .entry-content h3{ |
765 | + margin-top:20px; |
766 | +} |
767 | +.entry-content ul li{ |
768 | + list-style-type: circle; |
769 | + margin-left:16px; |
770 | +} |
771 | + |
772 | +.entry-content hr{ |
773 | + border:none; |
774 | + border-top: 1px dotted #AEA79F; |
775 | +} |
776 | |
777 | === added file 'doc/css/breadcrumbs.js' |
778 | --- doc/css/breadcrumbs.js 1970-01-01 00:00:00 +0000 |
779 | +++ doc/css/breadcrumbs.js 2015-09-23 12:41:07 +0000 |
780 | @@ -0,0 +1,21 @@ |
781 | +/* |
782 | + * Copyright 2013 Canonical Ltd. |
783 | + * |
784 | + * This program is free software; you can redistribute it and/or modify |
785 | + * it under the terms of the GNU Lesser General Public License as published by |
786 | + * the Free Software Foundation; version 3. |
787 | + * |
788 | + * This program is distributed in the hope that it will be useful, |
789 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
790 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
791 | + * GNU Lesser General Public License for more details. |
792 | + * |
793 | + * You should have received a copy of the GNU Lesser General Public License |
794 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
795 | + */ |
796 | + |
797 | +$(document).ready(function(){ |
798 | + var ul = $("ul.breadcrumb"); |
799 | + var li = ul.children("li:has(a)").remove(); |
800 | + ul.prepend(li); |
801 | +}); |
802 | |
803 | === added file 'doc/css/custom.css' |
804 | --- doc/css/custom.css 1970-01-01 00:00:00 +0000 |
805 | +++ doc/css/custom.css 2015-09-23 12:41:07 +0000 |
806 | @@ -0,0 +1,11 @@ |
807 | +li#buildversion { |
808 | + display: none; |
809 | +} |
810 | + |
811 | +div.toc { |
812 | + display: none; |
813 | +} |
814 | + |
815 | +span.type a:visited { |
816 | + color: #dd4814; |
817 | +} |
818 | |
819 | === added file 'doc/css/qtquick.css' |
820 | --- doc/css/qtquick.css 1970-01-01 00:00:00 +0000 |
821 | +++ doc/css/qtquick.css 2015-09-23 12:41:07 +0000 |
822 | @@ -0,0 +1,788 @@ |
823 | +/* |
824 | + * Copyright 2013 Canonical Ltd. |
825 | + * |
826 | + * This program is free software; you can redistribute it and/or modify |
827 | + * it under the terms of the GNU Lesser General Public License as published by |
828 | + * the Free Software Foundation; version 3. |
829 | + * |
830 | + * This program is distributed in the hope that it will be useful, |
831 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
832 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
833 | + * GNU Lesser General Public License for more details. |
834 | + * |
835 | + * You should have received a copy of the GNU Lesser General Public License |
836 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
837 | + */ |
838 | + |
839 | +@media screen |
840 | +{ |
841 | + |
842 | +/* basic elements */ |
843 | + html |
844 | + { |
845 | + color: #000000; |
846 | + background: #FFFFFF; |
847 | + } |
848 | + table |
849 | + { |
850 | + border-collapse: collapse; |
851 | + border-spacing: 0; |
852 | + } |
853 | + fieldset, img |
854 | + { |
855 | + border: 0; |
856 | + max-width:100%; |
857 | + } |
858 | + address, caption, cite, code, dfn, em, strong, th, var, optgroup |
859 | + { |
860 | + font-style: inherit; |
861 | + font-weight: inherit; |
862 | + } |
863 | + del, ins |
864 | + { |
865 | + text-decoration: none; |
866 | + } |
867 | + ol li |
868 | + { |
869 | + list-style: decimal; |
870 | + } |
871 | + ul li |
872 | + { |
873 | + list-style: none; |
874 | + } |
875 | + caption, th |
876 | + { |
877 | + text-align: left; |
878 | + } |
879 | + h1.title |
880 | + { |
881 | + font-weight: bold; |
882 | + font-size: 150%; |
883 | + } |
884 | + h0 |
885 | + { |
886 | + font-weight: bold; |
887 | + font-size: 130%; |
888 | + } |
889 | + h1, h2, h3, h4, h5, h6 |
890 | + { |
891 | + font-size: 100%; |
892 | + } |
893 | + q:before, q:after |
894 | + { |
895 | + content: ''; |
896 | + } |
897 | + abbr, acronym |
898 | + { |
899 | + border: 0; |
900 | + font-variant: normal; |
901 | + } |
902 | + sup, sub |
903 | + { |
904 | + vertical-align: baseline; |
905 | + } |
906 | + tt, .qmlreadonly span, .qmldefault span |
907 | + { |
908 | + word-spacing:0.5em; |
909 | + } |
910 | + legend |
911 | + { |
912 | + color: #000000; |
913 | + } |
914 | + strong |
915 | + { |
916 | + font-weight: bold; |
917 | + } |
918 | + em |
919 | + { |
920 | + font-style: italic; |
921 | + } |
922 | + |
923 | + body |
924 | + { |
925 | + margin: 0 1.5em 0 1.5em; |
926 | + font-family: ubuntu; |
927 | + line-height: normal |
928 | + } |
929 | + a |
930 | + { |
931 | + color: #00732F; |
932 | + text-decoration: none; |
933 | + } |
934 | + hr |
935 | + { |
936 | + background-color: #E6E6E6; |
937 | + border: 1px solid #E6E6E6; |
938 | + height: 1px; |
939 | + width: 100%; |
940 | + text-align: left; |
941 | + margin: 1.5em 0 1.5em 0; |
942 | + } |
943 | + |
944 | + pre |
945 | + { |
946 | + border: 1px solid #DDDDDD; |
947 | + -moz-border-radius: 0.7em 0.7em 0.7em 0.7em; |
948 | + -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em; |
949 | + border-radius: 0.7em 0.7em 0.7em 0.7em; |
950 | + padding: 1em 1em 1em 1em; |
951 | + overflow-x: auto; |
952 | + } |
953 | + table, pre |
954 | + { |
955 | + -moz-border-radius: 0.7em 0.7em 0.7em 0.7em; |
956 | + -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em; |
957 | + border-radius: 0.7em 0.7em 0.7em 0.7em; |
958 | + background-color: #F6F6F6; |
959 | + border: 1px solid #E6E6E6; |
960 | + border-collapse: separate; |
961 | + margin-bottom: 2.5em; |
962 | + } |
963 | + pre { |
964 | + font-size: 90%; |
965 | + display: block; |
966 | + overflow:hidden; |
967 | + } |
968 | + thead |
969 | + { |
970 | + margin-top: 0.5em; |
971 | + font-weight: bold |
972 | + } |
973 | + th |
974 | + { |
975 | + padding: 0.5em 1.5em 0.5em 1em; |
976 | + background-color: #E1E1E1; |
977 | + border-left: 1px solid #E6E6E6; |
978 | + } |
979 | + td |
980 | + { |
981 | + padding: 0.25em 1.5em 0.25em 1em; |
982 | + } |
983 | + |
984 | + td.rightAlign |
985 | + { |
986 | + padding: 0.25em 0.5em 0.25em 1em; |
987 | + } |
988 | + table tr.odd |
989 | + { |
990 | + border-left: 1px solid #E6E6E6; |
991 | + background-color: #F6F6F6; |
992 | + color: black; |
993 | + } |
994 | + table tr.even |
995 | + { |
996 | + border-left: 1px solid #E6E6E6; |
997 | + background-color: #ffffff; |
998 | + color: #202020; |
999 | + } |
1000 | + |
1001 | + div.float-left |
1002 | + { |
1003 | + float: left; margin-right: 2em |
1004 | + } |
1005 | + div.float-right |
1006 | + { |
1007 | + float: right; margin-left: 2em |
1008 | + } |
1009 | + |
1010 | + span.comment |
1011 | + { |
1012 | + color: #008B00; |
1013 | + } |
1014 | + span.string, span.char |
1015 | + { |
1016 | + color: #000084; |
1017 | + } |
1018 | + span.number |
1019 | + { |
1020 | + color: #a46200; |
1021 | + } |
1022 | + span.operator |
1023 | + { |
1024 | + color: #202020; |
1025 | + } |
1026 | + span.keyword |
1027 | + { |
1028 | + color: #840000; |
1029 | + } |
1030 | + span.name |
1031 | + { |
1032 | + color: black |
1033 | + } |
1034 | + span.type |
1035 | + { |
1036 | + font-weight: bold |
1037 | + } |
1038 | + span.type a:visited |
1039 | + { |
1040 | + color: #0F5300; |
1041 | + } |
1042 | + span.preprocessor |
1043 | + { |
1044 | + color: #404040 |
1045 | + } |
1046 | +/* end basic elements */ |
1047 | + |
1048 | +/* font style elements */ |
1049 | + .heading |
1050 | + { |
1051 | + font-weight: bold; |
1052 | + font-size: 125%; |
1053 | + } |
1054 | + .subtitle |
1055 | + { |
1056 | + font-size: 110% |
1057 | + } |
1058 | + .small-subtitle |
1059 | + { |
1060 | + font-size: 100% |
1061 | + } |
1062 | + .red |
1063 | + { |
1064 | + color:red; |
1065 | + } |
1066 | +/* end font style elements */ |
1067 | + |
1068 | +/* global settings*/ |
1069 | + .header, .footer |
1070 | + { |
1071 | + display: block; |
1072 | + clear: both; |
1073 | + overflow: hidden; |
1074 | + } |
1075 | +/* end global settings*/ |
1076 | + |
1077 | +/* header elements */ |
1078 | + .header .qtref |
1079 | + { |
1080 | + color: #00732F; |
1081 | + font-weight: bold; |
1082 | + font-size: 130%; |
1083 | + } |
1084 | + |
1085 | + .header .content |
1086 | + { |
1087 | + margin-left: 5px; |
1088 | + margin-top: 5px; |
1089 | + margin-bottom: 0.5em; |
1090 | + } |
1091 | + |
1092 | + .header .breadcrumb |
1093 | + { |
1094 | + font-size: 90%; |
1095 | + padding: 0.5em 0 0.5em 1em; |
1096 | + margin: 0; |
1097 | + background-color: #fafafa; |
1098 | + height: 1.35em; |
1099 | + border-bottom: 1px solid #d1d1d1; |
1100 | + } |
1101 | + |
1102 | + .header .breadcrumb ul |
1103 | + { |
1104 | + margin: 0; |
1105 | + padding: 0; |
1106 | + } |
1107 | + |
1108 | + .header .content |
1109 | + { |
1110 | + word-wrap: break-word; |
1111 | + } |
1112 | + |
1113 | + .header .breadcrumb ul li |
1114 | + { |
1115 | + float: left; |
1116 | + background: url(../images/breadcrumb.png) no-repeat 0 3px; |
1117 | + padding-left: 1.5em; |
1118 | + margin-left: 1.5em; |
1119 | + } |
1120 | + |
1121 | + .header .breadcrumb ul li.last |
1122 | + { |
1123 | + font-weight: normal; |
1124 | + } |
1125 | + |
1126 | + .header .breadcrumb ul li a |
1127 | + { |
1128 | + color: #00732F; |
1129 | + } |
1130 | + |
1131 | + .header .breadcrumb ul li.first |
1132 | + { |
1133 | + background-image: none; |
1134 | + padding-left: 0; |
1135 | + margin-left: 0; |
1136 | + } |
1137 | + |
1138 | + .header .content ol li { |
1139 | + background: none; |
1140 | + margin-bottom: 1.0em; |
1141 | + margin-left: 1.2em; |
1142 | + padding-left: 0 |
1143 | + } |
1144 | + |
1145 | + .header .content li |
1146 | + { |
1147 | + background: url(../images/bullet_sq.png) no-repeat 0 5px; |
1148 | + margin-bottom: 1em; |
1149 | + padding-left: 1.2em; |
1150 | + } |
1151 | + |
1152 | +/* end header elements */ |
1153 | + |
1154 | +/* content elements */ |
1155 | + .content h1 |
1156 | + { |
1157 | + font-weight: bold; |
1158 | + font-size: 130% |
1159 | + } |
1160 | + |
1161 | + .content h2 |
1162 | + { |
1163 | + font-weight: bold; |
1164 | + font-size: 120%; |
1165 | + width: 100%; |
1166 | + } |
1167 | + .content h3 |
1168 | + { |
1169 | + font-weight: bold; |
1170 | + font-size: 110%; |
1171 | + width: 100%; |
1172 | + } |
1173 | + .content table p |
1174 | + { |
1175 | + margin: 0 |
1176 | + } |
1177 | + .content ul |
1178 | + { |
1179 | + padding-left: 2.5em; |
1180 | + } |
1181 | + .content li |
1182 | + { |
1183 | + padding-top: 0.25em; |
1184 | + padding-bottom: 0.25em; |
1185 | + } |
1186 | + .content ul img { |
1187 | + vertical-align: middle; |
1188 | + } |
1189 | + |
1190 | + .content a:visited |
1191 | + { |
1192 | + color: #4c0033; |
1193 | + text-decoration: none; |
1194 | + } |
1195 | + |
1196 | + .content a:visited:hover |
1197 | + { |
1198 | + color: #4c0033; |
1199 | + text-decoration: underline; |
1200 | + } |
1201 | + |
1202 | + a:hover |
1203 | + { |
1204 | + color: #4c0033; |
1205 | + text-decoration: underline; |
1206 | + } |
1207 | + descr p a |
1208 | + { |
1209 | + text-decoration: underline; |
1210 | + } |
1211 | + |
1212 | + .descr p a:visited |
1213 | + { |
1214 | + text-decoration: underline; |
1215 | + } |
1216 | + |
1217 | + .alphaChar{ |
1218 | + width:95%; |
1219 | + background-color:#F6F6F6; |
1220 | + border:1px solid #E6E6E6; |
1221 | + -moz-border-radius: 7px 7px 7px 7px; |
1222 | + border-radius: 7px 7px 7px 7px; |
1223 | + -webkit-border-radius: 7px 7px 7px 7px; |
1224 | + font-size:12pt; |
1225 | + padding-left:10px; |
1226 | + margin-top:10px; |
1227 | + margin-bottom:10px; |
1228 | + } |
1229 | + .flowList{ |
1230 | + /*vertical-align:top;*/ |
1231 | + /*margin:20px auto;*/ |
1232 | + |
1233 | + column-count:3; |
1234 | + -webkit-column-count:3; |
1235 | + -moz-column-count:3; |
1236 | +/* |
1237 | + column-width:100%; |
1238 | + -webkit-column-width:200px; |
1239 | + -col-column-width:200px; |
1240 | +*/ |
1241 | + column-gap:41px; |
1242 | + -webkit-column-gap:41px; |
1243 | + -moz-column-gap:41px; |
1244 | + |
1245 | + column-rule: 1px dashed #ccc; |
1246 | + -webkit-column-rule: 1px dashed #ccc; |
1247 | + -moz-column-rule: 1px dashed #ccc; |
1248 | + } |
1249 | + |
1250 | + .flowList dl{ |
1251 | + } |
1252 | + .flowList dd{ |
1253 | + /*display:inline-block;*/ |
1254 | + margin-left:10px; |
1255 | + min-width:250px; |
1256 | + line-height: 1.5; |
1257 | + min-width:100%; |
1258 | + min-height:15px; |
1259 | + } |
1260 | + |
1261 | + .flowList dd a{ |
1262 | + } |
1263 | + |
1264 | + .mainContent |
1265 | + { |
1266 | + padding-left:5px; |
1267 | + } |
1268 | + |
1269 | + .content .flowList p{ |
1270 | + padding:0px; |
1271 | + } |
1272 | + |
1273 | + .content .alignedsummary |
1274 | + { |
1275 | + margin: 15px; |
1276 | + } |
1277 | + |
1278 | + |
1279 | + .qmltype |
1280 | + { |
1281 | + text-align: center; |
1282 | + font-size: 120%; |
1283 | + } |
1284 | + .qmlreadonly |
1285 | + { |
1286 | + padding-left: 5px; |
1287 | + float: right; |
1288 | + color: #254117; |
1289 | + } |
1290 | + |
1291 | + .qmldefault |
1292 | + { |
1293 | + padding-left: 5px; |
1294 | + float: right; |
1295 | + color: red; |
1296 | + } |
1297 | + |
1298 | + .qmldoc |
1299 | + { |
1300 | + } |
1301 | + |
1302 | + .generic .alphaChar{ |
1303 | + margin-top:5px; |
1304 | + } |
1305 | + |
1306 | + .generic .odd .alphaChar{ |
1307 | + background-color: #F6F6F6; |
1308 | + } |
1309 | + |
1310 | + .generic .even .alphaChar{ |
1311 | + background-color: #FFFFFF; |
1312 | + } |
1313 | + |
1314 | + .memItemRight{ |
1315 | + padding: 0.25em 1.5em 0.25em 0; |
1316 | + } |
1317 | + .highlightedCode |
1318 | + { |
1319 | + margin: 1.0em; |
1320 | + } |
1321 | + .annotated td { |
1322 | + padding: 0.25em 0.5em 0.25em 0.5em; |
1323 | + } |
1324 | + |
1325 | + .toc |
1326 | + { |
1327 | + font-size: 80% |
1328 | + } |
1329 | + |
1330 | + .header .content .toc ul |
1331 | + { |
1332 | + padding-left: 0px; |
1333 | + } |
1334 | + |
1335 | + .content .toc h3 { |
1336 | + border-bottom: 0px; |
1337 | + margin-top: 0px; |
1338 | + } |
1339 | + |
1340 | + .content .toc h3 a:hover { |
1341 | + color: #00732F; |
1342 | + text-decoration: none; |
1343 | + } |
1344 | + |
1345 | + .content .toc .level2 |
1346 | + { |
1347 | + margin-left: 1.5em; |
1348 | + } |
1349 | + |
1350 | + .content .toc .level3 |
1351 | + { |
1352 | + margin-left: 3.0em; |
1353 | + } |
1354 | + |
1355 | + .content ul li |
1356 | + { |
1357 | + background: url(../images/bullet_sq.png) no-repeat 0 0.7em; |
1358 | + padding-left: 1em |
1359 | + } |
1360 | + |
1361 | + .content .toc li |
1362 | + { |
1363 | + background: url(../images/bullet_dn.png) no-repeat 0 5px; |
1364 | + padding-left: 1em |
1365 | + } |
1366 | + |
1367 | + .relpage |
1368 | + { |
1369 | + -moz-border-radius: 7px 7px 7px 7px; |
1370 | + -webkit-border-radius: 7px 7px 7px 7px; |
1371 | + border-radius: 7px 7px 7px 7px; |
1372 | + border: 1px solid #DDDDDD; |
1373 | + padding: 25px 25px; |
1374 | + clear: both; |
1375 | + } |
1376 | + .relpage ul |
1377 | + { |
1378 | + float: none; |
1379 | + padding: 1.5em; |
1380 | + } |
1381 | + |
1382 | + h3.fn, span.fn |
1383 | + { |
1384 | + -moz-border-radius:7px 7px 7px 7px; |
1385 | + -webkit-border-radius:7px 7px 7px 7px; |
1386 | + border-radius:7px 7px 7px 7px; |
1387 | + background-color: #F6F6F6; |
1388 | + border-width: 1px; |
1389 | + border-style: solid; |
1390 | + border-color: #E6E6E6; |
1391 | + font-weight: bold; |
1392 | + word-spacing:3px; |
1393 | + padding:3px 5px; |
1394 | + } |
1395 | + |
1396 | + .functionIndex { |
1397 | + font-size:12pt; |
1398 | + word-spacing:10px; |
1399 | + margin-bottom:10px; |
1400 | + background-color: #F6F6F6; |
1401 | + border-width: 1px; |
1402 | + border-style: solid; |
1403 | + border-color: #E6E6E6; |
1404 | + -moz-border-radius: 7px 7px 7px 7px; |
1405 | + -webkit-border-radius: 7px 7px 7px 7px; |
1406 | + border-radius: 7px 7px 7px 7px; |
1407 | + width:100%; |
1408 | + } |
1409 | + |
1410 | + .centerAlign |
1411 | + { |
1412 | + text-align:center; |
1413 | + } |
1414 | + |
1415 | + .rightAlign |
1416 | + { |
1417 | + text-align:right; |
1418 | + } |
1419 | + |
1420 | + .leftAlign |
1421 | + { |
1422 | + text-align:left; |
1423 | + } |
1424 | + |
1425 | + .topAlign{ |
1426 | + vertical-align:top |
1427 | + } |
1428 | + |
1429 | + .functionIndex a{ |
1430 | + display:inline-block; |
1431 | + } |
1432 | + |
1433 | +/* end content elements */ |
1434 | +/* footer elements */ |
1435 | + |
1436 | + .footer |
1437 | + { |
1438 | + color: #393735; |
1439 | + font-size: 0.75em; |
1440 | + text-align: center; |
1441 | + padding-top: 1.5em; |
1442 | + padding-bottom: 1em; |
1443 | + background-color: #E6E7E8; |
1444 | + margin: 0; |
1445 | + } |
1446 | + .footer p |
1447 | + { |
1448 | + margin: 0.25em |
1449 | + } |
1450 | + .small |
1451 | + { |
1452 | + font-size: 0.5em; |
1453 | + } |
1454 | +/* end footer elements */ |
1455 | + |
1456 | + .item { |
1457 | + float: left; |
1458 | + position: relative; |
1459 | + width: 100%; |
1460 | + overflow: hidden; |
1461 | + } |
1462 | + |
1463 | + |
1464 | + .item .primary { |
1465 | + margin-right: 220px; |
1466 | + position: relative; |
1467 | + } |
1468 | + |
1469 | + .item hr { |
1470 | + margin-left: -220px; |
1471 | + } |
1472 | + |
1473 | + .item .secondary { |
1474 | + float: right; |
1475 | + width: 200px; |
1476 | + position: relative; |
1477 | + } |
1478 | + |
1479 | + .item .cols { |
1480 | + clear: both; |
1481 | + display: block; |
1482 | + } |
1483 | + |
1484 | + .item .cols .col { |
1485 | + float: left; |
1486 | + margin-left: 1.5%; |
1487 | + } |
1488 | + |
1489 | + .item .cols .col.first { |
1490 | + margin-left: 0; |
1491 | + } |
1492 | + |
1493 | + .item .cols.two .col { |
1494 | + width: 45%; |
1495 | + } |
1496 | + |
1497 | + .item .box { |
1498 | + margin: 0 0 10px 0; |
1499 | + } |
1500 | + |
1501 | + .item .box h3 { |
1502 | + margin: 0 0 10px 0; |
1503 | + } |
1504 | + |
1505 | + .cols.unclear { |
1506 | + clear:none; |
1507 | + } |
1508 | +} |
1509 | + |
1510 | +/* end of screen media */ |
1511 | + |
1512 | +/* start of print media */ |
1513 | + |
1514 | +@media print |
1515 | +{ |
1516 | + input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft, #feedbackBox, #blurpage, .toc, .breadcrumb, .toolbar, .floatingResult |
1517 | + { |
1518 | + display: none; |
1519 | + background: none; |
1520 | + } |
1521 | + .content |
1522 | + { |
1523 | + background: none; |
1524 | + display: block; |
1525 | + width: 100%; margin: 0; float: none; |
1526 | + } |
1527 | +} |
1528 | +/* end of print media */ |
1529 | + |
1530 | + |
1531 | +/* modify the TOC layouts */ |
1532 | +div.toc ul { |
1533 | + padding-left: 20px; |
1534 | +} |
1535 | +div.toc li { |
1536 | + padding-left: 4px; |
1537 | +} |
1538 | +/* Remove the border around images*/ |
1539 | +a img |
1540 | +{ |
1541 | + border:none; |
1542 | +} |
1543 | + |
1544 | +/*Add styling to the front pages*/ |
1545 | + |
1546 | +.threecolumn_area |
1547 | +{ |
1548 | + padding-top: 20px; |
1549 | + padding-bottom: 20px; |
1550 | +} |
1551 | +.threecolumn_piece |
1552 | +{ |
1553 | + display: inline-block; |
1554 | + margin-left: 78px; |
1555 | + margin-top: 8px; |
1556 | + padding: 0; |
1557 | + vertical-align: top; |
1558 | + width: 25.5%; |
1559 | +} |
1560 | +div.threecolumn_piece ul { |
1561 | + list-style-type: none; |
1562 | + padding-left: 0px; |
1563 | + margin-top: 2px; |
1564 | +} |
1565 | +div.threecolumn_piece p { |
1566 | + margin-bottom: 7px; |
1567 | + color: #5C626E; |
1568 | + text-decoration: none; |
1569 | + font-weight: bold; |
1570 | +} |
1571 | +div.threecolumn_piece li { |
1572 | + padding-left: 0px; |
1573 | + margin-bottom: 5px; |
1574 | +} |
1575 | +div.threecolumn_piece a { |
1576 | + font-weight: normal; |
1577 | +} |
1578 | +/* Add style to guide page*/ |
1579 | +.fourcolumn_area |
1580 | +{ |
1581 | + padding-top: 20px; |
1582 | + padding-bottom: 20px; |
1583 | +} |
1584 | +.fourcolumn_piece |
1585 | +{ |
1586 | + display: inline-block; |
1587 | + margin-left: 35px; |
1588 | + margin-top: 8px; |
1589 | + padding: 0; |
1590 | + vertical-align: top; |
1591 | + width: 21.3%; |
1592 | +} |
1593 | +div.fourcolumn_piece ul { |
1594 | + list-style-type: none; |
1595 | + padding-left: 0px; |
1596 | + margin-top: 2px; |
1597 | +} |
1598 | +div.fourcolumn_piece p { |
1599 | + margin-bottom: 7px; |
1600 | + color: #40444D; |
1601 | + text-decoration: none; |
1602 | + font-weight: bold; |
1603 | +} |
1604 | +div.fourcolumn_piece li { |
1605 | + padding-left: 0px; |
1606 | + margin-bottom: 5px; |
1607 | +} |
1608 | +div.fourcolumn_piece a { |
1609 | + font-weight: normal; |
1610 | +} |
1611 | |
1612 | === added file 'doc/css/reset.css' |
1613 | --- doc/css/reset.css 1970-01-01 00:00:00 +0000 |
1614 | +++ doc/css/reset.css 2015-09-23 12:41:07 +0000 |
1615 | @@ -0,0 +1,8 @@ |
1616 | +/* |
1617 | +Copyright (c) 2010, Yahoo! Inc. All rights reserved. |
1618 | +Code licensed under the BSD License: |
1619 | +http://developer.yahoo.com/yui/license.html |
1620 | +version: 3.3.0 |
1621 | +build: 3167 |
1622 | +*/ |
1623 | +html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;} |
1624 | \ No newline at end of file |
1625 | |
1626 | === added file 'doc/css/scratch.css' |
1627 | --- doc/css/scratch.css 1970-01-01 00:00:00 +0000 |
1628 | +++ doc/css/scratch.css 2015-09-23 12:41:07 +0000 |
1629 | @@ -0,0 +1,104 @@ |
1630 | +/* |
1631 | + * Copyright 2013 Canonical Ltd. |
1632 | + * |
1633 | + * This program is free software; you can redistribute it and/or modify |
1634 | + * it under the terms of the GNU Lesser General Public License as published by |
1635 | + * the Free Software Foundation; version 3. |
1636 | + * |
1637 | + * This program is distributed in the hope that it will be useful, |
1638 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1639 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1640 | + * GNU Lesser General Public License for more details. |
1641 | + * |
1642 | + * You should have received a copy of the GNU Lesser General Public License |
1643 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1644 | + */ |
1645 | + |
1646 | +body { |
1647 | + margin: 0; |
1648 | +} |
1649 | +div.toc ul { |
1650 | + padding: 0; |
1651 | +} |
1652 | +div.toc li { |
1653 | + margin-bottom: 3px; |
1654 | +} |
1655 | +h1.title { |
1656 | + font-size: 36px; |
1657 | + line-height: 1.1; |
1658 | + font-weight: normal; |
1659 | +} |
1660 | +h0, h2 { |
1661 | + font-size: 24px; |
1662 | + line-height: 1.2; |
1663 | + margin: 14px 0; |
1664 | + font-weight: normal; |
1665 | + display: block; |
1666 | +} |
1667 | +a:hover { |
1668 | + color: #dd4814; |
1669 | + text-decoration: underline; |
1670 | + outline: 0; |
1671 | +} |
1672 | +table, pre { |
1673 | + border-radius: 0; |
1674 | + white-space: pre-wrap; |
1675 | +} |
1676 | +.annotated td { |
1677 | + padding: 0.8em 1em 0.3em; |
1678 | +} |
1679 | +.wrapper { |
1680 | + width: 940px; |
1681 | + margin: 0 auto; |
1682 | +} |
1683 | +.main-content { |
1684 | + width: 668px; |
1685 | + position: relative; |
1686 | + left: 270px; |
1687 | +} |
1688 | +.title { |
1689 | + margin-left: -270px; |
1690 | + margin-top: 30px; |
1691 | + margin-bottom: 50px; |
1692 | +} |
1693 | +.toc { |
1694 | + margin-left: -270px; |
1695 | + font-size: 100%; |
1696 | + margin-bottom: 40px; |
1697 | + padding: 0; |
1698 | + z-index: 2; |
1699 | + position: absolute; |
1700 | + top: 100px; |
1701 | + width: 250px; |
1702 | +} |
1703 | +.breadcrumb { |
1704 | + position: relative; |
1705 | + left: -270px; |
1706 | + top: 30px; |
1707 | + width: auto; |
1708 | + padding-bottom: 30px; |
1709 | + margin-bottom: 30px; |
1710 | + float:left; |
1711 | +} |
1712 | +.breadcrumb li { |
1713 | + float: left; |
1714 | + margin-right: 8px; |
1715 | +} |
1716 | +.breadcrumb a:link, |
1717 | +.breadcrumb a:visited { |
1718 | + color: #AEA79F; |
1719 | +} |
1720 | +.breadcrumb a:after { |
1721 | + content: '\0000a0\0000a0 >'; |
1722 | +} |
1723 | +.title { |
1724 | + margin-top: 50px; |
1725 | + clear:both; |
1726 | +} |
1727 | +.breadcrumb + .toc { |
1728 | + top: 170px; |
1729 | +} |
1730 | +.breadcrumb p { |
1731 | + display: inline; |
1732 | +} |
1733 | + |
1734 | |
1735 | === added file 'doc/ubuntu-onlineaccounts2.qdocconf' |
1736 | --- doc/ubuntu-onlineaccounts2.qdocconf 1970-01-01 00:00:00 +0000 |
1737 | +++ doc/ubuntu-onlineaccounts2.qdocconf 2015-09-23 12:41:07 +0000 |
1738 | @@ -0,0 +1,21 @@ |
1739 | +project = UbuntuOnlineAccounts2 |
1740 | +description = Ubuntu.OnlineAccounts 2.0 module documentation |
1741 | +sourcedirs = ./ ../src/lib/Ubuntu/OnlineAccounts.2/ |
1742 | +sources.fileextensions = "*.qdoc *.cpp" |
1743 | +outputdir = html |
1744 | +outputformats = HTML |
1745 | +version = 0.2 |
1746 | +syntaxhightlighting = true |
1747 | +sourceencoding = UTF-8 |
1748 | +outputencoding = UTF-8 |
1749 | + |
1750 | +HTML.nonavigationbar = "true" |
1751 | +HTML.stylesheets = \ |
1752 | + css/base.css \ |
1753 | + css/qtquick.css \ |
1754 | + css/reset.css \ |
1755 | + css/scratch.css |
1756 | +HTML.headerstyles = \ |
1757 | + "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/reset.css\" />\n" \ |
1758 | + "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/qtquick.css\" />\n" \ |
1759 | + "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/base.css\" />\n" |
1760 | |
1761 | === added file 'src/daemon/CMakeLists.txt' |
1762 | --- src/daemon/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
1763 | +++ src/daemon/CMakeLists.txt 2015-09-23 12:41:07 +0000 |
1764 | @@ -0,0 +1,27 @@ |
1765 | +project(accountd) |
1766 | + |
1767 | +set(ACCOUNTD accountd) |
1768 | + |
1769 | +include_directories(. |
1770 | + ${OnlineAccountsDaemon_SOURCE_DIR}/.. |
1771 | +) |
1772 | + |
1773 | +add_executable(${ACCOUNTD} |
1774 | + inactivity_timer.cpp |
1775 | + main.cpp |
1776 | +) |
1777 | +qt5_use_modules(${ACCOUNTD} DBus) |
1778 | +target_link_libraries(${ACCOUNTD} |
1779 | + OnlineAccountsDaemon |
1780 | +) |
1781 | +set_target_properties(${ACCOUNTD} PROPERTIES AUTOMOC TRUE) |
1782 | + |
1783 | +install(TARGETS ${ACCOUNTD} |
1784 | + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
1785 | +) |
1786 | + |
1787 | +set(SERVICE_FILE com.ubuntu.OnlineAccounts.Manager.service) |
1788 | +configure_file(${SERVICE_FILE}.in ${SERVICE_FILE}) |
1789 | +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_FILE} |
1790 | + DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services |
1791 | +) |
1792 | |
1793 | === modified file 'src/daemon/main.cpp' |
1794 | --- src/daemon/main.cpp 2015-07-10 11:33:58 +0000 |
1795 | +++ src/daemon/main.cpp 2015-09-23 12:41:07 +0000 |
1796 | @@ -22,7 +22,7 @@ |
1797 | #include <QDBusConnection> |
1798 | #include <QProcessEnvironment> |
1799 | #include "inactivity_timer.h" |
1800 | -#include "manager.h" |
1801 | +#include "OnlineAccountsDaemon/Manager" |
1802 | |
1803 | int main(int argc, char **argv) |
1804 | { |
1805 | @@ -42,7 +42,7 @@ |
1806 | daemonTimeout = value; |
1807 | } |
1808 | |
1809 | - auto manager = new OnlineAccountsDaemon::Manager(); |
1810 | + auto manager = (QObject *)oad_create_manager(0); |
1811 | |
1812 | auto inactivityTimer = |
1813 | new OnlineAccountsDaemon::InactivityTimer(daemonTimeout * 1000); |
1814 | |
1815 | === modified file 'src/lib/OnlineAccounts/CMakeLists.txt' |
1816 | --- src/lib/OnlineAccounts/CMakeLists.txt 2015-07-21 09:32:19 +0000 |
1817 | +++ src/lib/OnlineAccounts/CMakeLists.txt 2015-09-23 12:41:07 +0000 |
1818 | @@ -6,6 +6,7 @@ |
1819 | ${OnlineAccountsDaemon_SOURCE_DIR}/.. |
1820 | ) |
1821 | set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined") |
1822 | +set(CMAKE_CXX_VISIBILITY_PRESET hidden) |
1823 | |
1824 | add_library(${CLIENT_LIB} SHARED |
1825 | account.cpp |
1826 | |
1827 | === modified file 'src/lib/OnlineAccounts/account.cpp' |
1828 | --- src/lib/OnlineAccounts/account.cpp 2015-03-04 10:01:32 +0000 |
1829 | +++ src/lib/OnlineAccounts/account.cpp 2015-09-23 12:41:07 +0000 |
1830 | @@ -96,6 +96,12 @@ |
1831 | return d->m_info.authenticationMethod(); |
1832 | } |
1833 | |
1834 | +QStringList Account::keys() const |
1835 | +{ |
1836 | + Q_D(const Account); |
1837 | + return d->m_info.keys(); |
1838 | +} |
1839 | + |
1840 | QVariant Account::setting(const QString &key) const |
1841 | { |
1842 | Q_D(const Account); |
1843 | |
1844 | === modified file 'src/lib/OnlineAccounts/account.h' |
1845 | --- src/lib/OnlineAccounts/account.h 2015-02-27 10:28:50 +0000 |
1846 | +++ src/lib/OnlineAccounts/account.h 2015-09-23 12:41:07 +0000 |
1847 | @@ -48,6 +48,7 @@ |
1848 | QString serviceId() const; |
1849 | AuthenticationMethod authenticationMethod() const; |
1850 | |
1851 | + QStringList keys() const; |
1852 | QVariant setting(const QString &key) const; |
1853 | |
1854 | PendingCall authenticate(const AuthenticationData &authData); |
1855 | |
1856 | === modified file 'src/lib/OnlineAccounts/account_info.h' |
1857 | --- src/lib/OnlineAccounts/account_info.h 2015-05-26 14:23:10 +0000 |
1858 | +++ src/lib/OnlineAccounts/account_info.h 2015-09-23 12:41:07 +0000 |
1859 | @@ -23,7 +23,7 @@ |
1860 | |
1861 | #include <QVariantMap> |
1862 | |
1863 | -#include "daemon/dbus_constants.h" |
1864 | +#include "OnlineAccountsDaemon/dbus_constants.h" |
1865 | #include "global.h" |
1866 | |
1867 | class QDBusArgument; |
1868 | @@ -59,6 +59,15 @@ |
1869 | } |
1870 | } |
1871 | |
1872 | + QStringList keys() const { |
1873 | + QStringList settingKeys; |
1874 | + Q_FOREACH(const QString &key, details.keys()) { |
1875 | + if (key.startsWith(ONLINE_ACCOUNTS_INFO_KEY_SETTINGS)) { |
1876 | + settingKeys.append(key.mid(sizeof(ONLINE_ACCOUNTS_INFO_KEY_SETTINGS) - 1)); |
1877 | + } |
1878 | + } |
1879 | + return settingKeys; |
1880 | + } |
1881 | QVariant setting(const QString &key) const { |
1882 | return details.value(ONLINE_ACCOUNTS_INFO_KEY_SETTINGS + key); |
1883 | } |
1884 | |
1885 | === modified file 'src/lib/OnlineAccounts/authentication_data.cpp' |
1886 | --- src/lib/OnlineAccounts/authentication_data.cpp 2015-05-26 14:23:10 +0000 |
1887 | +++ src/lib/OnlineAccounts/authentication_data.cpp 2015-09-23 12:41:07 +0000 |
1888 | @@ -21,7 +21,7 @@ |
1889 | #include "authentication_data_p.h" |
1890 | |
1891 | #include <QDBusMetaType> |
1892 | -#include "daemon/dbus_constants.h" |
1893 | +#include "OnlineAccountsDaemon/dbus_constants.h" |
1894 | |
1895 | using namespace OnlineAccounts; |
1896 | |
1897 | @@ -32,6 +32,11 @@ |
1898 | { |
1899 | } |
1900 | |
1901 | +AuthenticationData::AuthenticationData(AuthenticationMethod method): |
1902 | + d(new AuthenticationDataPrivate(method)) |
1903 | +{ |
1904 | +} |
1905 | + |
1906 | AuthenticationData::AuthenticationData(AuthenticationDataPrivate *priv): |
1907 | d(priv) |
1908 | { |
1909 | @@ -71,6 +76,16 @@ |
1910 | return d->m_invalidateCachedReply; |
1911 | } |
1912 | |
1913 | +void AuthenticationData::setParameters(const QVariantMap ¶meters) |
1914 | +{ |
1915 | + d->m_parameters = parameters; |
1916 | +} |
1917 | + |
1918 | +QVariantMap AuthenticationData::parameters() const |
1919 | +{ |
1920 | + return d->m_parameters; |
1921 | +} |
1922 | + |
1923 | /* OAuth 2.0 */ |
1924 | |
1925 | OAuth2Data::OAuth2Data(): |
1926 | |
1927 | === modified file 'src/lib/OnlineAccounts/authentication_data.h' |
1928 | --- src/lib/OnlineAccounts/authentication_data.h 2015-03-04 11:36:09 +0000 |
1929 | +++ src/lib/OnlineAccounts/authentication_data.h 2015-09-23 12:41:07 +0000 |
1930 | @@ -37,6 +37,7 @@ |
1931 | class ONLINE_ACCOUNTS_EXPORT AuthenticationData |
1932 | { |
1933 | public: |
1934 | + AuthenticationData(AuthenticationMethod method); |
1935 | AuthenticationData(const AuthenticationData &other); |
1936 | virtual ~AuthenticationData(); |
1937 | |
1938 | @@ -48,6 +49,9 @@ |
1939 | void invalidateCachedReply(); |
1940 | bool mustInvalidateCachedReply() const; |
1941 | |
1942 | + void setParameters(const QVariantMap ¶meters); |
1943 | + QVariantMap parameters() const; |
1944 | + |
1945 | protected: |
1946 | AuthenticationData(AuthenticationDataPrivate *priv); |
1947 | QSharedDataPointer<AuthenticationDataPrivate> d; |
1948 | @@ -55,7 +59,6 @@ |
1949 | private: |
1950 | friend class Manager; |
1951 | friend class ManagerPrivate; |
1952 | - AuthenticationData(); |
1953 | }; |
1954 | |
1955 | class AuthenticationReplyPrivate; |
1956 | @@ -68,6 +71,8 @@ |
1957 | bool hasError() const { return error().isValid(); } |
1958 | Error error() const; |
1959 | |
1960 | + QVariantMap data() const; |
1961 | + |
1962 | protected: |
1963 | AuthenticationReply(AuthenticationReplyPrivate *priv); |
1964 | AuthenticationReplyPrivate *d_ptr; |
1965 | |
1966 | === modified file 'src/lib/OnlineAccounts/authentication_reply.cpp' |
1967 | --- src/lib/OnlineAccounts/authentication_reply.cpp 2015-05-26 14:23:10 +0000 |
1968 | +++ src/lib/OnlineAccounts/authentication_reply.cpp 2015-09-23 12:41:07 +0000 |
1969 | @@ -23,7 +23,7 @@ |
1970 | #include <QDBusArgument> |
1971 | #include <QDBusMessage> |
1972 | #include <QDebug> |
1973 | -#include "daemon/dbus_constants.h" |
1974 | +#include "OnlineAccountsDaemon/dbus_constants.h" |
1975 | #include "error_p.h" |
1976 | #include "pending_call_p.h" |
1977 | |
1978 | @@ -153,6 +153,12 @@ |
1979 | return d->m_error; |
1980 | } |
1981 | |
1982 | +QVariantMap AuthenticationReply::data() const |
1983 | +{ |
1984 | + Q_D(const AuthenticationReply); |
1985 | + return d->data(); |
1986 | +} |
1987 | + |
1988 | /* OAuth 2.0 */ |
1989 | |
1990 | OAuth2Reply::OAuth2Reply(const PendingCall &call): |
1991 | |
1992 | === modified file 'src/lib/OnlineAccounts/error.cpp' |
1993 | --- src/lib/OnlineAccounts/error.cpp 2015-05-26 14:23:10 +0000 |
1994 | +++ src/lib/OnlineAccounts/error.cpp 2015-09-23 12:41:07 +0000 |
1995 | @@ -21,7 +21,7 @@ |
1996 | #include "error_p.h" |
1997 | |
1998 | #include <QDBusError> |
1999 | -#include "daemon/dbus_constants.h" |
2000 | +#include "OnlineAccountsDaemon/dbus_constants.h" |
2001 | |
2002 | namespace OnlineAccounts { |
2003 | |
2004 | |
2005 | === modified file 'src/lib/OnlineAccounts/manager.cpp' |
2006 | --- src/lib/OnlineAccounts/manager.cpp 2015-05-26 14:23:10 +0000 |
2007 | +++ src/lib/OnlineAccounts/manager.cpp 2015-09-23 12:41:07 +0000 |
2008 | @@ -26,7 +26,7 @@ |
2009 | #include <QDebug> |
2010 | #include "account_p.h" |
2011 | #include "authentication_data_p.h" |
2012 | -#include "daemon/dbus_constants.h" |
2013 | +#include "OnlineAccountsDaemon/dbus_constants.h" |
2014 | #include "pending_call_p.h" |
2015 | |
2016 | using namespace OnlineAccounts; |
2017 | |
2018 | === added directory 'src/lib/OnlineAccountsDaemon' |
2019 | === renamed file 'src/daemon/CMakeLists.txt' => 'src/lib/OnlineAccountsDaemon/CMakeLists.txt' |
2020 | --- src/daemon/CMakeLists.txt 2015-07-08 11:13:00 +0000 |
2021 | +++ src/lib/OnlineAccountsDaemon/CMakeLists.txt 2015-09-23 12:41:07 +0000 |
2022 | @@ -4,7 +4,10 @@ |
2023 | pkg_check_modules(OACLIENT OnlineAccountsClient REQUIRED) |
2024 | pkg_check_modules(SIGNONQT libsignon-qt5 REQUIRED) |
2025 | |
2026 | -set(ACCOUNTD accountd) |
2027 | +set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined") |
2028 | +set(CMAKE_CXX_VISIBILITY_PRESET hidden) |
2029 | + |
2030 | +set(ACCOUNTD_LIB OnlineAccountsDaemon) |
2031 | |
2032 | include_directories(. ${CMAKE_CURRENT_BINARY_DIR}) |
2033 | add_definitions( |
2034 | @@ -14,40 +17,37 @@ |
2035 | ${SIGNONQT_CFLAGS} |
2036 | ) |
2037 | |
2038 | -add_executable(${ACCOUNTD} |
2039 | +add_library(${ACCOUNTD_LIB} SHARED |
2040 | access_request.cpp |
2041 | async_operation.cpp |
2042 | authentication_request.cpp |
2043 | authenticator.cpp |
2044 | client_registry.cpp |
2045 | - inactivity_timer.cpp |
2046 | - main.cpp |
2047 | manager.cpp |
2048 | manager_adaptor.cpp |
2049 | state_saver.cpp |
2050 | ) |
2051 | -qt5_use_modules(${ACCOUNTD} DBus) |
2052 | -target_link_libraries(${ACCOUNTD} |
2053 | +#set_target_properties(${ACCOUNTD_LIB} PROPERTIES |
2054 | +# VERSION 1.0.0 |
2055 | +# SOVERSION 1 |
2056 | +#) |
2057 | +qt5_use_modules(${ACCOUNTD_LIB} DBus) |
2058 | +target_link_libraries(${ACCOUNTD_LIB} |
2059 | ${ACCOUNTSQT_LDFLAGS} |
2060 | ${APPARMOR_LDFLAGS} |
2061 | ${OACLIENT_LDFLAGS} |
2062 | ${SIGNONQT_LDFLAGS} |
2063 | ) |
2064 | -set_target_properties(${ACCOUNTD} PROPERTIES AUTOMOC TRUE) |
2065 | - |
2066 | -install(TARGETS ${ACCOUNTD} |
2067 | - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
2068 | -) |
2069 | - |
2070 | -set(SERVICE_FILE com.ubuntu.OnlineAccounts.Manager.service) |
2071 | -configure_file(${SERVICE_FILE}.in ${SERVICE_FILE}) |
2072 | -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_FILE} |
2073 | - DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services |
2074 | +set_target_properties(${ACCOUNTD_LIB} PROPERTIES AUTOMOC TRUE) |
2075 | + |
2076 | +# Install |
2077 | + |
2078 | +install(TARGETS ${ACCOUNTD_LIB} |
2079 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
2080 | ) |
2081 | |
2082 | # Development files |
2083 | |
2084 | -set(ACCOUNTD_LIB OnlineAccountsDaemon) |
2085 | configure_file(${ACCOUNTD_LIB}.pc.in ${ACCOUNTD_LIB}.pc @ONLY) |
2086 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ACCOUNTD_LIB}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) |
2087 | |
2088 | |
2089 | === added file 'src/lib/OnlineAccountsDaemon/Manager' |
2090 | --- src/lib/OnlineAccountsDaemon/Manager 1970-01-01 00:00:00 +0000 |
2091 | +++ src/lib/OnlineAccountsDaemon/Manager 2015-09-23 12:41:07 +0000 |
2092 | @@ -0,0 +1,1 @@ |
2093 | +#include "manager.h" |
2094 | |
2095 | === renamed file 'src/daemon/OnlineAccountsDaemon.pc.in' => 'src/lib/OnlineAccountsDaemon/OnlineAccountsDaemon.pc.in' |
2096 | --- src/daemon/OnlineAccountsDaemon.pc.in 2015-07-08 11:13:00 +0000 |
2097 | +++ src/lib/OnlineAccountsDaemon/OnlineAccountsDaemon.pc.in 2015-09-23 12:41:07 +0000 |
2098 | @@ -6,4 +6,6 @@ |
2099 | Name: @ACCOUNTD_LIB@ |
2100 | Description: Binding development files for the Online Accounts simplified API |
2101 | Version: @PROJECT_VERSION@ |
2102 | -Cflags: -I${includedir}/@ACCOUNTD_LIB@ |
2103 | +Requires: Qt5Core |
2104 | +Libs: -L${libdir} -l@ACCOUNTD_LIB@ |
2105 | +Cflags: -I${includedir}/ |
2106 | |
2107 | === renamed file 'src/daemon/access_request.cpp' => 'src/lib/OnlineAccountsDaemon/access_request.cpp' |
2108 | === renamed file 'src/daemon/access_request.h' => 'src/lib/OnlineAccountsDaemon/access_request.h' |
2109 | === renamed file 'src/daemon/account_info.h' => 'src/lib/OnlineAccountsDaemon/account_info.h' |
2110 | === renamed file 'src/daemon/async_operation.cpp' => 'src/lib/OnlineAccountsDaemon/async_operation.cpp' |
2111 | === renamed file 'src/daemon/async_operation.h' => 'src/lib/OnlineAccountsDaemon/async_operation.h' |
2112 | === renamed file 'src/daemon/authentication_request.cpp' => 'src/lib/OnlineAccountsDaemon/authentication_request.cpp' |
2113 | === renamed file 'src/daemon/authentication_request.h' => 'src/lib/OnlineAccountsDaemon/authentication_request.h' |
2114 | === renamed file 'src/daemon/authenticator.cpp' => 'src/lib/OnlineAccountsDaemon/authenticator.cpp' |
2115 | === renamed file 'src/daemon/authenticator.h' => 'src/lib/OnlineAccountsDaemon/authenticator.h' |
2116 | === renamed file 'src/daemon/client_registry.cpp' => 'src/lib/OnlineAccountsDaemon/client_registry.cpp' |
2117 | === renamed file 'src/daemon/client_registry.h' => 'src/lib/OnlineAccountsDaemon/client_registry.h' |
2118 | === renamed file 'src/daemon/com.ubuntu.OnlineAccounts.Manager.xml' => 'src/lib/OnlineAccountsDaemon/com.ubuntu.OnlineAccounts.Manager.xml' |
2119 | === renamed file 'src/daemon/dbus_constants.h' => 'src/lib/OnlineAccountsDaemon/dbus_constants.h' |
2120 | === added file 'src/lib/OnlineAccountsDaemon/global.h' |
2121 | --- src/lib/OnlineAccountsDaemon/global.h 1970-01-01 00:00:00 +0000 |
2122 | +++ src/lib/OnlineAccountsDaemon/global.h 2015-09-23 12:41:07 +0000 |
2123 | @@ -0,0 +1,32 @@ |
2124 | +/* |
2125 | + * This file is part of libOnlineAccountsDaemon |
2126 | + * |
2127 | + * Copyright (C) 2015 Canonical Ltd. |
2128 | + * |
2129 | + * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
2130 | + * |
2131 | + * This program is free software: you can redistribute it and/or modify it |
2132 | + * under the terms of the GNU Lesser General Public License version 3, as |
2133 | + * published by the Free Software Foundation. |
2134 | + * |
2135 | + * This program is distributed in the hope that it will be useful, but |
2136 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
2137 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2138 | + * PURPOSE. See the GNU Lesser General Public License for more details. |
2139 | + * |
2140 | + * You should have received a copy of the GNU Lesser General Public License |
2141 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2142 | + */ |
2143 | + |
2144 | +#ifndef ONLINE_ACCOUNTS_DAEMON_GLOBAL_H |
2145 | +#define ONLINE_ACCOUNTS_DAEMON_GLOBAL_H |
2146 | + |
2147 | +#include <QtGlobal> |
2148 | + |
2149 | +#if defined(BUILDING_ONLINE_ACCOUNTS_DAEMON) |
2150 | +# define OAD_EXPORT Q_DECL_EXPORT |
2151 | +#else |
2152 | +# define OAD_EXPORT Q_DECL_IMPORT |
2153 | +#endif |
2154 | + |
2155 | +#endif // ONLINE_ACCOUNTS_DAEMON_GLOBAL_H |
2156 | |
2157 | === renamed file 'src/daemon/manager.cpp' => 'src/lib/OnlineAccountsDaemon/manager.cpp' |
2158 | --- src/daemon/manager.cpp 2015-08-20 09:43:52 +0000 |
2159 | +++ src/lib/OnlineAccountsDaemon/manager.cpp 2015-09-23 12:41:07 +0000 |
2160 | @@ -343,6 +343,16 @@ |
2161 | |
2162 | info[ONLINE_ACCOUNTS_INFO_KEY_AUTH_METHOD] = authMethod(as->authData()); |
2163 | QString settingsPrefix(QStringLiteral(ONLINE_ACCOUNTS_INFO_KEY_SETTINGS)); |
2164 | + /* First, read the global settings */ |
2165 | + Accounts::Account *a = as->account(); |
2166 | + a->selectService(); |
2167 | + Q_FOREACH(const QString &key, a->allKeys()) { |
2168 | + if (key == "enabled" || key == "CredentialsId" || key == "name" || |
2169 | + key.startsWith("auth/")) continue; |
2170 | + info[settingsPrefix + key] = a->value(key); |
2171 | + } |
2172 | + |
2173 | + /* Then, add service-specific settings */ |
2174 | Q_FOREACH(const QString &key, as->allKeys()) { |
2175 | if (key == "enabled") continue; |
2176 | info[settingsPrefix + key] = as->value(key); |
2177 | @@ -590,4 +600,9 @@ |
2178 | QCoreApplication::instance()->quit(); |
2179 | } |
2180 | |
2181 | +void *oad_create_manager(QObject *parent) |
2182 | +{ |
2183 | + return new Manager(parent); |
2184 | +} |
2185 | + |
2186 | #include "manager.moc" |
2187 | |
2188 | === renamed file 'src/daemon/manager.h' => 'src/lib/OnlineAccountsDaemon/manager.h' |
2189 | --- src/daemon/manager.h 2015-07-10 11:33:58 +0000 |
2190 | +++ src/lib/OnlineAccountsDaemon/manager.h 2015-09-23 12:41:07 +0000 |
2191 | @@ -26,10 +26,16 @@ |
2192 | #include <QList> |
2193 | #include <QObject> |
2194 | #include <QVariantMap> |
2195 | -#include "account_info.h" |
2196 | + |
2197 | +#include "global.h" |
2198 | + |
2199 | +extern "C" { |
2200 | +OAD_EXPORT void *oad_create_manager(QObject *parent); |
2201 | +} |
2202 | |
2203 | namespace OnlineAccountsDaemon { |
2204 | |
2205 | +struct AccountInfo; |
2206 | class CallContext; |
2207 | class ManagerAdaptor; |
2208 | |
2209 | |
2210 | === renamed file 'src/daemon/manager_adaptor.cpp' => 'src/lib/OnlineAccountsDaemon/manager_adaptor.cpp' |
2211 | === renamed file 'src/daemon/manager_adaptor.h' => 'src/lib/OnlineAccountsDaemon/manager_adaptor.h' |
2212 | --- src/daemon/manager_adaptor.h 2015-08-03 08:55:36 +0000 |
2213 | +++ src/lib/OnlineAccountsDaemon/manager_adaptor.h 2015-09-23 12:41:07 +0000 |
2214 | @@ -28,6 +28,7 @@ |
2215 | #include <QString> |
2216 | #include <QVariantMap> |
2217 | #include <sys/types.h> |
2218 | +#include "account_info.h" |
2219 | #include "manager.h" |
2220 | |
2221 | namespace OnlineAccountsDaemon { |
2222 | |
2223 | === renamed file 'src/daemon/state_saver.cpp' => 'src/lib/OnlineAccountsDaemon/state_saver.cpp' |
2224 | === renamed file 'src/daemon/state_saver.h' => 'src/lib/OnlineAccountsDaemon/state_saver.h' |
2225 | === modified file 'src/lib/Ubuntu/OnlineAccounts.2/account.cpp' |
2226 | --- src/lib/Ubuntu/OnlineAccounts.2/account.cpp 2015-07-31 12:44:30 +0000 |
2227 | +++ src/lib/Ubuntu/OnlineAccounts.2/account.cpp 2015-09-23 12:41:07 +0000 |
2228 | @@ -70,12 +70,58 @@ |
2229 | map["errorCode"] = reply.error().code(); |
2230 | map["errorText"] = reply.error().text(); |
2231 | } else { |
2232 | - map = replyToMap(*watcher, m_account->authenticationMethod()); |
2233 | + map = replyToMap(*watcher); |
2234 | } |
2235 | |
2236 | Q_EMIT q->authenticationReply(map); |
2237 | } |
2238 | |
2239 | +/*! |
2240 | + * \qmltype Account |
2241 | + * \inqmlmodule Ubuntu.OnlineAccounts 2.0 |
2242 | + * \ingroup Ubuntu |
2243 | + * \brief Representation of an online account |
2244 | + * |
2245 | + * The Account object holds the information related to an account and provides |
2246 | + * methods to interact with it. |
2247 | + * It's not possible to create such objects from QML; instead, they are |
2248 | + * returned by the \l AccountModel in the \c account role or in the \l |
2249 | + * {AccountModel::accountList} { \c accountList} property. |
2250 | + * |
2251 | + * Here's an example on how to use the account object in a delegate: |
2252 | + * |
2253 | + * \qml |
2254 | + * import QtQuick 2.0 |
2255 | + * import Ubuntu.OnlineAccounts 2.0 |
2256 | + * |
2257 | + * ListView { |
2258 | + * model: AccountModel {} |
2259 | + * delegate: Button { |
2260 | + * text: "Authenticate " + model.displayName |
2261 | + * onClicked: model.account.authenticate({}) |
2262 | + * Connections { |
2263 | + * target: model.account |
2264 | + * onAuthenticationReply: { |
2265 | + * console.log("Access token is " + reply['AccessToken']) |
2266 | + * } |
2267 | + * } |
2268 | + * } |
2269 | + * } |
2270 | + * \endqml |
2271 | + * |
2272 | + * \target errorCode |
2273 | + * \section3 Error codes used in this module |
2274 | + * Some operations, such as the \l Account::authenticate() and the \l |
2275 | + * AccountModel::requestAccess() methods, can fail and return one of these |
2276 | + * error codes: |
2277 | + * \list |
2278 | + * \li \c Account.ErrorCodeNoAccount - The accounts is invalid |
2279 | + * \li \c Account.ErrorCodeUserCanceled - The operation was canceled by the user |
2280 | + * \li \c Account.ErrorCodePermissionDenied - The application has no |
2281 | + * permission to complete the operation |
2282 | + * \endlist |
2283 | + */ |
2284 | + |
2285 | Account::Account(OnlineAccounts::Account *account, QObject *parent): |
2286 | QObject(parent), |
2287 | d_ptr(new AccountPrivate(account, this)) |
2288 | @@ -87,41 +133,89 @@ |
2289 | delete d_ptr; |
2290 | } |
2291 | |
2292 | +/*! |
2293 | + * \qmlproperty bool Account::valid |
2294 | + * |
2295 | + * Whether the account object is valid; this is usually \c true, because the \c |
2296 | + * AccountModel never gives out invalid accounts. However, it can happen that a |
2297 | + * valid account becomes invalid while the application is using it (if, for |
2298 | + * instance, the user deleted the account or revoked the application's access |
2299 | + * rights to use it). As soon as this property becomes \c false, the |
2300 | + * application should stop using this account. |
2301 | + */ |
2302 | bool Account::isValid() const |
2303 | { |
2304 | Q_D(const Account); |
2305 | return d->m_account->isValid(); |
2306 | } |
2307 | |
2308 | +/*! |
2309 | + * \qmlproperty string Account::displayName |
2310 | + * |
2311 | + * The display name of the account. This is usually the user's login name, but |
2312 | + * applications should not rely on the value of this property. Use it only for |
2313 | + * display purposes. |
2314 | + */ |
2315 | QString Account::displayName() const |
2316 | { |
2317 | Q_D(const Account); |
2318 | return d->m_account->displayName(); |
2319 | } |
2320 | |
2321 | +/*! |
2322 | + * \qmlproperty int Account::accountId |
2323 | + * |
2324 | + * Numeric identifier of the account. This property remains constant during the |
2325 | + * lifetime of the account. Note, however, that if the user deletes the account |
2326 | + * and re-creates it, its ID will be different. |
2327 | + */ |
2328 | int Account::accountId() const |
2329 | { |
2330 | Q_D(const Account); |
2331 | return d->m_account->id(); |
2332 | } |
2333 | |
2334 | +/*! |
2335 | + * \qmlproperty int Account::serviceId |
2336 | + * |
2337 | + * Identifier for the service used with the account. |
2338 | + */ |
2339 | QString Account::serviceId() const |
2340 | { |
2341 | Q_D(const Account); |
2342 | return d->m_account->serviceId(); |
2343 | } |
2344 | |
2345 | +/*! |
2346 | + * \qmlproperty enumeration Account::authenticationMethod |
2347 | + * |
2348 | + * The authentication method used when authenticating with the account. |
2349 | + * Currently, these authentication methods are supported: |
2350 | + * \list |
2351 | + * \li \c Account.AuthenticationMethodOAuth1 - OAuth 1.0 |
2352 | + * \li \c Account.AuthenticationMethodOAuth2 - OAuth 2.0 |
2353 | + * \li \c Account.AuthenticationMethodPassword - username/password |
2354 | + * \endlist |
2355 | + */ |
2356 | Account::AuthenticationMethod Account::authenticationMethod() const |
2357 | { |
2358 | Q_D(const Account); |
2359 | return AuthenticationMethod(d->m_account->authenticationMethod()); |
2360 | } |
2361 | |
2362 | +/*! |
2363 | + * \qmlproperty jsobject Account::settings |
2364 | + * |
2365 | + * A dictionary of the settings stored into the account. |
2366 | + */ |
2367 | QVariantMap Account::settings() const |
2368 | { |
2369 | - /* FIXME: libOnlineAccountsQt lacks a way to retrieve the list of settings; |
2370 | - * until that is available, we cannot do much here */ |
2371 | - return QVariantMap(); |
2372 | + Q_D(const Account); |
2373 | + QVariantMap ret; |
2374 | + Q_FOREACH(const QString &key, d->m_account->keys()) { |
2375 | + ret.insert(key, d->m_account->setting(key)); |
2376 | + } |
2377 | + return ret; |
2378 | } |
2379 | |
2380 | OnlineAccounts::Account *Account::internalObject() const |
2381 | @@ -130,6 +224,45 @@ |
2382 | return d->m_account; |
2383 | } |
2384 | |
2385 | +/*! |
2386 | + * \qmlsignal Account::authenticationReply(jsobject authenticationData) |
2387 | + * |
2388 | + * Emitted when the authentication completes. The \a authenticationData object |
2389 | + * will contain the authentication reply. If the authentication failed, the |
2390 | + * following two keys will be present: |
2391 | + * \list |
2392 | + * \li \c errorCode is an \l {errorCode} {error code} |
2393 | + * \li \c errorText is a textual description of the error, not meant for the |
2394 | + * end-user; it can be used for debugging purposes |
2395 | + * \endlist |
2396 | + */ |
2397 | + |
2398 | +/*! |
2399 | + * \qmlmethod void Account::authenticate(jsobject params) |
2400 | + * |
2401 | + * Perform the authentication on this account. The \a params parameter can be |
2402 | + * used to pass authentication data, such as the ClientId and ClientSecret used |
2403 | + * in the OAuth flow. The list of the supported authentication parameters |
2404 | + * depend on the authentication method being used, and are documented in the |
2405 | + * Online Accounts development Guide in the Ubuntu Developer Portal. |
2406 | + * |
2407 | + * There are, however, two authentication parameters which are available |
2408 | + * regardless of the authentication method being used: |
2409 | + * \list |
2410 | + * \li \c invalidateCachedReply can be set to \c true when the previous |
2411 | + * authentication reply returned an invalid access token. It will ensure |
2412 | + * the creation of a new access token. |
2413 | + * \li \c interactive is \c true by default; if set to \c false, it will ensure |
2414 | + * that no interaction with the user will occur. |
2415 | + * \endlist |
2416 | + * |
2417 | + * Each call to this method will cause the \l authenticationReply signal to be |
2418 | + * emitted at some time later. Note that the authentication might involve |
2419 | + * interactions with the network or with the end-user, so don't expect a reply |
2420 | + * to be emitted immediately. |
2421 | + * |
2422 | + * \sa authenticationReply |
2423 | + */ |
2424 | void Account::authenticate(const QVariantMap ¶ms) |
2425 | { |
2426 | Q_D(Account); |
2427 | |
2428 | === modified file 'src/lib/Ubuntu/OnlineAccounts.2/account.h' |
2429 | --- src/lib/Ubuntu/OnlineAccounts.2/account.h 2015-07-31 12:44:30 +0000 |
2430 | +++ src/lib/Ubuntu/OnlineAccounts.2/account.h 2015-09-23 12:41:07 +0000 |
2431 | @@ -35,7 +35,7 @@ |
2432 | class Account: public QObject |
2433 | { |
2434 | Q_OBJECT |
2435 | - Q_ENUMS(AuthenticationMethod) |
2436 | + Q_ENUMS(AuthenticationMethod ErrorCode) |
2437 | Q_PROPERTY(bool valid READ isValid NOTIFY validChanged) |
2438 | Q_PROPERTY(QString displayName READ displayName NOTIFY accountChanged) |
2439 | Q_PROPERTY(int accountId READ accountId CONSTANT) |
2440 | @@ -53,6 +53,16 @@ |
2441 | AuthenticationMethodPassword, |
2442 | }; |
2443 | |
2444 | + enum ErrorCode { |
2445 | + // Make sure these are kept in sync with those from OnlineAccountsQt |
2446 | + ErrorCodeNoError = 0, |
2447 | + ErrorCodeNoAccount, |
2448 | + ErrorCodeWrongType, |
2449 | + ErrorCodeUserCanceled, |
2450 | + ErrorCodePermissionDenied, |
2451 | + ErrorCodeInteractionRequired, |
2452 | + }; |
2453 | + |
2454 | explicit Account(OnlineAccounts::Account *account, QObject *parent = 0); |
2455 | ~Account(); |
2456 | |
2457 | |
2458 | === modified file 'src/lib/Ubuntu/OnlineAccounts.2/account_model.cpp' |
2459 | --- src/lib/Ubuntu/OnlineAccounts.2/account_model.cpp 2015-08-06 12:22:06 +0000 |
2460 | +++ src/lib/Ubuntu/OnlineAccounts.2/account_model.cpp 2015-09-23 12:41:07 +0000 |
2461 | @@ -130,6 +130,13 @@ |
2462 | { |
2463 | m_updateQueued = false; |
2464 | |
2465 | + if (m_applicationId.isEmpty()) { |
2466 | + QStringList parts = QString::fromUtf8(qgetenv("APP_ID")).split('_'); |
2467 | + if (parts.count() == 3) { |
2468 | + m_applicationId = QStringList(parts.mid(0, 2)).join('_'); |
2469 | + } |
2470 | + } |
2471 | + |
2472 | if (m_applicationIdChanged) { |
2473 | delete m_manager; |
2474 | m_manager = new OnlineAccounts::Manager(m_applicationId); |
2475 | @@ -179,8 +186,7 @@ |
2476 | OnlineAccounts::Account *account = reply.account(); |
2477 | accountData["account"] = |
2478 | QVariant::fromValue<QObject*>(handleAccount(account)); |
2479 | - auto method = account->authenticationMethod(); |
2480 | - authenticationData = replyToMap(*watcher, method); |
2481 | + authenticationData = replyToMap(*watcher); |
2482 | } |
2483 | |
2484 | Q_EMIT q->accessReply(accountData, authenticationData); |
2485 | @@ -221,6 +227,42 @@ |
2486 | q->dataChanged(idx, idx); |
2487 | } |
2488 | |
2489 | +/*! |
2490 | + * \qmltype AccountModel |
2491 | + * \inqmlmodule Ubuntu.OnlineAccounts 2.0 |
2492 | + * \ingroup Ubuntu |
2493 | + * \brief Model of available online accounts. |
2494 | + * |
2495 | + * The AccountModel lists all the accounts available to the application. |
2496 | + * \qml |
2497 | + * import QtQuick 2.0 |
2498 | + * import Ubuntu.OnlineAccounts 2.0 |
2499 | + * |
2500 | + * ListView { |
2501 | + * model: AccountModel { |
2502 | + * applicationId: "myapp.developer_myapp" |
2503 | + * } |
2504 | + * delegate: Text { |
2505 | + * text: model.displayName |
2506 | + * } |
2507 | + * } |
2508 | + * \endqml |
2509 | + * |
2510 | + * The model defines the following roles: |
2511 | + * |
2512 | + * \list |
2513 | + * \li \c displayName is the name of the account (usually the user's login) |
2514 | + * \li \c accountId is a numeric ID for the account |
2515 | + * \li \c serviceId is a service identifier (e.g., "myapp.developer_myapp_google") |
2516 | + * \li \c authenticationMethod is the authentication method used on this |
2517 | + * account; \sa Account::authenticationMethod |
2518 | + * \li \c settings is a dictionary of the settings stored into the account |
2519 | + * \li \c account is the \l Account object |
2520 | + * \endlist |
2521 | + * |
2522 | + * \sa Account |
2523 | + */ |
2524 | + |
2525 | AccountModel::AccountModel(QObject *parent): |
2526 | QAbstractListModel(parent), |
2527 | d_ptr(new AccountModelPrivate(this)) |
2528 | @@ -248,6 +290,13 @@ |
2529 | d->update(); |
2530 | } |
2531 | |
2532 | +/*! |
2533 | + * \qmlproperty string AccountModel::applicationId |
2534 | + * |
2535 | + * The short application identifier (that is, the \c APP_ID minus the version |
2536 | + * component) of the client. If not given, the identifier will be deduced from |
2537 | + * the APP_ID environment variable. |
2538 | + */ |
2539 | void AccountModel::setApplicationId(const QString &applicationId) |
2540 | { |
2541 | Q_D(AccountModel); |
2542 | @@ -265,6 +314,12 @@ |
2543 | return d->m_applicationId; |
2544 | } |
2545 | |
2546 | +/*! |
2547 | + * \qmlproperty string AccountModel::serviceId |
2548 | + * |
2549 | + * If this property is set, only accounts providing the given service will be |
2550 | + * returned. |
2551 | + */ |
2552 | void AccountModel::setServiceId(const QString &serviceId) |
2553 | { |
2554 | Q_D(AccountModel); |
2555 | @@ -282,6 +337,13 @@ |
2556 | return d->m_serviceId; |
2557 | } |
2558 | |
2559 | +/*! |
2560 | + * \qmlproperty list<Account> AccountModel::accountList |
2561 | + * |
2562 | + * List of accounts in the model. This list has exactly the same contents as |
2563 | + * the model data, and is provided as a property just as a convenience for |
2564 | + * those cases when a model is not required. |
2565 | + */ |
2566 | QList<QObject*> AccountModel::accountList() const |
2567 | { |
2568 | Q_D(const AccountModel); |
2569 | @@ -292,6 +354,47 @@ |
2570 | return objects; |
2571 | } |
2572 | |
2573 | +/*! |
2574 | + * \qmlsignal AccountModel::accessReply(jsobject reply, jsobject authenticationData) |
2575 | + * |
2576 | + * Emitted when the request initiated with \l AccountModel::requestAccess() |
2577 | + * completes. The \a reply object contains the access reply: |
2578 | + * \list |
2579 | + * \li \c account if access to an account was granted, this property will hold |
2580 | + * an \l Account object |
2581 | + * \li \c errorCode \l {errorCode} {error code}, if an error occurred |
2582 | + * \li \c errorText is a textual description of the error, not meant for the |
2583 | + * end-user; it can be used for debugging purposes |
2584 | + * \endlist |
2585 | + * |
2586 | + * The second parameter, the \a authenticationData object, will contain the |
2587 | + * authentication reply. |
2588 | + */ |
2589 | + |
2590 | +/*! |
2591 | + * \qmlmethod void AccountModel::requestAccess(string serviceId, |
2592 | + * jsobject parameters) |
2593 | + * |
2594 | + * Requests the user to grant this application access to an account providing |
2595 | + * the given service. The user will be asked whether this application should be |
2596 | + * given access to the desired account; if no such accounts are currently |
2597 | + * registered in the system, the user will be guided to create a new one. |
2598 | + * |
2599 | + * It should be noted that account authorizations persist across application |
2600 | + * restart; therefore, this method should be called only when the application |
2601 | + * needs a new account to appear in the model. |
2602 | + * |
2603 | + * Each call to this method will cause the \l accessReply signal to be |
2604 | + * emitted at some time later. Note that the operation will involve |
2605 | + * interactions with the end-user, so don't expect a reply to be emitted |
2606 | + * immediately. |
2607 | + * |
2608 | + * The \a parameters parameter can be used to pass authentication data |
2609 | + * (similarly to how the \l Account::authenticate() method works), if it's |
2610 | + * desired to perform the authentication at the same time. |
2611 | + * |
2612 | + * \sa accessReply |
2613 | + */ |
2614 | void AccountModel::requestAccess(const QString &service, |
2615 | const QVariantMap ¶meters) |
2616 | { |
2617 | @@ -305,6 +408,17 @@ |
2618 | d, SLOT(onAccessRequestFinished())); |
2619 | } |
2620 | |
2621 | +/*! |
2622 | + * \qmlmethod variant AccountModel::get(int row, string roleName) |
2623 | + * |
2624 | + * Returns the data at \a row for the role \a roleName. |
2625 | + */ |
2626 | +QVariant AccountModel::get(int row, const QString &roleName) const |
2627 | +{ |
2628 | + int role = roleNames().key(roleName.toLatin1(), -1); |
2629 | + return data(index(row), role); |
2630 | +} |
2631 | + |
2632 | int AccountModel::rowCount(const QModelIndex &parent) const |
2633 | { |
2634 | Q_D(const AccountModel); |
2635 | |
2636 | === modified file 'src/lib/Ubuntu/OnlineAccounts.2/account_model.h' |
2637 | --- src/lib/Ubuntu/OnlineAccounts.2/account_model.h 2015-08-06 12:22:06 +0000 |
2638 | +++ src/lib/Ubuntu/OnlineAccounts.2/account_model.h 2015-09-23 12:41:07 +0000 |
2639 | @@ -68,6 +68,8 @@ |
2640 | Q_INVOKABLE void requestAccess(const QString &service, |
2641 | const QVariantMap ¶ms); |
2642 | |
2643 | + Q_INVOKABLE QVariant get(int row, const QString &roleName) const; |
2644 | + |
2645 | // reimplemented virtual methods |
2646 | int rowCount(const QModelIndex &parent = QModelIndex()) const; |
2647 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; |
2648 | |
2649 | === modified file 'src/lib/Ubuntu/OnlineAccounts.2/authentication_data.cpp' |
2650 | --- src/lib/Ubuntu/OnlineAccounts.2/authentication_data.cpp 2015-08-06 12:22:06 +0000 |
2651 | +++ src/lib/Ubuntu/OnlineAccounts.2/authentication_data.cpp 2015-09-23 12:41:07 +0000 |
2652 | @@ -23,92 +23,24 @@ |
2653 | #include "OnlineAccounts/PendingCall" |
2654 | #include <QDebug> |
2655 | |
2656 | -static void commonParamsFromMap(OnlineAccounts::AuthenticationData &data, |
2657 | - const QVariantMap ¶ms) |
2658 | -{ |
2659 | +QVariantMap replyToMap(const OnlineAccounts::PendingCall &call) |
2660 | +{ |
2661 | + OnlineAccounts::AuthenticationReply reply(call); |
2662 | + return reply.data(); |
2663 | +} |
2664 | + |
2665 | +OnlineAccounts::AuthenticationData |
2666 | +authenticationDataFromMap(const QVariantMap ¶ms, |
2667 | + OnlineAccounts::AuthenticationMethod method) |
2668 | +{ |
2669 | + OnlineAccounts::AuthenticationData data(method); |
2670 | + QVariantMap cleanedParams(params); |
2671 | data.setInteractive(params.value("interactive", true).toBool()); |
2672 | if (params["invalidateCachedReply"].toBool()) { |
2673 | data.invalidateCachedReply(); |
2674 | } |
2675 | -} |
2676 | - |
2677 | -QVariantMap replyToMap(const OnlineAccounts::PendingCall &call, |
2678 | - OnlineAccounts::AuthenticationMethod method) |
2679 | -{ |
2680 | - QVariantMap map; |
2681 | - switch (method) { |
2682 | - case OnlineAccounts::AuthenticationMethodOAuth1: |
2683 | - { |
2684 | - OnlineAccounts::OAuth1Reply reply(call); |
2685 | - map["ConsumerKey"] = QString::fromUtf8(reply.consumerKey()); |
2686 | - map["ConsumerSecret"] = QString::fromUtf8(reply.consumerSecret()); |
2687 | - map["Token"] = QString::fromUtf8(reply.token()); |
2688 | - map["TokenSecret"] = QString::fromUtf8(reply.tokenSecret()); |
2689 | - map["SignatureMethod"] = QString::fromUtf8(reply.signatureMethod()); |
2690 | - return map; |
2691 | - } |
2692 | - case OnlineAccounts::AuthenticationMethodOAuth2: |
2693 | - { |
2694 | - OnlineAccounts::OAuth2Reply reply(call); |
2695 | - map["AccessToken"] = QString::fromUtf8(reply.accessToken()); |
2696 | - map["ExpiresIn"] = reply.expiresIn(); |
2697 | - QStringList grantedScopes; |
2698 | - Q_FOREACH(const QByteArray &s, reply.grantedScopes()) { |
2699 | - grantedScopes.append(s); |
2700 | - } |
2701 | - map["GrantedScopes"] = grantedScopes; |
2702 | - return map; |
2703 | - } |
2704 | - case OnlineAccounts::AuthenticationMethodPassword: |
2705 | - { |
2706 | - OnlineAccounts::PasswordReply reply(call); |
2707 | - map["Username"] = reply.username(); |
2708 | - map["Password"] = reply.password(); |
2709 | - return map; |
2710 | - } |
2711 | - default: |
2712 | - return map; |
2713 | - } |
2714 | -} |
2715 | - |
2716 | -OnlineAccounts::AuthenticationData |
2717 | -authenticationDataFromMap(const QVariantMap ¶ms, |
2718 | - OnlineAccounts::AuthenticationMethod method) |
2719 | -{ |
2720 | - switch (method) { |
2721 | - case OnlineAccounts::AuthenticationMethodOAuth1: |
2722 | - { |
2723 | - OnlineAccounts::OAuth1Data data; |
2724 | - if (params.contains("ConsumerKey")) { |
2725 | - data.setConsumerKey(params["ConsumerKey"].toByteArray()); |
2726 | - data.setConsumerSecret(params["ConsumerSecret"].toByteArray()); |
2727 | - } |
2728 | - commonParamsFromMap(data, params); |
2729 | - return data; |
2730 | - } |
2731 | - case OnlineAccounts::AuthenticationMethodOAuth2: |
2732 | - { |
2733 | - OnlineAccounts::OAuth2Data data; |
2734 | - if (params.contains("ClientId")) { |
2735 | - data.setClientId(params["ClientId"].toByteArray()); |
2736 | - data.setClientSecret(params["ClientSecret"].toByteArray()); |
2737 | - } |
2738 | - if (params.contains("Scopes")) { |
2739 | - QList<QByteArray> scopes; |
2740 | - Q_FOREACH(const QString &s, params["Scopes"].toStringList()) { |
2741 | - scopes.append(s.toUtf8()); |
2742 | - } |
2743 | - data.setScopes(scopes); |
2744 | - } |
2745 | - commonParamsFromMap(data, params); |
2746 | - return data; |
2747 | - } |
2748 | - case OnlineAccounts::AuthenticationMethodPassword: |
2749 | - default: |
2750 | - { |
2751 | - OnlineAccounts::PasswordData data; |
2752 | - commonParamsFromMap(data, params); |
2753 | - return data; |
2754 | - } |
2755 | - } |
2756 | + cleanedParams.remove("interactive"); |
2757 | + cleanedParams.remove("invalidateCachedReply"); |
2758 | + data.setParameters(cleanedParams); |
2759 | + return data; |
2760 | } |
2761 | |
2762 | === modified file 'src/lib/Ubuntu/OnlineAccounts.2/authentication_data.h' |
2763 | --- src/lib/Ubuntu/OnlineAccounts.2/authentication_data.h 2015-07-31 12:44:30 +0000 |
2764 | +++ src/lib/Ubuntu/OnlineAccounts.2/authentication_data.h 2015-09-23 12:41:07 +0000 |
2765 | @@ -28,8 +28,7 @@ |
2766 | #include "OnlineAccounts/AuthenticationData" |
2767 | #include <QVariantMap> |
2768 | |
2769 | -QVariantMap replyToMap(const OnlineAccounts::PendingCall &call, |
2770 | - OnlineAccounts::AuthenticationMethod method); |
2771 | +QVariantMap replyToMap(const OnlineAccounts::PendingCall &call); |
2772 | |
2773 | OnlineAccounts::AuthenticationData |
2774 | authenticationDataFromMap(const QVariantMap ¶ms, |
2775 | |
2776 | === modified file 'tests/daemon/functional_tests/daemon_interface.h' |
2777 | --- tests/daemon/functional_tests/daemon_interface.h 2015-07-01 13:49:00 +0000 |
2778 | +++ tests/daemon/functional_tests/daemon_interface.h 2015-09-23 12:41:07 +0000 |
2779 | @@ -21,7 +21,7 @@ |
2780 | #ifndef OAD_DAEMON_INTERFACE_H |
2781 | #define OAD_DAEMON_INTERFACE_H |
2782 | |
2783 | -#include "daemon/dbus_constants.h" |
2784 | +#include "OnlineAccountsDaemon/dbus_constants.h" |
2785 | |
2786 | #include <QDBusAbstractInterface> |
2787 | #include <QDBusArgument> |
2788 | |
2789 | === modified file 'tests/daemon/functional_tests/data/com.ubuntu.OnlineAccounts.Manager.service.in' |
2790 | --- tests/daemon/functional_tests/data/com.ubuntu.OnlineAccounts.Manager.service.in 2015-07-01 13:49:00 +0000 |
2791 | +++ tests/daemon/functional_tests/data/com.ubuntu.OnlineAccounts.Manager.service.in 2015-09-23 12:41:07 +0000 |
2792 | @@ -1,3 +1,3 @@ |
2793 | [D-BUS Service] |
2794 | Name=com.ubuntu.OnlineAccounts.Manager |
2795 | -Exec=${OnlineAccountsDaemon_BINARY_DIR}/accountd |
2796 | +Exec=${accountd_BINARY_DIR}/accountd |
2797 | |
2798 | === modified file 'tests/daemon/functional_tests/functional_tests.cpp' |
2799 | --- tests/daemon/functional_tests/functional_tests.cpp 2015-08-04 14:10:14 +0000 |
2800 | +++ tests/daemon/functional_tests/functional_tests.cpp 2015-09-23 12:41:07 +0000 |
2801 | @@ -18,7 +18,7 @@ |
2802 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2803 | */ |
2804 | |
2805 | -#include "daemon/dbus_constants.h" |
2806 | +#include "OnlineAccountsDaemon/dbus_constants.h" |
2807 | #include "daemon_interface.h" |
2808 | #include "fake_dbus_apparmor.h" |
2809 | #include "fake_online_accounts_service.h" |
2810 | @@ -221,6 +221,8 @@ |
2811 | QVERIFY(account3 != 0); |
2812 | account3->setEnabled(true); |
2813 | account3->setDisplayName("CoolAccount 3"); |
2814 | + account3->setValue("color", "red"); |
2815 | + account3->setValue("size", "big"); |
2816 | account3->setCredentialsId(m_account3CredentialsId); |
2817 | account3->selectService(coolMail); |
2818 | account3->setEnabled(true); |
2819 | @@ -410,6 +412,7 @@ |
2820 | accountInfo["settings/auth/oauth2/user_agent/host"] = "coolmail.ex"; |
2821 | accountInfo["settings/auto-explode-after"] = 10; |
2822 | accountInfo["settings/color"] = "green"; |
2823 | + accountInfo["settings/size"] = "big"; |
2824 | credentials["host"] = "coolmail.ex"; |
2825 | QTest::newRow("no auth params") << |
2826 | "coolmail" << |
2827 | |
2828 | === modified file 'tests/lib/OnlineAccounts/functional_tests/functional_tests.cpp' |
2829 | --- tests/lib/OnlineAccounts/functional_tests/functional_tests.cpp 2015-05-26 14:23:10 +0000 |
2830 | +++ tests/lib/OnlineAccounts/functional_tests/functional_tests.cpp 2015-09-23 12:41:07 +0000 |
2831 | @@ -24,13 +24,22 @@ |
2832 | #include "OnlineAccounts/OAuth2Data" |
2833 | #include "OnlineAccounts/PasswordData" |
2834 | #include "OnlineAccounts/account_info.h" |
2835 | -#include "daemon/dbus_constants.h" |
2836 | +#include "OnlineAccountsDaemon/dbus_constants.h" |
2837 | #include <QDBusConnection> |
2838 | #include <QObject> |
2839 | #include <QSignalSpy> |
2840 | #include <QTest> |
2841 | #include <libqtdbusmock/DBusMock.h> |
2842 | |
2843 | +namespace QTest { |
2844 | +template<> |
2845 | +char *toString(const QVariantMap &map) |
2846 | +{ |
2847 | + QJsonDocument doc(QJsonObject::fromVariantMap(map)); |
2848 | + return qstrdup(doc.toJson(QJsonDocument::Compact).data()); |
2849 | +} |
2850 | +} // QTest namespace |
2851 | + |
2852 | class FunctionalTests: public QObject |
2853 | { |
2854 | Q_OBJECT |
2855 | @@ -316,9 +325,11 @@ |
2856 | QCOMPARE(account->serviceId(), serviceId); |
2857 | QCOMPARE(int(account->authenticationMethod()), authenticationMethod); |
2858 | |
2859 | - Q_FOREACH(const QString &key, settings.keys()) { |
2860 | - QCOMPARE(account->setting(key), settings.value(key)); |
2861 | + QVariantMap accountSettings; |
2862 | + Q_FOREACH(const QString &key, account->keys()) { |
2863 | + accountSettings.insert(key, account->setting(key)); |
2864 | } |
2865 | + QCOMPARE(accountSettings, settings); |
2866 | |
2867 | delete account; |
2868 | } |
2869 | @@ -481,6 +492,14 @@ |
2870 | QCOMPARE(oauth1reply.token(), QByteArray("a token")); |
2871 | QCOMPARE(oauth1reply.tokenSecret(), QByteArray("a token secret")); |
2872 | QCOMPARE(oauth1reply.signatureMethod(), QByteArray("PLAIN")); |
2873 | + /* Compare the whole data dictionary */ |
2874 | + QVariantMap expectedData; |
2875 | + expectedData.insert(ONLINE_ACCOUNTS_AUTH_KEY_CONSUMER_KEY, "a key"); |
2876 | + expectedData.insert(ONLINE_ACCOUNTS_AUTH_KEY_CONSUMER_SECRET, "a secret"); |
2877 | + expectedData.insert(ONLINE_ACCOUNTS_AUTH_KEY_TOKEN, "a token"); |
2878 | + expectedData.insert(ONLINE_ACCOUNTS_AUTH_KEY_TOKEN_SECRET, "a token secret"); |
2879 | + expectedData.insert(ONLINE_ACCOUNTS_AUTH_KEY_SIGNATURE_METHOD, "PLAIN"); |
2880 | + QCOMPARE(oauth1reply.data(), expectedData); |
2881 | |
2882 | /* Test OAuth 2.0 */ |
2883 | account = manager.account(2); |
2884 | |
2885 | === modified file 'tests/lib/OnlineAccounts/tst_authentication_data/tst_authentication_data.cpp' |
2886 | --- tests/lib/OnlineAccounts/tst_authentication_data/tst_authentication_data.cpp 2015-02-27 12:39:02 +0000 |
2887 | +++ tests/lib/OnlineAccounts/tst_authentication_data/tst_authentication_data.cpp 2015-09-23 12:41:07 +0000 |
2888 | @@ -49,6 +49,17 @@ |
2889 | oauth2.setClientId("client-changed"); |
2890 | QCOMPARE(oauth2.clientId(), QByteArray("client-changed")); |
2891 | QCOMPARE(copy.clientId(), QByteArray("client")); |
2892 | + |
2893 | + /* As dictionary */ |
2894 | + QVariantMap expectedParameters; |
2895 | + expectedParameters.insert("ClientId", "client-changed"); |
2896 | + QCOMPARE(oauth2.parameters(), expectedParameters); |
2897 | + |
2898 | + QVariantMap parameters; |
2899 | + parameters.insert("UnknownKey", "some value"); |
2900 | + parameters.insert("Hello", "World"); |
2901 | + oauth2.setParameters(parameters); |
2902 | + QCOMPARE(oauth2.parameters(), parameters); |
2903 | } |
2904 | |
2905 | QTEST_MAIN(AuthenticationDataTest) |
2906 | |
2907 | === modified file 'tests/lib/qml_module/tst_qml_module.cpp' |
2908 | --- tests/lib/qml_module/tst_qml_module.cpp 2015-08-06 12:22:06 +0000 |
2909 | +++ tests/lib/qml_module/tst_qml_module.cpp 2015-09-23 12:41:07 +0000 |
2910 | @@ -18,7 +18,7 @@ |
2911 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2912 | */ |
2913 | |
2914 | -#include "daemon/dbus_constants.h" |
2915 | +#include "OnlineAccountsDaemon/dbus_constants.h" |
2916 | #include <QDBusArgument> |
2917 | #include <QDBusConnection> |
2918 | #include <QJsonDocument> |
2919 | @@ -157,17 +157,24 @@ |
2920 | QTest::addColumn<QString>("displayName"); |
2921 | QTest::addColumn<QString>("serviceId"); |
2922 | QTest::addColumn<int>("authenticationMethod"); |
2923 | + QTest::addColumn<QVariantMap>("settings"); |
2924 | |
2925 | + QVariantMap settings; |
2926 | QTest::newRow("empty") << |
2927 | "{}" << |
2928 | - "" << "" << 0; |
2929 | + "" << "" << 0 << settings; |
2930 | + |
2931 | + settings.insert("Server", "www.example.com"); |
2932 | + settings.insert("Port", "9900"); |
2933 | QTest::newRow("complete") << |
2934 | "{" |
2935 | " '" ONLINE_ACCOUNTS_INFO_KEY_DISPLAY_NAME "': 'Tom'," |
2936 | " '" ONLINE_ACCOUNTS_INFO_KEY_SERVICE_ID "': 'cool'," |
2937 | " '" ONLINE_ACCOUNTS_INFO_KEY_AUTH_METHOD "': 2," |
2938 | + " '" ONLINE_ACCOUNTS_INFO_KEY_SETTINGS "Server': 'www.example.com'," |
2939 | + " '" ONLINE_ACCOUNTS_INFO_KEY_SETTINGS "Port': 9900," |
2940 | "}" << |
2941 | - "Tom" << "cool" << 2; |
2942 | + "Tom" << "cool" << 2 << settings; |
2943 | } |
2944 | |
2945 | void ModuleTest::testModelRoles() |
2946 | @@ -176,6 +183,7 @@ |
2947 | QFETCH(QString, displayName); |
2948 | QFETCH(QString, serviceId); |
2949 | QFETCH(int, authenticationMethod); |
2950 | + QFETCH(QVariantMap, settings); |
2951 | |
2952 | addMockedMethod("GetAccounts", "a{sv}", "a(ua{sv})", |
2953 | QString("ret = [(1, %1)]").arg(accountData)); |
2954 | @@ -200,7 +208,7 @@ |
2955 | QCOMPARE(get(model, 0, "authenticationMethod").toInt(), |
2956 | authenticationMethod); |
2957 | // until https://bugs.launchpad.net/bugs/1479768 is fixed |
2958 | - QCOMPARE(get(model, 0, "settings").toMap(), QVariantMap()); |
2959 | + QCOMPARE(get(model, 0, "settings").toMap(), settings); |
2960 | QObject *account = get(model, 0, "account").value<QObject*>(); |
2961 | QVERIFY(account != 0); |
2962 | QCOMPARE(account->metaObject()->className(), "OnlineAccountsModule::Account"); |
2963 | @@ -362,6 +370,7 @@ |
2964 | accessReply.clear(); |
2965 | accessReply["accountDisplayName"] = "Bob"; |
2966 | authenticationData.clear(); |
2967 | + authenticationData.insert("AccessToken", "GoOn"); |
2968 | QTest::newRow("access granted") << |
2969 | "ret = ((1, {'displayName': 'Bob'}),{'AccessToken':'GoOn'})" << |
2970 | accessReply << |
2971 | @@ -551,174 +560,6 @@ |
2972 | |
2973 | delete object; |
2974 | } |
2975 | -/* |
2976 | -void ModuleTest::testAuthentication() |
2977 | -{ |
2978 | - addMockedMethod("GetAccounts", "a{sv}", "a(ua{sv})", |
2979 | - "ret = [" |
2980 | - "(1, {" |
2981 | - " 'displayName': 'Bob'," |
2982 | - " 'serviceId': 'MyService0'," |
2983 | - " 'authMethod': 1," |
2984 | - "})," |
2985 | - "(2, {" |
2986 | - " 'displayName': 'Tom'," |
2987 | - " 'serviceId': 'MyService1'," |
2988 | - " 'authMethod': 2," |
2989 | - "})," |
2990 | - "(3, {" |
2991 | - " 'displayName': 'Sam'," |
2992 | - " 'serviceId': 'MyService2'," |
2993 | - " 'authMethod': 3," |
2994 | - "})," |
2995 | - "]"); |
2996 | - addMockedMethod("Authenticate", "usbba{sv}", "a{sv}", |
2997 | - "if args[0] == 1:\n" |
2998 | - " ret = {" |
2999 | - " 'ConsumerKey': args[4]['ConsumerKey']," |
3000 | - " 'ConsumerSecret': args[4]['ConsumerSecret']," |
3001 | - " 'Token': 'a token'," |
3002 | - " 'TokenSecret': 'a token secret'," |
3003 | - " 'SignatureMethod': 'PLAIN'," |
3004 | - " }\n" |
3005 | - "elif args[0] == 2:\n" |
3006 | - " ret = {" |
3007 | - " 'AccessToken': 'my token'," |
3008 | - " 'ExpiresIn': 3600," |
3009 | - " 'GrantedScopes': args[4]['Scopes']," |
3010 | - " }\n" |
3011 | - "elif args[0] == 3:\n" |
3012 | - " ret = {" |
3013 | - " 'Username': 'admin'," |
3014 | - " 'Password': 'rootme'," |
3015 | - " }\n" |
3016 | - "else:\n" |
3017 | - " ret = {}"); |
3018 | - OnlineAccounts::Manager manager("my-app"); |
3019 | - manager.waitForReady(); |
3020 | - |
3021 | - OnlineAccounts::Account *account = manager.account(1); |
3022 | - QVERIFY(account); |
3023 | - QCOMPARE(account->authenticationMethod(), |
3024 | - OnlineAccounts::AuthenticationMethodOAuth1); |
3025 | - OnlineAccounts::OAuth1Data oauth1data; |
3026 | - oauth1data.setInteractive(false); |
3027 | - oauth1data.setConsumerKey("a key"); |
3028 | - QCOMPARE(oauth1data.consumerKey(), QByteArray("a key")); |
3029 | - oauth1data.setConsumerSecret("a secret"); |
3030 | - QCOMPARE(oauth1data.consumerSecret(), QByteArray("a secret")); |
3031 | - |
3032 | - OnlineAccounts::OAuth1Reply oauth1reply(account->authenticate(oauth1data)); |
3033 | - QCOMPARE(oauth1reply.consumerKey(), QByteArray("a key")); |
3034 | - QCOMPARE(oauth1reply.consumerSecret(), QByteArray("a secret")); |
3035 | - QCOMPARE(oauth1reply.token(), QByteArray("a token")); |
3036 | - QCOMPARE(oauth1reply.tokenSecret(), QByteArray("a token secret")); |
3037 | - QCOMPARE(oauth1reply.signatureMethod(), QByteArray("PLAIN")); |
3038 | - |
3039 | - account = manager.account(2); |
3040 | - QVERIFY(account); |
3041 | - QCOMPARE(account->authenticationMethod(), |
3042 | - OnlineAccounts::AuthenticationMethodOAuth2); |
3043 | - OnlineAccounts::OAuth2Data oauth2data; |
3044 | - oauth2data.invalidateCachedReply(); |
3045 | - QVERIFY(oauth2data.mustInvalidateCachedReply()); |
3046 | - oauth2data.setClientId("a client"); |
3047 | - QCOMPARE(oauth2data.clientId(), QByteArray("a client")); |
3048 | - oauth2data.setClientSecret("a secret"); |
3049 | - QCOMPARE(oauth2data.clientSecret(), QByteArray("a secret")); |
3050 | - QList<QByteArray> scopes = |
3051 | - QList<QByteArray>() << "one" << "two" << "three"; |
3052 | - oauth2data.setScopes(scopes); |
3053 | - QCOMPARE(oauth2data.scopes(), scopes); |
3054 | - |
3055 | - OnlineAccounts::OAuth2Reply oauth2reply(account->authenticate(oauth2data)); |
3056 | - QCOMPARE(oauth2reply.accessToken(), QByteArray("my token")); |
3057 | - QCOMPARE(oauth2reply.expiresIn(), 3600); |
3058 | - QCOMPARE(oauth2reply.grantedScopes(), scopes); |
3059 | - |
3060 | - account = manager.account(3); |
3061 | - QVERIFY(account); |
3062 | - QCOMPARE(account->authenticationMethod(), |
3063 | - OnlineAccounts::AuthenticationMethodPassword); |
3064 | - OnlineAccounts::PasswordData pwdata; |
3065 | - |
3066 | - OnlineAccounts::PasswordReply pwreply(account->authenticate(pwdata)); |
3067 | - QCOMPARE(pwreply.username(), QByteArray("admin")); |
3068 | - QCOMPARE(pwreply.password(), QByteArray("rootme")); |
3069 | - |
3070 | - OnlineAccounts::OAuth2Data copy(oauth2data); |
3071 | - QCOMPARE(copy.clientId(), QByteArray("a client")); |
3072 | - copy.setClientId("new client"); |
3073 | - QCOMPARE(copy.clientId(), QByteArray("new client")); |
3074 | - QCOMPARE(oauth2data.clientId(), QByteArray("a client")); |
3075 | -} |
3076 | - |
3077 | -void ModuleTest::testAuthenticationErrors_data() |
3078 | -{ |
3079 | - QTest::addColumn<QString>("reply"); |
3080 | - QTest::addColumn<int>("errorCode"); |
3081 | - QTest::addColumn<QString>("errorMessage"); |
3082 | - |
3083 | - QTest::newRow("random dbus error") << |
3084 | - "raise dbus.exceptions.DBusException('not foobarized', name='org.foo.bar')" << |
3085 | - int(OnlineAccounts::Error::PermissionDenied) << |
3086 | - "not foobarized"; |
3087 | - |
3088 | - QTest::newRow("no account") << |
3089 | - "raise dbus.exceptions.DBusException('Not there'," |
3090 | - "name='" ONLINE_ACCOUNTS_ERROR_NO_ACCOUNT "')" << |
3091 | - int(OnlineAccounts::Error::NoAccount) << |
3092 | - "Not there"; |
3093 | - |
3094 | - QTest::newRow("user canceled") << |
3095 | - "raise dbus.exceptions.DBusException('Sorry'," |
3096 | - "name='" ONLINE_ACCOUNTS_ERROR_USER_CANCELED "')" << |
3097 | - int(OnlineAccounts::Error::UserCanceled) << |
3098 | - "Sorry"; |
3099 | - |
3100 | - QTest::newRow("permission denied") << |
3101 | - "raise dbus.exceptions.DBusException('Nope'," |
3102 | - "name='" ONLINE_ACCOUNTS_ERROR_PERMISSION_DENIED "')" << |
3103 | - int(OnlineAccounts::Error::PermissionDenied) << |
3104 | - "Nope"; |
3105 | - |
3106 | - QTest::newRow("Interaction required") << |
3107 | - "raise dbus.exceptions.DBusException('Ask the user'," |
3108 | - "name='" ONLINE_ACCOUNTS_ERROR_INTERACTION_REQUIRED "')" << |
3109 | - int(OnlineAccounts::Error::InteractionRequired) << |
3110 | - "Ask the user"; |
3111 | -} |
3112 | - |
3113 | -void ModuleTest::testAuthenticationErrors() |
3114 | -{ |
3115 | - QFETCH(QString, reply); |
3116 | - QFETCH(int, errorCode); |
3117 | - QFETCH(QString, errorMessage); |
3118 | - |
3119 | - addMockedMethod("GetAccounts", "a{sv}", "a(ua{sv})", |
3120 | - "ret = [(1, {" |
3121 | - " 'displayName': 'Bob'," |
3122 | - " 'serviceId': 'MyService0'," |
3123 | - " 'authMethod': 2," |
3124 | - "})]"); |
3125 | - addMockedMethod("Authenticate", "usbba{sv}", "a{sv}", reply); |
3126 | - OnlineAccounts::Manager manager("my-app"); |
3127 | - manager.waitForReady(); |
3128 | - |
3129 | - OnlineAccounts::Account *account = manager.account(1); |
3130 | - QVERIFY(account); |
3131 | - |
3132 | - OnlineAccounts::OAuth2Data oauth2data; |
3133 | - oauth2data.setClientId("a client"); |
3134 | - oauth2data.setClientSecret("a secret"); |
3135 | - oauth2data.setScopes(QList<QByteArray>() << "one" << "two"); |
3136 | - |
3137 | - OnlineAccounts::OAuth2Reply r(account->authenticate(oauth2data)); |
3138 | - QVERIFY(r.hasError()); |
3139 | - QCOMPARE(int(r.error().code()), errorCode); |
3140 | - QCOMPARE(r.error().text(), errorMessage); |
3141 | -} |
3142 | -*/ |
3143 | |
3144 | QTEST_MAIN(ModuleTest) |
3145 | #include "tst_qml_module.moc" |