on xenial help sign in
Do previous fix a cleaner way
ba7b25aMichael Terry
qml/Greeter/Greeter.qml+5−12
@@ -382,10 +382,6 @@ Showable {
382 }
382 }
383
383
384 onShowMessage: {
384 onShowMessage: {
385− if (!lightDM.greeter.active) {
386− return; // could happen if hideGreeter() comes in before we prompt
387− }
388−
389 // inefficient, but we only rarely deal with messages
385 // inefficient, but we only rarely deal with messages
390 var html = text.replace(/&/g, "&")
386 var html = text.replace(/&/g, "&")
391 .replace(/</g, "&lt;")
387 .replace(/</g, "&lt;")
@@ -395,20 +391,17 @@ Showable {
395 html = "<font color=\"#df382c\">" + html + "</font>";
391 html = "<font color=\"#df382c\">" + html + "</font>";
396 }
392 }
397
393
394+ if (loader.item) {
398− loader.item.showMessage(html);
395+ loader.item.showMessage(html);
396+ }
399 }
397 }
400
398
401 onShowPrompt: {
399 onShowPrompt: {
402 d.waiting = false;
400 d.waiting = false;
403
401
404− // Check root.required as well -- even though it's directly used to
402+ if (loader.item) {
405− // determine greeter.active -- because this callback can be made
403+ loader.item.showPrompt(text, isSecret, isDefaultPrompt);
406− // after required=true, but before greeter.active gets updated.
407− if (!LightDMService.greeter.active && !root.required) {
408− return; // could happen if hideGreeter() comes in before we prompt
409 }
404 }
410−
411− loader.item.showPrompt(text, isSecret, isDefaultPrompt);
412 }
405 }
413
406
414 onAuthenticationComplete: {
407 onAuthenticationComplete: {