@@ -25,7 +25,6 @@ Showable {
2525 id: root
2626 created: loader.status == Loader.Ready
2727
28− LightDMGreeterAPI{id:lightDMGreeterAPI}
2928 property real dragHandleLeftMargin: 0
3029
3130 property url background
@@ -43,7 +42,7 @@ Showable {
4342 readonly property bool hasLockedApp: lockedApp !== ""
4443
4544 property bool forcedUnlock
46− readonly property bool locked: lightDMGreeterAPI.active && !lightDMGreeterAPI.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
@@ -104,10 +103,11 @@ Showable {
104103 return d.startUnlock(true /* toTheRight */);
105104 }
106105
106+ LightDM{id:lightDM} // Provide backend access
107107 QtObject {
108108 id: d
109109
110− readonly property bool multiUser: lightDMGreeterAPI.userCount > 1
110+ readonly property bool multiUser: lightDM.users.count > 1
111111 property int currentIndex
112112 property bool waiting
113113
@@ -131,15 +131,15 @@ Showable {
131131 loader.item.reset();
132132 }
133133 currentIndex = uid;
134− var user = lightDMGreeterAPI.getUsername(uid);
134+ var user = lightDM.users.data(uid);
135135 AccountsService.user = user;
136136 LauncherModel.setUser(user);
137− lightDMGreeterAPI.authenticate(user); // always resets auth state
137+ lightDM.greeter.authenticate(user); // always resets auth state
138138 }
139139
140140 function login() {
141141 enabled = false;
142− if (lightDMGreeterAPI.startSessionSync()) {
142+ if (lightDM.greeter.startSessionSync()) {
143143 sessionStarted();
144144 if (loader.item) {
145145 loader.item.notifyAuthenticationSucceeded();
@@ -226,7 +226,7 @@ Showable {
226226 root.lockedApp = "";
227227 root.forceActiveFocus();
228228 d.selectUser(d.currentIndex, true);
229− lightDMGreeterAPI.infographicReadyForDataChange();
229+ lightDM.infographic.readyForDataChange();
230230 }
231231
232232 Connections {
@@ -236,9 +236,9 @@ Showable {
236236 }
237237 onResponded: {
238238 if (root.locked) {
239− lightDMGreeterAPI.respond(response);
239+ lightDM.greeter.respond(response);
240240 } else {
241− if (lightDMGreeterAPI.active && !lightDMGreeterAPI.authenticated) { // could happen if forcedUnlock
241+ if (lightDM.greeter.active && !lightDM.greeter.authenticated) { // could happen if forcedUnlock
242242 d.login();
243243 }
244244 loader.item.hide();
@@ -304,18 +304,18 @@ Showable {
304304 Binding {
305305 target: loader.item
306306 property: "userModel"
307− value: lightDMGreeterAPI.userModel
307+ value: lightDM.users.model
308308 }
309309
310310 Binding {
311311 target: loader.item
312312 property: "infographicModel"
313− value: lightDMGreeterAPI.infographicModel
313+ value: lightDM.infographic.model
314314 }
315315 }
316316
317317 Connections {
318− target: lightDMGreeterAPI.theGreeter
318+ target: lightDM.greeter.singelton
319319
320320 onShowGreeter: root.forceShow()
321321
@@ -325,7 +325,7 @@ Showable {
325325 }
326326
327327 onShowMessage: {
328− if (!lightDMGreeterAPI.active) {
328+ if (!lightDM.greeter.active) {
329329 return; // could happen if hideGreeter() comes in before we prompt
330330 }
331331
@@ -344,7 +344,7 @@ Showable {
344344 onShowPrompt: {
345345 d.waiting = false;
346346
347− if (!lightDMGreeterAPI.active) {
347+ if (!lightDM.greeter.active) {
348348 return; // could happen if hideGreeter() comes in before we prompt
349349 }
350350
@@ -354,14 +354,14 @@ Showable {
354354 onAuthenticationComplete: {
355355 d.waiting = false;
356356
357− if (lightDMGreeterAPI.authenticated) {
357+ if (lightDM.greeter.authenticated) {
358358 AccountsService.failedLogins = 0;
359359 d.login();
360− if (!lightDMGreeterAPI.promptless) {
360+ if (!lightDM.greeter.promptless) {
361361 loader.item.hide();
362362 }
363363 } else {
364− if (!lightDMGreeterAPI.promptless) {
364+ if (!lightDM.greeter.promptless) {
365365 AccountsService.failedLogins++;
366366 }
367367
@@ -382,7 +382,7 @@ Showable {
382382 }
383383
384384 loader.item.notifyAuthenticationFailed();
385− if (!lightDMGreeterAPI.promptless) {
385+ if (!lightDM.greeter.promptless) {
386386 d.selectUser(d.currentIndex, false);
387387 }
388388 }
@@ -390,8 +390,8 @@ Showable {
390390
391391 onRequestAuthenticationUser: {
392392 // Find index for requested user, if it exists
393− for (var i = 0; i < lightDMGreeterAPI.userCount; i++) {
394− if (user === lightDMGreeterAPI.getUsername(i)) {
393+ for (var i = 0; i < lightDM.users.count; i++) {
394+ if (user === lightDM.users.data(i)) {
395395 d.selectUser(i, true);
396396 return;
397397 }
@@ -400,19 +400,19 @@ Showable {
400400 }
401401
402402 Binding {
403− target: lightDMGreeterAPI.theGreeter
403+ target: lightDM.greeter
404404 property: "active"
405405 value: root.active
406406 }
407407
408408 Binding {
409− target: lightDMGreeterAPI.infographicModel
409+ target: lightDM.infographic
410410 property: "username"
411− value: AccountsService.statsWelcomeScreen ? lightDMGreeterAPI.getUsername(d.currentIndex) : ""
411+ value: AccountsService.statsWelcomeScreen ? lightDM.users.data(d.currentIndex) : ""
412412 }
413413
414414 Connections {
415415 target: i18n
416− onLanguageChanged: lightDMGreeterAPI.infographicReadyForDataChange()
416+ onLanguageChanged: lightDM.infographic.readyForDataChange()
417417 }
418418}