[gnome-shell/wip/wayland-gdm-cleanup: 11/19] gdm: Merge some duplicate code



commit 0b9d01a1c0086cf934d32e8f992aed7d425beb87
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Mar 7 16:09:32 2014 -0500

    gdm: Merge some duplicate code
    
    Do a reset at initialization time.
    
    Technically, this isn't needed, since to start the process we'll need
    to reset(); anyway after all the signals have connected, but this helps
    the code be clean.

 js/gdm/util.js |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 5b769e0..79deafd 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -131,7 +131,6 @@ const ShellUserVerifier = new Lang.Class({
         this._settings = new Gio.Settings({ schema: LOGIN_SCREEN_SCHEMA });
         this._settings.connect('changed',
                                Lang.bind(this, this._updateDefaultService));
-        this._updateDefaultService();
 
         this._fprintManager = new Fprint.FprintManager();
         this._smartcardManager = SmartcardManager.getSmartcardManager();
@@ -152,8 +151,6 @@ const ShellUserVerifier = new Lang.Class({
         this.hasPendingMessages = false;
         this.reauthenticating = false;
 
-        this._failCounter = 0;
-
         this._oVirtCredentialsManager = OVirt.getOVirtCredentialsManager();
 
         if (this._oVirtCredentialsManager.hasToken())
@@ -161,6 +158,15 @@ const ShellUserVerifier = new Lang.Class({
 
         this._oVirtCredentialsManager.connect('user-authenticated',
                                               Lang.bind(this, this._oVirtUserAuthenticated));
+
+        this._reset();
+    },
+
+    _reset: function() {
+        // Clear previous attempts to authenticate
+        this._failCounter = 0;
+        this._updateDefaultService();
+        this.emit('reset');
     },
 
     begin: function(userName) {
@@ -472,11 +478,7 @@ const ShellUserVerifier = new Lang.Class({
     },
 
     _onReset: function() {
-        // Clear previous attempts to authenticate
-        this._failCounter = 0;
-        this._updateDefaultService();
-
-        this.emit('reset');
+        this._reset();
     },
 
     _onVerificationComplete: function() {


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