[gnome-sound-recorder] gjs: Fix some "Too many arguments" warnings
- From: Jan Tojnar <jtojnar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder] gjs: Fix some "Too many arguments" warnings
- Date: Fri, 18 Jan 2019 00:30:50 +0000 (UTC)
commit 8ae615d83b1b50b88f8977bfb9c03ce6ae396481
Author: Miguel Vaello MartÃnez <miguel vaellomartinez gmail com>
Date: Sat Jul 1 16:32:07 2017 +0200
gjs: Fix some "Too many arguments" warnings
Removed some unnecessary parameters in certain functions.
Due the recent GJS changes some parameters are not necessary,
so make sense removing them for avoid some warning messages.
https://bugzilla.gnome.org/show_bug.cgi?id=784425
Closes: https://gitlab.gnome.org/GNOME/gnome-sound-recorder/issues/31
src/application.js | 3 +--
src/play.js | 11 +++++------
src/record.js | 8 +++-----
src/waveform.js | 4 ++--
4 files changed, 11 insertions(+), 15 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index ca1eed3..e3858fc 100644
--- a/src/application.js
+++ b/src/application.js
@@ -72,7 +72,7 @@ var Application = new Lang.Class({
Util.loadStyleSheet();
log(_("Sound Recorder started"));
- Gst.init(null, 0);
+ Gst.init(null);
this._initAppMenu();
application = this;
settings = new Gio.Settings({ schema: 'org.gnome.gnome-sound-recorder' });
@@ -172,4 +172,3 @@ var Application = new Lang.Class({
});
}
});
-
diff --git a/src/play.js b/src/play.js
index ca5af70..b27edc1 100644
--- a/src/play.js
+++ b/src/play.js
@@ -91,8 +91,8 @@ var Play = new Lang.Class({
} else if (this.ret == Gst.StateChangeReturn.SUCCESS) {
MainWindow.view.setVolume();
}
- GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGINT,
Application.application.onWindowDestroy, this.play);
- GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGTERM,
Application.application.onWindowDestroy, this.play);
+ GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGINT,
Application.application.onWindowDestroy);
+ GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGTERM,
Application.application.onWindowDestroy);
},
pausePlaying: function() {
@@ -178,8 +178,8 @@ var Play = new Lang.Class({
},
_updateTime: function() {
- var time = this.play.query_position(Gst.Format.TIME, null)[1]/Gst.SECOND;
- this.trackDuration = this.play.query_duration(Gst.Format.TIME, null)[1];
+ var time = this.play.query_position(Gst.Format.TIME)[1]/Gst.SECOND;
+ this.trackDuration = this.play.query_duration(Gst.Format.TIME)[1];
this.trackDurationSecs = this.trackDuration/Gst.SECOND;
if (time >= 0 && this.playState != PipelineStates.STOPPED) {
@@ -215,7 +215,7 @@ var Play = new Lang.Class({
queryPosition: function() {
var position = 0;
while (position == 0) {
- position = this.play.query_position(Gst.Format.TIME, null)[1]/Gst.SECOND;
+ position = this.play.query_position(Gst.Format.TIME)[1]/Gst.SECOND;
}
return position;
@@ -259,4 +259,3 @@ var Play = new Lang.Class({
}
}
});
-
diff --git a/src/record.js b/src/record.js
index e25ddd7..97169c2 100644
--- a/src/record.js
+++ b/src/record.js
@@ -151,12 +151,12 @@ var Record = new Lang.Class({
this.onEndOfStream();
}
- GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGINT,
Application.application.onWindowDestroy, this.pipeline);
- GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGTERM,
Application.application.onWindowDestroy, this.pipeline);
+ GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGINT,
Application.application.onWindowDestroy);
+ GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGTERM,
Application.application.onWindowDestroy);
},
_updateTime: function() {
- var time = this.pipeline.query_position(Gst.Format.TIME, null)[1]/Gst.SECOND;
+ var time = this.pipeline.query_position(Gst.Format.TIME)[1]/Gst.SECOND;
if (time >= 0) {
this._view.setLabel(time, 0);
@@ -375,5 +375,3 @@ var BuildFileName = new Lang.Class({
return this.dateTime;
}
});
-
-
diff --git a/src/waveform.js b/src/waveform.js
index 0cf3ace..66ae36c 100644
--- a/src/waveform.js
+++ b/src/waveform.js
@@ -95,8 +95,8 @@ var WaveForm = new Lang.Class({
var decode = this.pipeline.get_by_name("decode");
var bus = this.pipeline.get_bus();
bus.add_signal_watch();
- GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGINT,
Application.application.onWindowDestroy, this.pipeline);
- GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGTERM,
Application.application.onWindowDestroy, this.pipeline);
+ GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGINT,
Application.application.onWindowDestroy);
+ GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, Application.SIGTERM,
Application.application.onWindowDestroy);
this.nSamples = Math.ceil(this.duration / INTERVAL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]