This file is indexed.

/usr/share/unity8/Wizard/Pages/40-location.qml is in unity8 8.12+16.04.20160401-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
/*
 * Copyright (C) 2013-2016 Canonical, Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 3.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import QtQuick 2.4
import AccountsService 0.1
import QMenuModel 0.1 as QMenuModel
import Qt.labs.folderlistmodel 2.1
import Ubuntu.Components 1.3
import ".." as LocalComponents

LocalComponents.Page {
    objectName: "locationPage"

    title: i18n.tr("Location Services")
    forwardButtonSourceComponent: forwardButton

    readonly property bool pathSet: AccountsService.hereLicensePathValid
    skipValid: pathSet && (AccountsService.hereLicensePath === "" || termsModel.count > 0)
    skip: skipValid && (AccountsService.hereLicensePath === "" || termsModel.count === 2) // no files but . and ..

    FolderListModel {
        id: termsModel
        folder: AccountsService.hereLicensePath
        nameFilters: ["*.html"]
        showOnlyReadable: true
        showDotAndDotDot: true // so that count == 0 means we're not done scanning yet
    }

    QMenuModel.QDBusActionGroup {
        id: locationActionGroup
        objectName: "locationActionGroup"
        busType: QMenuModel.DBus.SessionBus
        busName: "com.canonical.indicator.location"
        objectPath: "/com/canonical/indicator/location"
        property variant location: action("location-detection-enabled")
        property variant gps: action("gps-detection-enabled")
        Component.onCompleted: start()
    }

    Item {
        id: column
        anchors.fill: content
        anchors.topMargin: customMargin
        anchors.leftMargin: wideMode ? parent.leftMargin : 0
        anchors.rightMargin: wideMode ? parent.rightMargin : 0

        Item {
            id: hereCheckGroup
            anchors {
                left: parent.left
                right: parent.right
                top: parent.top
            }
            height: hereCheckLabel.height + hereTermsLabel.height

            Label {
                id: hereCheckLabel
                objectName: "hereCheckLabel"
                anchors {
                    left: parent.left
                    right: hereTermsCheck.left
                    top: parent.top
                    leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
                    rightMargin: units.gu(2)
                }
                lineHeight: 1.2
                wrapMode: Text.WordWrap
                color: textColor
                font.weight: checked ? Font.Normal : Font.Light
                text: i18n.tr("Use GPS, Wi-Fi hotspots and mobile network anonymously to detect location (recommended)")
                property bool checked: true
            }

            Label {
                id: hereTermsLabel
                objectName: "hereTermsLabel"
                anchors {
                    left: parent.left
                    right: hereTermsCheck.left
                    top: hereCheckLabel.bottom
                    topMargin: units.gu(1)
                    leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
                    rightMargin: units.gu(2)
                }

                wrapMode: Text.WordWrap
                color: textColor
                font.weight: Font.Light
                fontSize: "small"
                lineHeight: 1.2
                linkColor: UbuntuColors.orange
                text: i18n.tr("By selecting this option you agree to the Nokia HERE %1.")
                             .arg("<a href='#'>" + i18n.ctr("part of: Nokia HERE terms and conditions", "terms and conditions") + "</a>")
                Mouse.forwardTo: hereCheckArea // clicking on the link also selects this group
                Mouse.priority: Mouse.AfterItem
                onLinkActivated: {
                    pageStack.load(Qt.resolvedUrl("here-terms.qml"));
                }
            }

            Image {
                id: hereTermsCheck
                fillMode: Image.PreserveAspectFit
                height: units.gu(1.5)
                source: "data/Tick@30.png"
                opacity: hereCheckLabel.checked ? 1 : 0
                anchors.right: parent.right
                anchors.verticalCenter: hereCheckLabel.verticalCenter
                anchors.rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
            }

            MouseArea {
                id: hereCheckArea
                anchors.fill: parent
                z: hereCheckGroup.z - 1 // so that the link can be activated
                onClicked: {
                    if (!hereCheckLabel.checked) {
                        hereCheckLabel.checked = true;
                        gpsCheckLabel.checked = false;
                        nopeCheckLabel.checked = false;
                    }
                }
            }
        }

        Rectangle {
            id: divider
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.top: hereCheckGroup.bottom
            anchors.topMargin: units.gu(3)
            height: units.dp(1)
            color: dividerColor
        }

        Label {
            id: gpsCheckLabel
            objectName: "gpsCheckLabel"
            anchors {
                left: parent.left
                right: parent.right
                top: divider.bottom
                topMargin: units.gu(3)
                leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
                rightMargin: units.gu(2)
            }
            text: i18n.tr("GPS only")
            wrapMode: Text.WordWrap
            color: textColor
            font.weight: checked ? Font.Normal : Font.Light
            width: content.width
            property bool checked: false

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    if (!gpsCheckLabel.checked) {
                        hereCheckLabel.checked = false;
                        gpsCheckLabel.checked = true;
                        nopeCheckLabel.checked = false;
                    }
                }
            }
        }

        Image {
            fillMode: Image.PreserveAspectFit
            height: units.gu(1.5)
            source: "data/Tick@30.png"
            opacity: gpsCheckLabel.checked ? 1 : 0
            anchors.right: parent.right
            anchors.verticalCenter: gpsCheckLabel.verticalCenter
            anchors.rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
        }

        Rectangle {
            id: divider2
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.top: gpsCheckLabel.bottom
            anchors.topMargin: units.gu(3)
            height: units.dp(1)
            color: dividerColor
        }

        Label {
            id: nopeCheckLabel
            objectName: "nopeCheckLabel"
            anchors {
                left: parent.left
                right: parent.right
                top: divider2.bottom
                topMargin: units.gu(3)
                leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
                rightMargin: units.gu(2)
            }
            wrapMode: Text.WordWrap
            color: textColor
            font.weight: checked ? Font.Normal : Font.Light
            width: content.width
            text: i18n.tr("Don't use my location")
            property bool checked: false

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    if (!nopeCheckLabel.checked) {
                        hereCheckLabel.checked = false;
                        gpsCheckLabel.checked = false;
                        nopeCheckLabel.checked = true;
                    }
                }
            }
        }

        Image {
            fillMode: Image.PreserveAspectFit
            height: units.gu(1.5)
            source: "data/Tick@30.png"
            opacity: nopeCheckLabel.checked ? 1 : 0
            anchors.right: parent.right
            anchors.verticalCenter: nopeCheckLabel.verticalCenter
            anchors.rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
        }

        Rectangle {
            id: divider3
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.top: nopeCheckLabel.bottom
            anchors.topMargin: units.gu(3)
            height: units.dp(1)
            color: dividerColor
        }

        Label {
            id: infoLabel
            anchors {
                left: parent.left
                right: parent.right
                top: divider3.bottom
                topMargin: units.gu(4)
                leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
                rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
            }
            wrapMode: Text.Wrap
            text: i18n.tr("You can change it later in System Settings.")
            color: textColor
            fontSize: "small"
            font.weight: Font.Light
            width: content.width
        }
    }

    Component {
        id: forwardButton
        LocalComponents.StackButton {
            text: i18n.tr("Next")
            onClicked: {
                var locationOn = gpsCheckLabel.checked || hereCheckLabel.checked;
                var gpsOn = gpsCheckLabel.checked || hereCheckLabel.checked;
                var hereOn = hereCheckLabel.checked;

                // location service doesn't currently listen to updateState
                // requests, so we activate the actions if needed.
                if (locationActionGroup.location.state != locationOn) {
                    locationActionGroup.location.activate();
                }
                if (locationActionGroup.gps.state != gpsOn) {
                    locationActionGroup.gps.activate();
                }
                AccountsService.hereEnabled = hereOn;
                pageStack.next();
            }
        }
    }
}