cleanup: Stop using Mainloop module

It is deprecated in favor of the regular GLib functions.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/718
This commit is contained in:
Florian Müllner
2019-08-19 20:50:33 +02:00
parent 4525ad346d
commit 2fc4987c73
30 changed files with 151 additions and 165 deletions

View File

@ -1,7 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported NMApplet */
const { Clutter, Gio, GLib, GObject, NM, St } = imports.gi;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
const Animation = imports.ui.animation;
@ -719,7 +718,7 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
this._updateSensitivity();
this._syncView();
this._scanTimeoutId = Mainloop.timeout_add_seconds(15, this._onScanTimeout.bind(this));
this._scanTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 15, this._onScanTimeout.bind(this));
GLib.Source.set_name_by_id(this._scanTimeoutId, '[gnome-shell] this._onScanTimeout');
this._onScanTimeout();
@ -757,7 +756,7 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
}
if (this._scanTimeoutId) {
Mainloop.source_remove(this._scanTimeoutId);
GLib.source_remove(this._scanTimeoutId);
this._scanTimeoutId = 0;
}
}