From 0b9d01a1c0086cf934d32e8f992aed7d425beb87 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 7 Mar 2014 16:09:32 -0500 Subject: [PATCH] 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 file changed, 10 insertions(+), 8 deletions(-) diff --git a/js/gdm/util.js b/js/gdm/util.js index 5b769e069..79deafd5e 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() {