Merge lp:~mardy/account-plugins/qml into lp:account-plugins

Proposed by Alberto Mardegan on 2013-06-07
Status: Merged
Approved by: Ken VanDine on 2013-06-12
Approved revision: 119
Merged at revision: 117
Proposed branch: lp:~mardy/account-plugins/qml
Merge into: lp:account-plugins
Diff against target: 278 lines (+125/-11)
13 files modified
Makefile.am (+4/-0)
configure.ac (+30/-4)
debian/account-plugin-facebook.install (+1/-0)
debian/account-plugin-flickr.install (+1/-0)
debian/account-plugin-google.install (+1/-0)
debian/account-plugin-twitter.install (+1/-0)
debian/control (+4/-6)
debian/rules (+2/-1)
qml/Makefile.am (+5/-0)
qml/facebook/Main.qml (+33/-0)
qml/flickr/Main.qml (+9/-0)
qml/google/Main.qml (+31/-0)
qml/twitter/Main.qml (+3/-0)
To merge this branch: bzr merge lp:~mardy/account-plugins/qml
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve on 2013-06-12
Ken VanDine 2013-06-07 Approve on 2013-06-11
Review via email: mp+168035@code.launchpad.net

Commit message

Add a few QML plugins

Add facebook, flickr, google and twitter QML plugins for Ubuntu Touch.

Description of the change

Add a few QML plugins

Add facebook, flickr, google and twitter QML plugins for Ubuntu Touch.

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~mardy/account-plugins/qml updated on 2013-06-11
118. By Alberto Mardegan on 2013-06-11

Added a hard-coded path for qmlpluginsdir if pkgconfig failed to get it

This way we don't have to build depend on
ubuntu-system-settings-online-accounts, which isn't in main yet.

Ken VanDine (ken-vandine) wrote :

Great, looks good now.

review: Approve
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~mardy/account-plugins/qml updated on 2013-06-12
119. By Alberto Mardegan on 2013-06-12

Force installation of QML plugins if specified at configuration time

PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.am'
2--- Makefile.am 2013-06-05 19:23:21 +0000
3+++ Makefile.am 2013-06-12 05:52:26 +0000
4@@ -49,6 +49,10 @@
5 src/generic-oauth.vala
6 endif # ENABLE_LIBACCOUNT_PLUGIN
7
8+if ENABLE_QML_PLUGINS
9+SUBDIRS += qml
10+endif # ENABLE_QML_PLUGINS
11+
12 # Extract transatable strings from .provider files
13 %.provider: %.provider.in $(INTLTOOL_MERGE)
14 $(AM_V_at)$(MKDIR_P) $(builddir)/data/providers
15
16=== modified file 'configure.ac'
17--- configure.ac 2013-06-04 14:04:14 +0000
18+++ configure.ac 2013-06-12 05:52:26 +0000
19@@ -26,6 +26,10 @@
20
21 PKG_PROG_PKG_CONFIG([0.24])
22
23+AS_IF([test "x$prefix" = "xNONE"],
24+ [real_prefix=$ac_default_prefix],
25+ [real_prefix=$prefix])
26+
27 # Binary account plugins.
28 AC_ARG_ENABLE([libaccount-plugin],
29 [AS_HELP_STRING([--disable-libaccount-plugin],
30@@ -48,13 +52,34 @@
31 PKG_CHECK_EXISTS([libaccounts-glib])
32
33 AC_SUBST([plugindir],
34- [`$PKG_CONFIG --variable provider_plugindir account-plugin`])
35-
36+ [`$PKG_CONFIG --variable provider_plugindir --define-variable=prefix=$real_prefix account-plugin`])
37+
38+# QML account plugins.
39+AC_ARG_ENABLE([qml-plugins],
40+ [AS_HELP_STRING([--disable-qml-plugins],
41+ [build without support for QML plugins for Ubuntu Touch])])
42+
43+AS_IF([test "x$enable_qml_plugins" != "xno"],
44+ [have_uoa_plugin=yes])
45+
46+AM_CONDITIONAL([ENABLE_QML_PLUGINS],
47+ [test "x$have_uoa_plugin" = "xyes"])
48+
49+# QML plugins installation path
50+AC_SUBST([qmlpluginsdir],
51+ [`$PKG_CONFIG --variable plugin_qml_dir --define-variable=prefix=$real_prefix OnlineAccountsPlugin`])
52+AC_MSG_CHECKING(for qmlplugins directory)
53+if test "x$qmlpluginsdir" = "x" ; then
54+ # fallback if the previous failed
55+ qmlpluginsdir="$real_prefix/share/accounts/qml-plugins"
56+fi
57+
58+# libaccounts providers and service files
59 AC_SUBST([providersdir],
60- [`$PKG_CONFIG --variable providerfilesdir libaccounts-glib`])
61+ [`$PKG_CONFIG --variable providerfilesdir --define-variable=prefix=$real_prefix libaccounts-glib`])
62
63 AC_SUBST([servicesdir],
64- [`$PKG_CONFIG --variable servicefilesdir libaccounts-glib`])
65+ [`$PKG_CONFIG --variable servicefilesdir --define-variable=prefix=$real_prefix libaccounts-glib`])
66
67 AC_ARG_ENABLE([TESTS],
68 [AS_HELP_STRING([--disable-tests], [Disable tests])])
69@@ -222,5 +247,6 @@
70 data/providers/windows-live.provider.in
71 Makefile
72 po/Makefile.in
73+ qml/Makefile
74 ])
75 AC_OUTPUT
76
77=== modified file 'debian/account-plugin-facebook.install'
78--- debian/account-plugin-facebook.install 2013-03-19 14:47:46 +0000
79+++ debian/account-plugin-facebook.install 2013-06-12 05:52:26 +0000
80@@ -3,3 +3,4 @@
81 usr/share/accounts/services/facebook-microblog.service
82 usr/share/accounts/services/facebook-im.service
83 usr/share/accounts/providers/facebook.provider
84+usr/share/accounts/qml-plugins/facebook/Main.qml
85
86=== modified file 'debian/account-plugin-flickr.install'
87--- debian/account-plugin-flickr.install 2013-03-19 14:47:46 +0000
88+++ debian/account-plugin-flickr.install 2013-06-12 05:52:26 +0000
89@@ -2,3 +2,4 @@
90 etc/signon-ui/webkit-options.d/secure.flickr.com.conf
91 usr/share/accounts/services/flickr-*.service
92 usr/share/accounts/providers/flickr.provider
93+usr/share/accounts/qml-plugins/flickr/Main.qml
94
95=== modified file 'debian/account-plugin-google.install'
96--- debian/account-plugin-google.install 2013-04-30 21:30:01 +0000
97+++ debian/account-plugin-google.install 2013-06-12 05:52:26 +0000
98@@ -3,3 +3,4 @@
99 usr/share/accounts/services/google-im.service
100 usr/share/accounts/services/picasa.service
101 usr/share/accounts/providers/google.provider
102+usr/share/accounts/qml-plugins/google/Main.qml
103
104=== modified file 'debian/account-plugin-twitter.install'
105--- debian/account-plugin-twitter.install 2013-03-19 14:47:46 +0000
106+++ debian/account-plugin-twitter.install 2013-06-12 05:52:26 +0000
107@@ -1,3 +1,4 @@
108 etc/signon-ui/webkit-options.d/api.twitter.com.conf
109 usr/share/accounts/services/twitter-microblog.service
110 usr/share/accounts/providers/twitter.provider
111+usr/share/accounts/qml-plugins/twitter/Main.qml
112
113=== modified file 'debian/control'
114--- debian/control 2013-06-08 04:01:08 +0000
115+++ debian/control 2013-06-12 05:52:26 +0000
116@@ -45,9 +45,7 @@
117 Package: account-plugin-google
118 Architecture: all
119 Depends: ${shlibs:Depends}, ${misc:Depends},
120- libaccount-plugin-google,
121- signon-keyring-extension,
122- signon-plugin-oauth2,
123+ libaccount-plugin-google | ubuntu-system-settings-online-accounts,
124 unity-asset-pool (>> 0.8.24daily12.12.05-0ubuntu1),
125 Description: GNOME Control Center account plugin for single signon
126 GNOME Control Center account plugins for single signon
127@@ -55,7 +53,7 @@
128 Package: account-plugin-facebook
129 Architecture: all
130 Depends: ${misc:Depends},
131- libaccount-plugin-generic-oauth,
132+ libaccount-plugin-generic-oauth | ubuntu-system-settings-online-accounts,
133 unity-asset-pool (>> 0.8.24daily12.12.05-0ubuntu1),
134 Description: GNOME Control Center account plugin for single signon - facebook
135 GNOME Control Center account plugins for single signon
136@@ -63,7 +61,7 @@
137 Package: account-plugin-twitter
138 Architecture: all
139 Depends: ${misc:Depends},
140- libaccount-plugin-generic-oauth,
141+ libaccount-plugin-generic-oauth | ubuntu-system-settings-online-accounts,
142 unity-asset-pool (>> 0.8.24daily12.12.05-0ubuntu1),
143 Description: GNOME Control Center account plugin for single signon - twitter
144 GNOME Control Center account plugins for single signon
145@@ -71,7 +69,7 @@
146 Package: account-plugin-flickr
147 Architecture: all
148 Depends: ${misc:Depends},
149- libaccount-plugin-generic-oauth,
150+ libaccount-plugin-generic-oauth | ubuntu-system-settings-online-accounts,
151 unity-asset-pool (>> 0.8.24daily12.12.05-0ubuntu1),
152 Description: GNOME Control Center account plugin for single signon - flickr
153 GNOME Control Center account plugins for single signon
154
155=== modified file 'debian/rules'
156--- debian/rules 2013-04-11 17:34:17 +0000
157+++ debian/rules 2013-06-12 05:52:26 +0000
158@@ -8,7 +8,8 @@
159 NOCONFIGURE=1 dh_autoreconf ./autogen.sh
160
161 override_dh_auto_configure:
162- dh_auto_configure -- --with-twitter-consumer-key="NGOB5S7sICsj6epjh0PhAw" \
163+ dh_auto_configure -- --enable-qml-plugins \
164+ --with-twitter-consumer-key="NGOB5S7sICsj6epjh0PhAw" \
165 --with-twitter-consumer-secret="rbUEJCBEokMnGZd8bubd0QL2cSmoCjJeyiSJpnx3OM0" \
166 --with-windows-live-client-id="00000000400D5635" \
167 --with-foursquare-client-id="1I2UNJXPHNDZT3OPZOOA5LCPIUEUJFMKRXSF42UFCN1KXKTK" \
168
169=== added directory 'qml'
170=== added file 'qml/Makefile.am'
171--- qml/Makefile.am 1970-01-01 00:00:00 +0000
172+++ qml/Makefile.am 2013-06-12 05:52:26 +0000
173@@ -0,0 +1,5 @@
174+nobase_dist_qmlplugins_DATA = \
175+ facebook/Main.qml \
176+ flickr/Main.qml \
177+ google/Main.qml \
178+ twitter/Main.qml
179
180=== added directory 'qml/facebook'
181=== added file 'qml/facebook/Main.qml'
182--- qml/facebook/Main.qml 1970-01-01 00:00:00 +0000
183+++ qml/facebook/Main.qml 2013-06-12 05:52:26 +0000
184@@ -0,0 +1,33 @@
185+import Ubuntu.OnlineAccounts.Plugin 1.0
186+
187+OAuthMain {
188+ creationComponent: OAuth {
189+ function completeCreation(reply) {
190+ console.log("Access token: " + reply.AccessToken)
191+ var http = new XMLHttpRequest()
192+ var url = "https://graph.facebook.com/me?access_token=" + reply.AccessToken;
193+ http.open("GET", url, true);
194+ http.onreadystatechange = function() {
195+ if (http.readyState === 4){
196+ if (http.status == 200) {
197+ console.log("ok")
198+ console.log("response text: " + http.responseText)
199+ var response = JSON.parse(http.responseText)
200+ account.updateDisplayName(response.username)
201+ globalAccountService.updateSettings({
202+ 'id': response.id
203+ })
204+ account.synced.connect(finished)
205+ account.sync()
206+
207+ } else {
208+ console.log("error: " + http.status)
209+ cancel()
210+ }
211+ }
212+ };
213+
214+ http.send(null);
215+ }
216+ }
217+}
218
219=== added directory 'qml/flickr'
220=== added file 'qml/flickr/Main.qml'
221--- qml/flickr/Main.qml 1970-01-01 00:00:00 +0000
222+++ qml/flickr/Main.qml 2013-06-12 05:52:26 +0000
223@@ -0,0 +1,9 @@
224+import Ubuntu.OnlineAccounts.Plugin 1.0
225+
226+OAuthMain {
227+ creationComponent: OAuth {
228+ function getUserName(reply) {
229+ return reply.username
230+ }
231+ }
232+}
233
234=== added directory 'qml/google'
235=== added file 'qml/google/Main.qml'
236--- qml/google/Main.qml 1970-01-01 00:00:00 +0000
237+++ qml/google/Main.qml 2013-06-12 05:52:26 +0000
238@@ -0,0 +1,31 @@
239+import Ubuntu.OnlineAccounts.Plugin 1.0
240+
241+OAuthMain {
242+ creationComponent: OAuth {
243+ function completeCreation(reply) {
244+ console.log("Access token: " + reply.AccessToken)
245+ var http = new XMLHttpRequest()
246+ var url = "https://www.googleapis.com/oauth2/v3/userinfo";
247+ http.open("POST", url, true);
248+ http.setRequestHeader("Authorization", "Bearer " + reply.AccessToken)
249+ http.onreadystatechange = function() {
250+ if (http.readyState === 4){
251+ if (http.status == 200) {
252+ console.log("ok")
253+ console.log("response text: " + http.responseText)
254+ var response = JSON.parse(http.responseText)
255+ account.updateDisplayName(response.email)
256+ account.synced.connect(finished)
257+ account.sync()
258+
259+ } else {
260+ console.log("error: " + http.status)
261+ cancel()
262+ }
263+ }
264+ };
265+
266+ http.send(null);
267+ }
268+ }
269+}
270
271=== added directory 'qml/twitter'
272=== added file 'qml/twitter/Main.qml'
273--- qml/twitter/Main.qml 1970-01-01 00:00:00 +0000
274+++ qml/twitter/Main.qml 2013-06-12 05:52:26 +0000
275@@ -0,0 +1,3 @@
276+import Ubuntu.OnlineAccounts.Plugin 1.0
277+
278+OAuthMain {}

Subscribers

People subscribed via source and target branches

to all changes: