on xenial help sign in
Remove here
5ec8526Marius Gripsgard
plugins/AccountsService/AccountsService.cpp−29
@@ -25,7 +25,6 @@
25#include <glib.h>
25#include <glib.h>
26
26
27#define IFACE_ACCOUNTS_USER QStringLiteral("org.freedesktop.Accounts.User")
27#define IFACE_ACCOUNTS_USER QStringLiteral("org.freedesktop.Accounts.User")
28−#define IFACE_LOCATION_HERE QStringLiteral("com.ubuntu.location.providers.here.AccountsService")
29#define IFACE_UBUNTU_INPUT QStringLiteral("com.ubuntu.AccountsService.Input")
28#define IFACE_UBUNTU_INPUT QStringLiteral("com.ubuntu.AccountsService.Input")
30#define IFACE_UBUNTU_SECURITY QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy")
29#define IFACE_UBUNTU_SECURITY QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy")
31#define IFACE_UBUNTU_SECURITY_OLD QStringLiteral("com.ubuntu.touch.AccountsService.SecurityPrivacy")
30#define IFACE_UBUNTU_SECURITY_OLD QStringLiteral("com.ubuntu.touch.AccountsService.SecurityPrivacy")
@@ -93,8 +92,6 @@ AccountsService::AccountsService(QObject* parent, const QString &user)
93 registerProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, QStringLiteral("emailChanged"));
92 registerProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, QStringLiteral("emailChanged"));
94 registerProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME, QStringLiteral("realNameChanged"));
93 registerProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME, QStringLiteral("realNameChanged"));
95 registerProperty(IFACE_ACCOUNTS_USER, PROP_INPUT_SOURCES, QStringLiteral("keymapsChanged"));
94 registerProperty(IFACE_ACCOUNTS_USER, PROP_INPUT_SOURCES, QStringLiteral("keymapsChanged"));
96− registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, QStringLiteral("hereEnabledChanged"));
97− registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH, QStringLiteral("hereLicensePathChanged"));
98 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_FINGERPRINT_IDENTIFICATION, QStringLiteral("enableFingerprintIdentificationChanged"));
95 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_FINGERPRINT_IDENTIFICATION, QStringLiteral("enableFingerprintIdentificationChanged"));
99 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_LAUNCHER_WHILE_LOCKED, QStringLiteral("enableLauncherWhileLockedChanged"));
96 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_LAUNCHER_WHILE_LOCKED, QStringLiteral("enableLauncherWhileLockedChanged"));
100 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_INDICATORS_WHILE_LOCKED, QStringLiteral("enableIndicatorsWhileLockedChanged"));
97 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_INDICATORS_WHILE_LOCKED, QStringLiteral("enableIndicatorsWhileLockedChanged"));
@@ -216,32 +213,6 @@ AccountsService::PasswordDisplayHint AccountsService::passwordDisplayHint() cons
216 return (PasswordDisplayHint)value.toInt();
213 return (PasswordDisplayHint)value.toInt();
217}
214}
218
215
219−bool AccountsService::hereEnabled() const
220−{
221− auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED);
222− return value.toBool();
223−}
224−
225−void AccountsService::setHereEnabled(bool enabled)
226−{
227− setProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, enabled);
228−}
229−
230−QString AccountsService::hereLicensePath() const
231−{
232− auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH);
233− QString hereLicensePath = value.toString();
234− if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
235− hereLicensePath = QStringLiteral("");
236− return hereLicensePath;
237−}
238−
239−bool AccountsService::hereLicensePathValid() const
240−{
241− auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH);
242− return !value.toString().isNull();
243−}
244−
245QString AccountsService::realName() const
216QString AccountsService::realName() const
246{
217{
247 auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME);
218 auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME);
plugins/AccountsService/AccountsService.h−16
@@ -66,16 +66,6 @@ class AccountsService: public QObject
66 READ failedFingerprintLogins
66 READ failedFingerprintLogins
67 WRITE setFailedFingerprintLogins
67 WRITE setFailedFingerprintLogins
68 NOTIFY failedFingerprintLoginsChanged)
68 NOTIFY failedFingerprintLoginsChanged)
69− Q_PROPERTY(bool hereEnabled
70− READ hereEnabled
71− WRITE setHereEnabled
72− NOTIFY hereEnabledChanged)
73− Q_PROPERTY(QString hereLicensePath
74− READ hereLicensePath
75− NOTIFY hereLicensePathChanged)
76− Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
77− READ hereLicensePathValid
78− NOTIFY hereLicensePathChanged)
79 Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
69 Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
80 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
70 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
81 Q_PROPERTY(QStringList keymaps READ keymaps WRITE setKeymaps NOTIFY keymapsChanged)
71 Q_PROPERTY(QStringList keymaps READ keymaps WRITE setKeymaps NOTIFY keymapsChanged)
@@ -106,10 +96,6 @@ public:
106 void setFailedLogins(uint failedLogins);
96 void setFailedLogins(uint failedLogins);
107 uint failedFingerprintLogins() const;
97 uint failedFingerprintLogins() const;
108 void setFailedFingerprintLogins(uint failedFingerprintLogins);
98 void setFailedFingerprintLogins(uint failedFingerprintLogins);
109− bool hereEnabled() const;
110− void setHereEnabled(bool enabled);
111− QString hereLicensePath() const;
112− bool hereLicensePathValid() const;
113 QString realName() const;
99 QString realName() const;
114 void setRealName(const QString &realName);
100 void setRealName(const QString &realName);
115 QString email() const;
101 QString email() const;
@@ -129,8 +115,6 @@ Q_SIGNALS:
129 void passwordDisplayHintChanged();
115 void passwordDisplayHintChanged();
130 void failedLoginsChanged();
116 void failedLoginsChanged();
131 void failedFingerprintLoginsChanged();
117 void failedFingerprintLoginsChanged();
132− void hereEnabledChanged();
133− void hereLicensePathChanged();
134 void realNameChanged();
118 void realNameChanged();
135 void emailChanged();
119 void emailChanged();
136 void keymapsChanged();
120 void keymapsChanged();
qml/Wizard/Pages/here-terms.qmldeleted−126
@@ -1,126 +0,0 @@
1−/*
2− * Copyright (C) 2014-2016 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−import QtQuick 2.4
18−import Ubuntu.Components 1.3
19−import Ubuntu.Web 0.2
20−import ".." as LocalComponents
21−
22−LocalComponents.Page {
23− objectName: "hereTermsPage"
24−
25− title: i18n.tr("Terms & Conditions")
26− customBack: true
27− customTitle: true
28−
29− onBackClicked: {
30− if (webview.visible) {
31− showBrowser(false);
32− } else {
33− pageStack.prev();
34− }
35− }
36−
37− function showBrowser(show) {
38− if (show) {
39− label1.visible = false;
40− label2.visible = false;
41− label3.visible = false;
42− label4.visible = false;
43− webview.visible = true;
44− } else {
45− webview.visible = false;
46− label1.visible = true;
47− label2.visible = true;
48− label3.visible = true;
49− label4.visible = true;
50− }
51− }
52−
53− Column {
54− id: column
55− anchors.fill: content
56− anchors.leftMargin: staticMargin
57− anchors.rightMargin: wideMode ? parent.rightMargin : staticMargin
58− spacing: units.gu(3)
59−
60− Label {
61− id: label1
62− anchors.left: parent.left
63− anchors.right: parent.right
64− wrapMode: Text.Wrap
65− color: textColor
66− fontSize: "small"
67− font.weight: Font.Light
68− lineHeight: 1.2
69− text: i18n.tr("Your device uses positioning technologies provided by HERE.")
70− }
71−
72− Label {
73− id: label2
74− anchors.left: parent.left
75− anchors.right: parent.right
76− wrapMode: Text.Wrap
77− color: textColor
78− fontSize: "small"
79− font.weight: Font.Light
80− lineHeight: 1.2
81− text: i18n.tr("To provide you with positioning services and to improve their quality, HERE collects information about nearby cell towers and Wi-Fi hotspots around your current location whenever your position is being found.")
82− }
83−
84− Label {
85− id: label3
86− anchors.left: parent.left
87− anchors.right: parent.right
88− wrapMode: Text.Wrap
89− color: textColor
90− fontSize: "small"
91− font.weight: Font.Light
92− lineHeight: 1.2
93− text: i18n.tr("The information collected is used to analyze the service and to improve the use of service, but not to identify you personally.")
94− }
95−
96− Label {
97− id: label4
98− anchors.left: parent.left
99− anchors.right: parent.right
100− wrapMode: Text.Wrap
101− color: textColor
102− fontSize: "small"
103− font.weight: Font.Light
104− lineHeight: 1.2
105− linkColor: UbuntuColors.orange
106− text: i18n.tr("By continuing, you agree to the HERE platform %1 and %2.")
107− .arg("<a href=\"http://here.com/terms/service-terms\">" + i18n.tr("Service Terms") + "</a>")
108− .arg("<a href=\"http://here.com/privacy/privacy-policy\">" + i18n.tr("Privacy Policy") + "</a>");
109− onLinkActivated: {
110− showBrowser(true);
111− webview.url = link;
112− }
113− }
114−
115− WebView {
116− id: webview
117− objectName: "webview"
118− anchors.left: parent.left
119− anchors.right: parent.right
120− anchors.leftMargin: -leftMargin
121− anchors.rightMargin: -rightMargin
122− height: parent.height
123− visible: false
124− }
125− }
126−}
tests/mocks/AccountsService/AccountsService.cpp−36
@@ -31,8 +31,6 @@ AccountsService::AccountsService(QObject* parent)
31 m_failedFingerprintLogins(0),
31 m_failedFingerprintLogins(0),
32 m_demoEdges(false),
32 m_demoEdges(false),
33 m_demoEdgesCompleted(),
33 m_demoEdgesCompleted(),
34− m_hereEnabled(false),
35− m_hereLicensePath(""),
36 m_usersModel(new UsersModel(this))
34 m_usersModel(new UsersModel(this))
37{
35{
38}
36}
@@ -176,40 +174,6 @@ void AccountsService::setFailedFingerprintLogins(uint failedFingerprintLogins)
176 failedFingerprintLoginsChanged();
174 failedFingerprintLoginsChanged();
177}
175}
178
176
179−bool AccountsService::hereEnabled() const
180−{
181− return m_hereEnabled;
182−}
183−
184−void AccountsService::setHereEnabled(bool enabled)
185−{
186− m_hereEnabled = enabled;
187− hereEnabledChanged();
188−}
189−
190−QString AccountsService::hereLicensePath() const
191−{
192− return m_hereLicensePath;
193−}
194−
195−void AccountsService::setHereLicensePath(const QString &path)
196−{
197− // Path should always be valid (this code is all synchronous)
198− if (path == " ") {
199− m_hereLicensePath = QString::null;
200− } else if (path.isNull()) { // because qml collapses null and empty
201− m_hereLicensePath = "";
202− } else {
203− m_hereLicensePath = path;
204− }
205− hereLicensePathChanged();
206−}
207−
208−bool AccountsService::hereLicensePathValid() const
209−{
210− return !m_hereLicensePath.isNull();
211−}
212−
213QString AccountsService::realName() const
177QString AccountsService::realName() const
214{
178{
215 return m_realName;
179 return m_realName;
tests/mocks/AccountsService/AccountsService.h−20
@@ -69,17 +69,6 @@ class AccountsService: public QObject
69 READ failedFingerprintLogins
69 READ failedFingerprintLogins
70 WRITE setFailedFingerprintLogins
70 WRITE setFailedFingerprintLogins
71 NOTIFY failedFingerprintLoginsChanged)
71 NOTIFY failedFingerprintLoginsChanged)
72− Q_PROPERTY(bool hereEnabled
73− READ hereEnabled
74− WRITE setHereEnabled
75− NOTIFY hereEnabledChanged)
76− Q_PROPERTY(QString hereLicensePath
77− READ hereLicensePath
78− WRITE setHereLicensePath // only available in mock
79− NOTIFY hereLicensePathChanged)
80− Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
81− READ hereLicensePathValid
82− NOTIFY hereLicensePathChanged)
83 Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
72 Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
84 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
73 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
85 Q_PROPERTY(QStringList keymaps
74 Q_PROPERTY(QStringList keymaps
@@ -118,11 +107,6 @@ public:
118 void setFailedLogins(uint failedLogins);
107 void setFailedLogins(uint failedLogins);
119 uint failedFingerprintLogins() const;
108 uint failedFingerprintLogins() const;
120 void setFailedFingerprintLogins(uint failedFingerprintLogins);
109 void setFailedFingerprintLogins(uint failedFingerprintLogins);
121− bool hereEnabled() const;
122− void setHereEnabled(bool enabled);
123− QString hereLicensePath() const;
124− void setHereLicensePath(const QString &path);
125− bool hereLicensePathValid() const;
126 QString realName() const;
110 QString realName() const;
127 void setRealName(const QString &realName);
111 void setRealName(const QString &realName);
128 QString email() const;
112 QString email() const;
@@ -142,8 +126,6 @@ Q_SIGNALS:
142 void passwordDisplayHintChanged();
126 void passwordDisplayHintChanged();
143 void failedLoginsChanged();
127 void failedLoginsChanged();
144 void failedFingerprintLoginsChanged();
128 void failedFingerprintLoginsChanged();
145− void hereEnabledChanged();
146− void hereLicensePathChanged();
147 void realNameChanged();
129 void realNameChanged();
148 void emailChanged();
130 void emailChanged();
149 void keymapsChanged();
131 void keymapsChanged();
@@ -159,8 +141,6 @@ private:
159 uint m_failedFingerprintLogins;
141 uint m_failedFingerprintLogins;
160 bool m_demoEdges;
142 bool m_demoEdges;
161 QStringList m_demoEdgesCompleted;
143 QStringList m_demoEdgesCompleted;
162− bool m_hereEnabled;
163− QString m_hereLicensePath;
164 QString m_realName;
144 QString m_realName;
165 QStringList m_kbdMap;
145 QStringList m_kbdMap;
166 QString m_email;
146 QString m_email;
tests/plugins/AccountsService/client.cpp−28
@@ -116,10 +116,6 @@ private Q_SLOTS:
116 QCOMPARE(session.failedLogins(), (uint)0);
116 QCOMPARE(session.failedLogins(), (uint)0);
117 session.setFailedLogins(5);
117 session.setFailedLogins(5);
118 QCOMPARE(session.failedLogins(), (uint)5);
118 QCOMPARE(session.failedLogins(), (uint)5);
119−
120− QCOMPARE(session.hereEnabled(), false);
121− session.setHereEnabled(true);
122− QCOMPARE(session.hereEnabled(), true);
123 }
119 }
124
120
125 void testMarkDemoEdgeCompleted()
121 void testMarkDemoEdgeCompleted()
@@ -231,30 +227,6 @@ private Q_SLOTS:
231 QTRY_COMPARE(session.passwordDisplayHint(), AccountsService::Numeric);
227 QTRY_COMPARE(session.passwordDisplayHint(), AccountsService::Numeric);
232 }
228 }
233
229
234− void testAsynchronousChangeForLicenseAccepted()
235− {
236− AccountsService session(this, QTest::currentTestFunction());
237−
238− QCOMPARE(session.hereEnabled(), false);
239− ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
240− "com.ubuntu.location.providers.here.AccountsService",
241− "LicenseAccepted",
242− dbusVariant(true)));
243− QTRY_COMPARE(session.hereEnabled(), true);
244− }
245−
246− void testAsynchronousChangeForLicenseBasePath()
247− {
248− AccountsService session(this, QTest::currentTestFunction());
249−
250− QCOMPARE(session.hereLicensePath(), QString());
251− ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
252− "com.ubuntu.location.providers.here.AccountsService",
253− "LicenseBasePath",
254− dbusVariant("/")));
255− QTRY_COMPARE(session.hereLicensePath(), QString("/"));
256− }
257−
258 void testAsynchronousChangeForBackgroundFile()
230 void testAsynchronousChangeForBackgroundFile()
259 {
231 {
260 AccountsService session(this, QTest::currentTestFunction());
232 AccountsService session(this, QTest::currentTestFunction());
tests/qmltests/Wizard/tst_Wizard.qml−29
@@ -87,8 +87,6 @@ Item {
87 }
87 }
88
88
89 function setup() {
89 function setup() {
90− AccountsService.hereEnabled = false;
91− AccountsService.hereLicensePath = Qt.resolvedUrl("licenses");
92 i18n.language = "en";
90 i18n.language = "en";
93 MockQOfono.setModems(["sim1"], [false], []);
91 MockQOfono.setModems(["sim1"], [false], []);
94 MockQOfono.available = true;
92 MockQOfono.available = true;
@@ -395,7 +393,6 @@ Item {
395 function test_locationGpsOnly() {
393 function test_locationGpsOnly() {
396 var page = goToPage("locationPage");
394 var page = goToPage("locationPage");
397 var gpsCheck = findChild(page, "gpsCheckLabel");
395 var gpsCheck = findChild(page, "gpsCheckLabel");
398− var hereCheck = findChild(page, "hereCheckLabel");
399 var nopeCheck = findChild(page, "nopeCheckLabel");
396 var nopeCheck = findChild(page, "nopeCheckLabel");
400
397
401 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
398 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
@@ -404,11 +401,9 @@ Item {
404
401
405 tap(gpsCheck);
402 tap(gpsCheck);
406 tryCompare(gpsCheck, "checked", true);
403 tryCompare(gpsCheck, "checked", true);
407− tryCompare(hereCheck, "checked", false);
408 tryCompare(nopeCheck, "checked", false);
404 tryCompare(nopeCheck, "checked", false);
409
405
410 tap(findChild(page, "forwardButton"));
406 tap(findChild(page, "forwardButton"));
411− tryCompare(AccountsService, "hereEnabled", false);
412 tryCompare(activateLocationSpy, "count", 1)
407 tryCompare(activateLocationSpy, "count", 1)
413 tryCompare(activateGPSSpy, "count", 1)
408 tryCompare(activateGPSSpy, "count", 1)
414 }
409 }
@@ -416,7 +411,6 @@ Item {
416 function test_locationNope() {
411 function test_locationNope() {
417 var page = goToPage("locationPage");
412 var page = goToPage("locationPage");
418 var gpsCheck = findChild(page, "gpsCheckLabel");
413 var gpsCheck = findChild(page, "gpsCheckLabel");
419− var hereCheck = findChild(page, "hereCheckLabel");
420 var nopeCheck = findChild(page, "nopeCheckLabel");
414 var nopeCheck = findChild(page, "nopeCheckLabel");
421
415
422 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
416 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
@@ -425,36 +419,13 @@ Item {
425
419
426 tap(nopeCheck);
420 tap(nopeCheck);
427 tryCompare(gpsCheck, "checked", false);
421 tryCompare(gpsCheck, "checked", false);
428− tryCompare(hereCheck, "checked", false);
429 tryCompare(nopeCheck, "checked", true);
422 tryCompare(nopeCheck, "checked", true);
430
423
431 tap(findChild(page, "forwardButton"));
424 tap(findChild(page, "forwardButton"));
432− tryCompare(AccountsService, "hereEnabled", false);
433 tryCompare(activateLocationSpy, "count", 0);
425 tryCompare(activateLocationSpy, "count", 0);
434 tryCompare(activateGPSSpy, "count", 0);
426 tryCompare(activateGPSSpy, "count", 0);
435 }
427 }
436
428
437− function test_locationHere() {
438− var page = goToPage("locationPage");
439− var gpsCheck = findChild(page, "gpsCheckLabel");
440− var hereCheck = findChild(page, "hereCheckLabel");
441− var nopeCheck = findChild(page, "nopeCheckLabel");
442−
443− var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
444− activateLocationSpy.target = locationActionGroup.location;
445− activateGPSSpy.target = locationActionGroup.gps;
446−
447− // no tap because HERE is the default
448− tryCompare(gpsCheck, "checked", false);
449− tryCompare(hereCheck, "checked", true);
450− tryCompare(nopeCheck, "checked", false);
451−
452− tap(findChild(page, "forwardButton"));
453− tryCompare(AccountsService, "hereEnabled", true);
454− tryCompare(activateLocationSpy, "count", 1);
455− tryCompare(activateGPSSpy, "count", 1);
456− }
457−
458 function test_timezonePage() {
429 function test_timezonePage() {
459 var page = goToPage("tzPage");
430 var page = goToPage("tzPage");
460 verify(page);
431 verify(page);