[gnome-sound-recorder/wip/cdavis/gtk4] misc: make eslint happy & use newer APIs



commit f48386bd65fde29c7dc57d9fd3df1881a7c22413
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Thu Nov 18 21:23:26 2021 +0100

    misc: make eslint happy & use newer APIs

 src/application.js    | 2 +-
 src/recorderWidget.js | 2 +-
 src/row.js            | 3 +--
 src/waveform.js       | 8 ++++----
 4 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index bf61ef2..cd04121 100644
--- a/src/application.js
+++ b/src/application.js
@@ -18,7 +18,7 @@
 *
 */
 
-const { Gdk, Gio, GLib, GObject, Gst, Gtk, Adw } = imports.gi;
+const { Adw, Gio, GLib, GObject, Gst, Gtk } = imports.gi;
 
 var RecordingsDir = Gio.file_new_for_path(GLib.build_filenamev([GLib.get_user_data_dir(), pkg.name]));
 var CacheDir = Gio.file_new_for_path(GLib.build_filenamev([GLib.get_user_cache_dir(), pkg.name]));
diff --git a/src/recorderWidget.js b/src/recorderWidget.js
index a8470e2..d9db1dd 100644
--- a/src/recorderWidget.js
+++ b/src/recorderWidget.js
@@ -1,5 +1,5 @@
 /* exported RecorderState RecorderWidget */
-const { Gdk, Gio, GObject, Gtk } = imports.gi;
+const { Gio, GObject, Gtk } = imports.gi;
 const { formatTime } = imports.utils;
 const { WaveForm, WaveType } = imports.waveform;
 
diff --git a/src/row.js b/src/row.js
index 67a2a6d..20af436 100644
--- a/src/row.js
+++ b/src/row.js
@@ -136,9 +136,8 @@ var Row = GObject.registerClass({
         this.keyController.connect('key-pressed', (controller, key, _code, _state) => {
             this._entry.get_style_context().remove_class('error');
 
-            if (key === Gdk.KEY_Escape) {
+            if (key === Gdk.KEY_Escape)
                 this.editMode = false;
-            }
         });
         this._entry.add_controller(this.keyController);
 
diff --git a/src/waveform.js b/src/waveform.js
index f8570df..6ce8ced 100644
--- a/src/waveform.js
+++ b/src/waveform.js
@@ -23,7 +23,7 @@
 
 // based on code from Pitivi
 
-const { Gdk, Gio, GObject, Gtk } = imports.gi;
+const { Gio, GObject, Gtk } = imports.gi;
 const Cairo = imports.cairo;
 
 var WaveType = {
@@ -80,7 +80,7 @@ var WaveForm = GObject.registerClass({
         this.show();
     }
 
-    gesturePressed(n_press, x, y) {
+    gesturePressed() {
         this._startX = x;
         this.emit('gesture-pressed');
     }
@@ -90,12 +90,12 @@ var WaveForm = GObject.registerClass({
         this.queue_draw();
     }
 
-    gestureReleased(n_press, x, y) {
+    gestureReleased() {
         this._lastX = this._position;
         this.emit('position-changed', this.position);
     }
 
-    drawFunc(da, ctx, width, height) {
+    drawFunc(da, ctx) {
         const maxHeight = da.get_allocated_height();
         const vertiCenter = maxHeight / 2;
         const horizCenter = da.get_allocated_width() / 2;


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