[gnome-shell-extensions/minor-cleanups: 2/2] places-menu: Stop using deprecated Mainloop module



commit 4671c24b7806800f4f09f7ef9203ecd224cb2531
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 15 23:51:27 2019 +0100

    places-menu: Stop using deprecated Mainloop module
    
    Just use the underlying GLib functions directly.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/54

 extensions/places-menu/placeDisplay.js | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js
index dd00bbf..dbd3308 100644
--- a/extensions/places-menu/placeDisplay.js
+++ b/extensions/places-menu/placeDisplay.js
@@ -1,7 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const { Gio, GLib, Shell } = imports.gi;
-const Mainloop = imports.mainloop;
 const Signals = imports.signals;
 
 const Main = imports.ui.main;
@@ -286,11 +285,12 @@ var PlacesManager = class {
                 if (this._bookmarkTimeoutId > 0)
                     return;
                 /* Defensive event compression */
-                this._bookmarkTimeoutId = Mainloop.timeout_add(100, () => {
-                    this._bookmarkTimeoutId = 0;
-                    this._reloadBookmarks();
-                    return false;
-                });
+                this._bookmarkTimeoutId = GLib.timeout_add(
+                    GLib.PRIORITY_DEFAULT, 100, () => {
+                        this._bookmarkTimeoutId = 0;
+                        this._reloadBookmarks();
+                        return false;
+                    });
             });
 
             this._reloadBookmarks();
@@ -321,7 +321,7 @@ var PlacesManager = class {
         if (this._monitor)
             this._monitor.cancel();
         if (this._bookmarkTimeoutId)
-            Mainloop.source_remove(this._bookmarkTimeoutId);
+            GLib.source_remove(this._bookmarkTimeoutId);
     }
 
     _updateSpecials() {


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