[gnome-shell/wip/wayland-gdm-cleanup: 4/19] gdm: Replace preemptingService with checks in getForegroundService



commit 5eb377bd3b50ac60a6fe688042e2f55d5fb560a0
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Mar 7 15:31:13 2014 -0500

    gdm: Replace preemptingService with checks in getForegroundService
    
    This removes a piece of the chicken-wire state machine to determine
    what the current foreground service should be.

 js/gdm/util.js |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 598cdb2..78dae28 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -288,8 +288,7 @@ const ShellUserVerifier = new Lang.Class({
             }));
     },
 
-    _oVirtUserAuthenticated: function(token) {
-        this._preemptingService = OVIRT_SERVICE_NAME;
+    _oVirtUserAuthenticated: function() {
         this.emit('ovirt-user-authenticated');
     },
 
@@ -305,12 +304,6 @@ const ShellUserVerifier = new Lang.Class({
 
         if (smartcardDetected != this.smartcardDetected) {
             this.smartcardDetected = smartcardDetected;
-
-            if (this.smartcardDetected)
-                this._preemptingService = SMARTCARD_SERVICE_NAME;
-            else if (this._preemptingService == SMARTCARD_SERVICE_NAME)
-                this._preemptingService = null;
-
             this.emit('smartcard-status-changed');
         }
     },
@@ -372,8 +365,10 @@ const ShellUserVerifier = new Lang.Class({
     },
 
     _getForegroundService: function() {
-        if (this._preemptingService)
-            return this._preemptingService;
+        if (this._oVirtCredentialsManager.hasToken())
+            return OVIRT_SERVICE_NAME;
+        if (this.smartcardDetected)
+            return SMARTCARD_SERVICE_NAME;
 
         return this._defaultService;
     },
@@ -542,7 +537,6 @@ const ShellUserVerifier = new Lang.Class({
         // mechanism.
         if (this.serviceIsForeground(OVIRT_SERVICE_NAME)) {
             this._oVirtCredentialsManager.resetToken();
-            this._preemptingService = null;
             this._verificationFailed(false);
             return;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]