[gnome-maps/wip/mlundblad/es6-modules: 1/19] application: Use string templates instead of imports.format




commit 9dfa15c39850b865d0d9f4b2641fb2af165d5161
Author: Marcus Lundblad <ml dfupdate se>
Date:   Mon May 23 23:13:49 2022 +0200

    application: Use string templates instead of imports.format
    
    imports.format is deprecated. Use ES string templates instead.
    
    Keep using format for gettext. See also:
    https://gitlab.gnome.org/GNOME/gjs/-/issues/374

 src/application.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 29ab6f77..e3dae69c 100644
--- a/src/application.js
+++ b/src/application.js
@@ -29,7 +29,6 @@ import GtkClutter from 'gi://GtkClutter';
 import Hdy from 'gi://Handy';
 
 import {ContactPlace} from './contactPlace.js';
-const Format = imports.format;
 import {Geoclue} from './geoclue.js';
 import * as GeocodeFactory from './geocode.js';
 import {MainWindow} from './mainWindow.js';
@@ -43,6 +42,8 @@ import {Settings} from './settings.js';
 import * as Utils from './utils.js';
 import * as URIS from './uris.js';
 
+const Format = imports.format;
+
 const _ensuredTypes = [OSMTypeSearchEntry];
 
 export class Application extends Gtk.Application {
@@ -260,7 +261,7 @@ export class Application extends Gtk.Application {
         this._mainWindow.connect('destroy', () => this._onWindowDestroy());
         if (GLib.getenv('MAPS_DEBUG') === 'focus') {
             this._mainWindow.connect('set-focus', (window, widget) => {
-                log('* focus widget: %s'.format(widget));
+                log(`* focus widget: ${widget}`);
             });
         }
     }


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