mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
misc: Don't call disconnectAll on token proxy objects
The disconnectAll method is a method available to javascript] objects that want gobject-ish signal handling features. It is not a method available to GObjects come from introspection. "token" objects in the smartcard manager code are just plain old GDBusProxy objects and so don't have disconnectAll methods. This commit changes the code to use a direct disconnect call for the one pertinent signal connection instead.
This commit is contained in:
parent
4598d7aa5f
commit
2391497f60
1 changed files with 6 additions and 3 deletions
|
|
@ -78,7 +78,7 @@ class SmartcardManager extends Signals.EventEmitter {
|
||||||
_addToken(token) {
|
_addToken(token) {
|
||||||
this._updateToken(token);
|
this._updateToken(token);
|
||||||
|
|
||||||
token.connect('g-properties-changed', (proxy, properties) => {
|
token._smartcardSignalId = token.connect('g-properties-changed', (proxy, properties) => {
|
||||||
const isInsertedChanged = !!properties.lookup_value('IsInserted', null);
|
const isInsertedChanged = !!properties.lookup_value('IsInserted', null);
|
||||||
if (isInsertedChanged) {
|
if (isInsertedChanged) {
|
||||||
this._updateToken(token);
|
this._updateToken(token);
|
||||||
|
|
@ -103,10 +103,13 @@ class SmartcardManager extends Signals.EventEmitter {
|
||||||
this.emit('smartcard-removed', token);
|
this.emit('smartcard-removed', token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (token._smartcardSignalId) {
|
||||||
|
token.disconnect(token._smartcardSignalId);
|
||||||
|
delete token._smartcardSignalId;
|
||||||
|
}
|
||||||
|
|
||||||
if (this._loginToken === token)
|
if (this._loginToken === token)
|
||||||
this._loginToken = null;
|
this._loginToken = null;
|
||||||
|
|
||||||
token.disconnectAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hasInsertedTokens() {
|
hasInsertedTokens() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue