@@ -16,7 +16,6 @@
1616
1717import QtQuick 2.3
1818import AccountsService 0.1
19−import LightDM 0.1 as LightDM
2019import Ubuntu.Components 1.1
2120import Ubuntu.SystemImage 0.1
2221import Unity.Launcher 0.1
@@ -43,7 +42,7 @@ Showable {
4342 readonly property bool hasLockedApp: lockedApp !== ""
4443
4544 property bool forcedUnlock
46− readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
45+ readonly property bool locked: lightDM.greeter.active && !lightDM.greeter.authenticated && !forcedUnlock
4746
4847 property bool tabletMode
4948 property url viewSource // only used for testing
@@ -106,10 +105,11 @@ Showable {
106105 return d.startUnlock(true /* toTheRight */);
107106 }
108107
108+ LightDM{id:lightDM} // Provide backend access
109109 QtObject {
110110 id: d
111111
112− readonly property bool multiUser: LightDM.Users.count > 1
112+ readonly property bool multiUser: lightDM.users.count > 1
113113 property int currentIndex
114114 property bool waiting
115115
@@ -133,15 +133,15 @@ Showable {
133133 loader.item.reset();
134134 }
135135 currentIndex = uid;
136− var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
136+ var user = lightDM.users.data(uid, lightDM.userRoles.NameRole);
137137 AccountsService.user = user;
138138 LauncherModel.setUser(user);
139− LightDM.Greeter.authenticate(user); // always resets auth state
139+ lightDM.greeter.authenticate(user); // always resets auth state
140140 }
141141
142142 function login() {
143143 enabled = false;
144− if (LightDM.Greeter.startSessionSync()) {
144+ if (lightDM.greeter.startSessionSync()) {
145145 sessionStarted();
146146 if (loader.item) {
147147 loader.item.notifyAuthenticationSucceeded();
@@ -228,7 +228,7 @@ Showable {
228228 root.lockedApp = "";
229229 root.forceActiveFocus();
230230 d.selectUser(d.currentIndex, true);
231− LightDM.Infographic.readyForDataChange();
231+ lightDM.infographic.readyForDataChange();
232232 }
233233
234234 Connections {
@@ -238,9 +238,9 @@ Showable {
238238 }
239239 onResponded: {
240240 if (root.locked) {
241− LightDM.Greeter.respond(response);
241+ lightDM.greeter.respond(response);
242242 } else {
243− if (LightDM.Greeter.active && !LightDM.Greeter.authenticated) { // could happen if forcedUnlock
243+ if (lightDM.greeter.active && !lightDM.greeter.authenticated) { // could happen if forcedUnlock
244244 d.login();
245245 }
246246 loader.item.hide();
@@ -306,18 +306,18 @@ Showable {
306306 Binding {
307307 target: loader.item
308308 property: "userModel"
309− value: LightDM.Users
309+ value: lightDM.users
310310 }
311311
312312 Binding {
313313 target: loader.item
314314 property: "infographicModel"
315− value: LightDM.Infographic
315+ value: lightDM.infographic
316316 }
317317 }
318318
319319 Connections {
320− target: LightDM.Greeter
320+ target: lightDM.greeter
321321
322322 onShowGreeter: root.forceShow()
323323
@@ -327,7 +327,7 @@ Showable {
327327 }
328328
329329 onShowMessage: {
330− if (!LightDM.Greeter.active) {
330+ if (!lightDM.greeter.active) {
331331 return; // could happen if hideGreeter() comes in before we prompt
332332 }
333333
@@ -346,7 +346,7 @@ Showable {
346346 onShowPrompt: {
347347 d.waiting = false;
348348
349− if (!LightDM.Greeter.active) {
349+ if (!lightDM.greeter.active) {
350350 return; // could happen if hideGreeter() comes in before we prompt
351351 }
352352
@@ -356,14 +356,14 @@ Showable {
356356 onAuthenticationComplete: {
357357 d.waiting = false;
358358
359− if (LightDM.Greeter.authenticated) {
359+ if (lightDM.greeter.authenticated) {
360360 AccountsService.failedLogins = 0;
361361 d.login();
362− if (!LightDM.Greeter.promptless) {
362+ if (!lightDM.greeter.promptless) {
363363 loader.item.hide();
364364 }
365365 } else {
366− if (!LightDM.Greeter.promptless) {
366+ if (!lightDM.greeter.promptless) {
367367 AccountsService.failedLogins++;
368368 }
369369
@@ -384,7 +384,7 @@ Showable {
384384 }
385385
386386 loader.item.notifyAuthenticationFailed();
387− if (!LightDM.Greeter.promptless) {
387+ if (!lightDM.greeter.promptless) {
388388 d.selectUser(d.currentIndex, false);
389389 }
390390 }
@@ -392,8 +392,8 @@ Showable {
392392
393393 onRequestAuthenticationUser: {
394394 // Find index for requested user, if it exists
395− for (var i = 0; i < LightDM.Users.count; i++) {
396− if (user === LightDM.Users.data(i, LightDM.UserRoles.NameRole)) {
395+ for (var i = 0; i < lightDM.users.count; i++) {
396+ if (user === lightDM.users.data(i, lightDM.userRoles.NameRole)) {
397397 d.selectUser(i, true);
398398 return;
399399 }
@@ -402,19 +402,19 @@ Showable {
402402 }
403403
404404 Binding {
405− target: LightDM.Greeter
405+ target: lightDM.greeter
406406 property: "active"
407407 value: root.active
408408 }
409409
410410 Binding {
411− target: LightDM.Infographic
411+ target: lightDM.infographic
412412 property: "username"
413− value: AccountsService.statsWelcomeScreen ? LightDM.Users.data(d.currentIndex, LightDM.UserRoles.NameRole) : ""
413+ value: AccountsService.statsWelcomeScreen ? lightDM.users.data(d.currentIndex, lightDM.userRoles.NameRole) : ""
414414 }
415415
416416 Connections {
417417 target: i18n
418− onLanguageChanged: LightDM.Infographic.readyForDataChange()
418+ onLanguageChanged: lightDM.infographic.readyForDataChange()
419419 }
420420}