[gnome-maps/wip/mlundblad/es6-modules: 21/22] sidebar: Stop using imports.mainloop




commit cff644fac4e76ea89d6a511169c857d3d397b735
Author: Marcus Lundblad <ml dfupdate se>
Date:   Thu May 26 21:58:58 2022 +0200

    sidebar: Stop using imports.mainloop
    
    Replace Mainloop.timeout_add() with GLib.timeout_add().

 src/sidebar.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/sidebar.js b/src/sidebar.js
index b8df6216..372ca737 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -22,9 +22,9 @@
 
 import Cairo from 'cairo';
 import Gdk from 'gi://Gdk';
+import GLib from 'gi://GLib';
 import GObject from 'gi://GObject';
 import Gtk from 'gi://Gtk';
-const Mainloop = imports.mainloop;
 
 import {Application} from './application.js';
 import {InstructionRow} from './instructionRow.js';
@@ -140,7 +140,7 @@ export class Sidebar extends Gtk.Revealer {
     }
 
     _cancelStore() {
-        Mainloop.source_remove(this._storeRouteTimeoutId);
+        GLib.source_remove(this._storeRouteTimeoutId);
         this._storeRouteTimeoutId = 0;
     }
 
@@ -298,7 +298,7 @@ export class Sidebar extends Gtk.Revealer {
             if (this._storeRouteTimeoutId)
                 this._cancelStore();
 
-            this._storeRouteTimeoutId = Mainloop.timeout_add(5000, () => {
+            this._storeRouteTimeoutId = GLib.timeout_add(null, 5000, () => {
                 let placeStore = Application.placeStore;
                 let places = this._query.filledPoints.map(function(point) {
                     return point.place;


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